JezK
Edit File: WebCenovnik.js
var pas={$libimports:{}},rtl={version:20301,quiet:!1,debug_load_units:!1,debug_rtti:!1,$res:{},debug:function(){!rtl.quiet&&console&&console.log&&console.log(arguments)},error:function(t){throw rtl.debug("Error: ",t),t},warn:function(t){rtl.debug("Warn: ",t)},checkVersion:function(t){if(rtl.version!=t)throw"expected rtl version "+t+", but found "+rtl.version},hiInt:Math.pow(2,53),hasString:function(t){return rtl.isString(t)&&t.length>0},isArray:function(t){return Array.isArray(t)},isFunction:function(t){return"function"==typeof t},isModule:function(t){return rtl.isObject(t)&&rtl.hasString(t.$name)&&pas[t.$name]===t},isImplementation:function(t){return rtl.isObject(t)&&rtl.isModule(t.$module)&&t.$module.$impl===t},isNumber:function(t){return"number"==typeof t},isObject:function(t){return"object"==typeof t&&null!=t},isString:function(t){return"string"==typeof t},getNumber:function(t){return"number"==typeof t?t:NaN},getChar:function(t){return"string"==typeof t&&1===t.length?t:""},getObject:function(t){return"object"==typeof t||"function"==typeof t?t:null},isTRecord:function(t){return rtl.isObject(t)&&t.hasOwnProperty("$new")&&"function"==typeof t.$new},isPasClass:function(t){return rtl.isObject(t)&&t.hasOwnProperty("$classname")&&rtl.isObject(t.$module)},isPasClassInstance:function(t){return rtl.isObject(t)&&rtl.isPasClass(t.$class)},hexStr:function(t,e){return("000000000000000"+t.toString(16).toUpperCase()).slice(-e)},m_loading:0,m_loading_intf:1,m_intf_loaded:2,m_loading_impl:3,m_initializing:4,m_initialized:5,module:function(t,e,i,s){rtl.debug_load_units&&rtl.debug('rtl.module name="'+t+'" intfuses='+e+" impluses="+s),rtl.hasString(t)||rtl.error('invalid module name "'+t+'"'),rtl.isArray(e)||rtl.error('invalid interface useslist of "'+t+'"'),rtl.isFunction(i)||rtl.error('invalid interface code of "'+t+'"'),null==s||rtl.isArray(s)||rtl.error('invalid implementation useslist of "'+t+'"'),pas[t]&&rtl.error('module "'+t+'" is already registered');var n=Object.create(rtl.tSectionRTTI),r=n.$module=pas[t]={$name:t,$intfuseslist:e,$impluseslist:s,$state:rtl.m_loading,$intfcode:i,$implcode:null,$impl:null,$rtti:n};s&&(r.$impl={$module:r,$rtti:n})},exitcode:0,run:function(t){try{rtl.hasString(t)||(t="program"),rtl.debug_load_units&&rtl.debug('rtl.run module="'+t+'"'),rtl.initRTTI();var e=pas[t];if(e||rtl.error('rtl.run module "'+t+'" missing'),rtl.loadintf(e),rtl.loadimpl(e),"program"==t||"library"==t){rtl.debug_load_units&&rtl.debug("running $main");var i=pas[t].$main();rtl.isNumber(i)&&(rtl.exitcode=i)}}catch(t){if(!rtl.showUncaughtExceptions)throw t;rtl.handleUncaughtException(t)||(rtl.showException(t),rtl.exitcode=216)}return rtl.exitcode},showException:function(t){var e=rtl.hasString(t.$classname)?t.$classname:"";e+=(e?": ":"")+(t.hasOwnProperty("fMessage")?t.fMessage:t),alert("Uncaught Exception : "+e)},handleUncaughtException:function(t){if(!rtl.onUncaughtException)return!1;try{return rtl.onUncaughtException(t),!0}catch(t){return!1}},loadintf:function(t){t.$state>rtl.m_loading_intf||(rtl.debug_load_units&&rtl.debug('loadintf: "'+t.$name+'"'),t.$state===rtl.m_loading_intf&&rtl.error('unit cycle detected "'+t.$name+'"'),t.$state=rtl.m_loading_intf,rtl.loaduseslist(t,t.$intfuseslist,rtl.loadintf),rtl.debug_load_units&&rtl.debug('loadintf: run intf of "'+t.$name+'"'),t.$intfcode(t.$intfuseslist),t.$state=rtl.m_intf_loaded)},loaduseslist:function(t,e,i){if(null!=e)for(var s=e.length,n=0;n<s;n++){var r=e[n];rtl.debug_load_units&&rtl.debug('loaduseslist of "'+t.$name+'" uses="'+r+'"'),null==pas[r]&&rtl.error('module "'+t.$name+'" misses "'+r+'"'),i(pas[r])}},loadimpl:function(t){t.$state>=rtl.m_loading_impl||(t.$state<rtl.m_intf_loaded&&rtl.error('loadimpl: interface not loaded of "'+t.$name+'"'),rtl.debug_load_units&&rtl.debug('loadimpl: load uses of "'+t.$name+'"'),t.$state=rtl.m_loading_impl,rtl.loaduseslist(t,t.$impluseslist,rtl.loadintf),rtl.loaduseslist(t,t.$intfuseslist,rtl.loadimpl),rtl.loaduseslist(t,t.$impluseslist,rtl.loadimpl),rtl.debug_load_units&&rtl.debug('loadimpl: run impl of "'+t.$name+'"'),rtl.isFunction(t.$implcode)&&t.$implcode(t.$impluseslist),rtl.debug_load_units&&rtl.debug('loadimpl: run init of "'+t.$name+'"'),t.$state=rtl.m_initializing,rtl.isFunction(t.$init)&&t.$init(),t.$state=rtl.m_initialized)},createCallback:function(t,e){var i;if("string"==typeof e){if(t.hasOwnProperty("$events")||(t.$events={}),i=t.$events[e])return i;t.$events[e]=i=function(){return t[e].apply(t,arguments)}}else i=function(){return e.apply(t,arguments)};return i.scope=t,i.fn=e,i},createSafeCallback:function(t,e){var i;if("string"==typeof e){if(t.hasOwnProperty("$events")||(t.$events={}),i=t.$events[e])return i;t.$events[e]=i=function(){try{return t[e].apply(t,arguments)}catch(t){if(!rtl.handleUncaughtException(t))throw t}}}else i=function(){try{return e.apply(t,arguments)}catch(t){if(!rtl.handleUncaughtException(t))throw t}};return i.scope=t,i.fn=e,i},eqCallback:function(t,e){return t===e||null!=t&&null!=e&&t.fn&&t.scope===e.scope&&t.fn===e.fn},initStruct:function(t,e,i){return e.$module&&e.$module.$impl===e&&(e=e.$module),t.$parent=e,rtl.isModule(e)?(t.$module=e,t.$name=i):(t.$module=e.$module,t.$name=e.$name+"."+i),e},initClass:function(t,e,i,s,n){e[i]=t,t.$class=t,t.$classname=n||i,e=rtl.initStruct(t,e,i),t.$fullname=e.$name+"."+i,rtl.debug_rtti&&rtl.debug("initClass "+t.$fullname);var r=t.$module.$rtti.$Class(t.$classname,{class:t});t.$rtti=r,rtl.isObject(t.$ancestor)&&(r.ancestor=t.$ancestor.$rtti),r.ancestor||(r.ancestor=null),s.call(t)},createClass:function(t,e,i,s,n){var r=null;null!=i?(r=Object.create(i)).$ancestor=i:((r={$ancestor:null}).$create=function(t,e){null==e&&(e=[]);var i=Object.create(this);i.$init();try{"string"==typeof t?i[t].apply(i,e):t.apply(i,e),i.AfterConstruction()}catch(t){throw i.Destroy&&i.Destroy(),i.$final(),t}return i},r.$destroy=function(t){this.BeforeDestruction(),this[t]&&this[t](),this.$final()}),rtl.initClass(r,t,e,s,n)},createClassExt:function(t,e,i,s,n,r){var o=rtl.isFunction(i),l=null;if(o?((l=Object.create(i.prototype)).$ancestorfunc=i,l.$ancestor=null):i.$func?(o=!0,(l=Object.create(i)).$ancestor=i):(l=Object.create(i)).$ancestor=null,l.$create=function(t,e){null==e&&(e=[]);var i=null;(i=s.length>0?this[s](t,e):o?new this.$func(e):Object.create(l)).$init&&i.$init();try{"string"==typeof t?this[t].apply(i,e):t.apply(i,e),i.AfterConstruction&&i.AfterConstruction()}catch(t){throw i.Destroy&&i.Destroy(),i.$final&&i.$final(),t}return i},l.$destroy=function(t){this.BeforeDestruction&&this.BeforeDestruction(),this[t]&&this[t](),this.$final&&this.$final()},rtl.initClass(l,t,e,n,r),o){function a(){}a.prototype=l,l.$func=a}},createHelper:function(t,e,i,s,n){var r=null;null!=i?(r=Object.create(i)).$ancestor=i:r={$ancestor:null},t[e]=r,r.$class=r,r.$classname=n||e,t=rtl.initStruct(r,t,e),r.$fullname=t.$name+"."+e;var o=r.$module.$rtti.$Helper(r.$classname,{helper:r});r.$rtti=o,rtl.isObject(i)&&(o.ancestor=i.$rtti),o.ancestor||(o.ancestor=null),s.call(r)},tObjectDestroy:"Destroy",free:function(t,e){if(null==t[e])return null;t[e].$destroy(rtl.tObjectDestroy),t[e]=null},freeLoc:function(t){return null==t||t.$destroy(rtl.tObjectDestroy),null},hideProp:function(t,e,i){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0}),arguments.length>2&&(t[e]=i)},recNewT:function(t,e,i,s){var n={};t&&(t[e]=n);var r=rtl.hideProp;return s&&(rtl.initStruct(n,t,e),n.$record=n,r(n,"$record"),r(n,"$name"),r(n,"$parent"),r(n,"$module"),r(n,"$initSpec")),i.call(n),n.$new||(n.$new=function(){return Object.create(n)}),n.$clone=function(t){return n.$new().$assign(t)},r(n,"$new"),r(n,"$clone"),r(n,"$eq"),r(n,"$assign"),n},is:function(t,e){return e.isPrototypeOf(t)||t===e},isExt:function(t,e,i){return null!=t&&(("object"==typeof e||"function"==typeof e)&&(t===e?1!==i&&(2!==i||rtl.isPasClass(t)):e.isPrototypeOf&&e.isPrototypeOf(t)?1===i?rtl.isPasClassInstance(t):2!==i||rtl.isPasClass(t):"function"==typeof e&&t instanceof e))},Exception:null,EInvalidCast:null,EAbstractError:null,ERangeError:null,EIntOverflow:null,EPropWriteOnly:null,raiseE:function(t){var e=rtl[t];if(null==e){var i=pas.SysUtils;i||(i=pas.sysutils),i&&((e=i[t])||(e=i[t.toLowerCase()]),e||(e=i.Exception),e||(e=i.exception))}if(e){if(e.Create)throw e.$create("Create");if(e.create)throw e.$create("create")}if("EInvalidCast"===t)throw"invalid type cast";if("EAbstractError"===t)throw"Abstract method called";if("ERangeError"===t)throw"range error";throw t},as:function(t,e){if(null===t||rtl.is(t,e))return t;rtl.raiseE("EInvalidCast")},asExt:function(t,e,i){if(null===t||rtl.isExt(t,e,i))return t;rtl.raiseE("EInvalidCast")},createInterface:function(t,e,i,s,n,r){var o=n?Object.create(n):{};if(t[e]=o,o.$module=t,o.$name=e,o.$fullname=t.$name+"."+e,o.$guid=i,o.$guidr=null,o.$names=s||[],rtl.isFunction(r)){rtl.debug_rtti&&rtl.debug("createInterface "+o.$fullname);var l=o.$module.$rtti.$Interface(e,{interface:o,module:t});o.$rtti=l,n&&(l.ancestor=n.$rtti),l.ancestor||(l.ancestor=null),r.call(o)}return o},strToGUIDR:function(t,e){var i=0;function s(e){var s=t.substr(i,e);return i+=e,parseInt(s,16)}i+=1,e.D1=s(8),i+=1,e.D2=s(4),i+=1,e.D3=s(4),i+=1,e.D4||(e.D4=[]),e.D4[0]=s(2),e.D4[1]=s(2),i+=1;for(var n=2;n<8;n++)e.D4[n]=s(2);return e},guidrToStr:function(t){if(t.$intf)return t.$intf.$guid;for(var e=rtl.hexStr,i="{"+e(t.D1,8)+"-"+e(t.D2,4)+"-"+e(t.D3,4)+"-"+e(t.D4[0],2)+e(t.D4[1],2)+"-",s=2;s<8;s++)i+=e(t.D4[s],2);return i+="}"},createTGUID:function(t){var e=pas.System?pas.System.TGuid:pas.system.tguid;return rtl.strToGUIDR(t,e.$new())},getIntfGUIDR:function(t){if(!t)return null;if(!t.$guidr){var e=rtl.createTGUID(t.$guid);t.hasOwnProperty("$guid")||(t=Object.getPrototypeOf(t)),e.$intf=t,t.$guidr=e}return t.$guidr},addIntf:function(t,e,i){function s(t){return"function"==typeof t?function(){return t.apply(this.$o,arguments)}:function(){rtl.raiseE("EAbstractError")}}i||(i={});var n=e,r=Object.create(n);t.hasOwnProperty("$intfmaps")||(t.$intfmaps={}),t.$intfmaps[e.$guid]=r;do{var o=n.$names;if(!o)break;for(var l=0;l<o.length;l++){var a=o[l],h=i[a];h||(h=a),r[a]=s(t[h])}n=Object.getPrototypeOf(n)}while(null!=n)},getIntfG:function(t,e,i){if(!t)return null;var s=t.$intfmaps;if(!s)return null;var n=s[e];if(!n)return null;if("function"==typeof n)return n.call(t);var r=null;if(t.$interfaces&&(r=t.$interfaces[e]),r||((r=Object.create(n)).$o=t,t.$interfaces||(t.$interfaces={}),t.$interfaces[e]=r),"object"==typeof i){var o=null;return 0===r.QueryInterface(rtl.getIntfGUIDR(i),{get:function(){return o},set:function(t){o=t}})?o:null}return 2===i&&"com"===r.$kind&&r._AddRef(),r},getIntfT:function(t,e){return rtl.getIntfG(t,e.$guid)},queryIntfT:function(t,e){return rtl.getIntfG(t,e.$guid,e)},queryIntfIsT:function(t,e){var i=rtl.getIntfG(t,e.$guid);return!!i&&("com"===i.$kind&&i._Release(),!0)},asIntfT:function(t,e){var i=rtl.getIntfG(t,e.$guid);if(null!==i)return i;rtl.raiseEInvalidCast()},intfIsIntfT:function(t,e){return null!==t&&rtl.queryIntfIsT(t.$o,e)},intfAsIntfT:function(t,e){if(!t)return null;var i=rtl.getIntfG(t.$o,e.$guid);if(i)return i;rtl.raiseEInvalidCast()},intfIsClass:function(t,e){return null!=t&&rtl.is(t.$o,e)},intfAsClass:function(t,e){return null==t?null:rtl.as(t.$o,e)},intfToClass:function(t,e){return null!==t&&rtl.is(t.$o,e)?t.$o:null},intfRefs:{ref:function(t,e){var i=this[t];return i&&(delete this[t],i._Release()),e&&(this[t]=e),e},free:function(){for(var t in this)if(this.hasOwnProperty(t)){var e=this[t];e&&e._Release()}}},createIntfRefs:function(){return Object.create(rtl.intfRefs)},setIntfP:function(t,e,i,s){var n=t[e];n!==i&&(null!==n&&(t[e]=null,n._Release()),null!==i&&(s||i._AddRef(),t[e]=i))},setIntfL:function(t,e,i){return t!==e?(null!==e&&(i||e._AddRef()),null!==t&&t._Release()):i&&null!==t&&t._Release(),e},_AddRef:function(t){return t&&t._AddRef(),t},_Release:function(t){return t&&t._Release(),t},_ReleaseArray:function(t,e){if(!t)return null;for(var i=0;i<t.length;i++)e<=1?t[i]&&t[i]._Release():rtl._ReleaseArray(t[i],e-1);return null},trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)},checkMethodCall:function(t,e){rtl.isObject(t)&&rtl.is(t,e)||rtl.raiseE("EInvalidCast")},oc:function(t){if(Math.floor(t)===t&&t>=-9007199254740991&&t<=9007199254740991)return t;rtl.raiseE("EIntOverflow")},rc:function(t,e,i){if(Math.floor(t)===t&&t>=e&&t<=i)return t;rtl.raiseE("ERangeError")},rcc:function(t,e,i){if("string"==typeof t&&1===t.length){var s=t.charCodeAt(0);if(s>=e&&s<=i)return t}rtl.raiseE("ERangeError")},rcSetCharAt:function(t,e,i){return("string"!=typeof t||e<0||e>=t.length)&&rtl.raiseE("ERangeError"),rtl.setCharAt(t,e,i)},rcCharAt:function(t,e){return("string"!=typeof t||e<0||e>=t.length)&&rtl.raiseE("ERangeError"),t.charAt(e)},rcArrR:function(t,e){if(Array.isArray(t)&&"number"==typeof e&&e>=0&&e<t.length){if(arguments.length>2){t=t[e];for(var i=2;i<arguments.length;i++)t=rtl.rcArrR(t,arguments[i]);return t}return t[e]}rtl.raiseE("ERangeError")},rcArrW:function(t,e,i){for(var s=3;s<arguments.length;s++)t=rtl.rcArrR(t,e),e=arguments[s-1],i=arguments[s];if(Array.isArray(t)&&"number"==typeof e&&e>=0&&e<t.length)return t[e]=i;rtl.raiseE("ERangeError")},length:function(t){return null==t?0:t.length},arrayRef:function(t){return null!=t&&rtl.hideProp(t,"$pas2jsrefcnt",1),t},arraySetLength:function(t,e,i){for(var s=[],n=9999,r=2;r<arguments.length;r++){var o=arguments[r];"s"===o?n=r-2:s.push({dim:o+0,a:null,i:0,src:null})}for(var l=s.length-1,a=0,h=0,u=null,d=null,c=t,F=0,p=0;;)if(a>0&&(c=(u=s[a-1]).src&&u.src.length>u.i?u.src[u.i]:null),c?c.$pas2jsrefcnt>0||a>=n?(d=[],p=F=c.length):(F=0,p=(d=c).length):(d=[],F=0,p=0),h=s[a].dim,d.length=h,!(a>0&&(u.a[u.i]=d,u.i++,0===h&&u.i<u.a.length))){if(h>0){if(a<l){(u=s[a]).a=d,u.i=0,u.src=c,a++;continue}if(F>h&&(F=h),rtl.isArray(e)){for(r=0;r<F;r++)d[r]=c[r];for(r=p;r<h;r++)d[r]=[]}else if(rtl.isObject(e))if(rtl.isTRecord(e)){for(r=0;r<F;r++)d[r]=e.$clone(c[r]);for(r=p;r<h;r++)d[r]=e.$new()}else{for(r=0;r<F;r++)d[r]=rtl.refSet(c[r]);for(r=p;r<h;r++)d[r]={}}else{for(r=0;r<F;r++)d[r]=c[r];for(r=p;r<h;r++)d[r]=e}}for(;a>0&&s[a-1].i>=s[a-1].dim;)a--;if(0===a)return 0===l?d:s[0].a}},arrayEq:function(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0},arrayClone:function(t,e,i,s,n,r){if("refSet"===t)for(;i<s;i++)n[r++]=rtl.refSet(e[i]);else if("slice"===t)for(;i<s;i++)n[r++]=e[i].slice(0);else if("function"==typeof t)for(;i<s;i++)n[r++]=t(e[i]);else if(rtl.isTRecord(t))for(;i<s;i++)n[r++]=t.$clone(e[i]);else for(;i<s;i++)n[r++]=e[i]},arrayConcat:function(t){for(var e=[],i=0,s=1;s<arguments.length;s++){null!==(n=arguments[s])&&(i+=n.length)}e.length=i,i=0;for(s=1;s<arguments.length;s++){var n;null!==(n=arguments[s])&&(rtl.arrayClone(t,n,0,n.length,e,i),i+=n.length)}return e},arrayConcatN:function(){for(var t=null,e=0;e<arguments.length;e++){var i=arguments[e];if(null!==i)if(null===t)t=rtl.arrayRef(i);else if(t.$pas2jsrefcnt)t=t.concat(i);else for(e=0;e<i.length;e++)t.push(i[e])}return t},arrayPush:function(t,e){return null===e?e=[]:e.$pas2jsrefcnt&&(e=rtl.arrayCopy(t,e,0,e.length)),rtl.arrayClone(t,arguments,2,arguments.length,e,e.length),e},arrayPushN:function(t){null===t?t=[]:t.$pas2jsrefcnt&&(t=t.concat());for(var e=1;e<arguments.length;e++)t.push(arguments[e]);return t},arrayCopy:function(t,e,i,s){if(null===e)return[];i<0&&(i=0),void 0===s&&(s=e.length);var n=i+s;if(n>e.length&&(n=e.length),i>=n)return[];if(0===t)return e.slice(i,n);var r=[];return r.length=n-i,rtl.arrayClone(t,e,i,n,r,0),r},arrayInsert:function(t,e,i){return e?(e.splice(i,0,t),e):[t]},setCharAt:function(t,e,i){return t.substr(0,e)+i+t.substr(e+1)},getResStr:function(t,e){var i=t.$resourcestrings[e];return i.current?i.current:i.org},createSet:function(){for(var t={},e=0;e<arguments.length;e++)if(null!=arguments[e])t[arguments[e]]=!0;else for(var i=arguments[e+=1],s=arguments[e+=1],n=i;n<=s;n++)t[n]=!0;return t},cloneSet:function(t){var e={};for(var i in t)e[i]=!0;return e},refSet:function(t){return rtl.hideProp(t,"$shared",!0),t},includeSet:function(t,e){return t.$shared&&(t=rtl.cloneSet(t)),t[e]=!0,t},excludeSet:function(t,e){return t.$shared&&(t=rtl.cloneSet(t)),delete t[e],t},diffSet:function(t,e){var i={};for(var s in t)e[s]||(i[s]=!0);return i},unionSet:function(t,e){var i={};for(var s in t)i[s]=!0;for(var s in e)i[s]=!0;return i},intersectSet:function(t,e){var i={};for(var s in t)e[s]&&(i[s]=!0);return i},symDiffSet:function(t,e){var i={};for(var s in t)e[s]||(i[s]=!0);for(var s in e)t[s]||(i[s]=!0);return i},eqSet:function(t,e){for(var i in t)if(!e[i])return!1;for(var i in e)if(!t[i])return!1;return!0},neSet:function(t,e){return!rtl.eqSet(t,e)},leSet:function(t,e){for(var i in t)if(!e[i])return!1;return!0},geSet:function(t,e){for(var i in e)if(!t[i])return!1;return!0},strSetLength:function(t,e){var i=t.length;if(i>e)return t.substring(0,e);if(t.repeat)return t+" ".repeat(e-i);for(;i<e;)t+=" ",i++;return t},spaceLeft:function(t,e){var i=t.length;if(i>=e)return t;if(t.repeat)return" ".repeat(e-i)+t;for(;i<e;)t=" "+t,i++;return t},floatToStr:function(t,e,i){if(arguments.length>2)return rtl.spaceLeft(t.toFixed(i),e);var s="",n=Math.abs(t);n>1&&n<1e10||n>1e-10&&n<1?s="00":(n>1&&n<1e100||n<1e-10)&&(s="0"),arguments.length<2?e=24:e<9&&(e=9);i=e-8;var r=(t>0?" ":"")+t.toExponential(i);return r=r.replace(/e(.)/,"E$1"+s),rtl.spaceLeft(r,e)},valEnum:function(t,e,i){for(var s in t=t.toLowerCase(),e)if("string"==typeof s&&s.toLowerCase()===t)return i(0),e[s];return i(1),0},lw:function(t){return t<0?t+4294967296:t},and:function(t,e){var i=2147483648;return(t/i&e/i)*i+(2147483647&t&e)},or:function(t,e){var i=2147483648;return(t/i|e/i)*i+(2147483647&t|2147483647&e)},xor:function(t,e){var i=2147483648;return(t/i^e/i)*i+(2147483647&t^2147483647&e)},shr:function(t,e){return t<0&&(t+=rtl.hiInt),t<2147483648?t>>e:e<=0?t:e>54?0:Math.floor(t/Math.pow(2,e))},shl:function(t,e){if(t<0&&(t+=rtl.hiInt),e<=0)return t;if(e>54)return 0;var i=t*Math.pow(2,e);return i<=rtl.hiInt?i:i%rtl.hiInt},initRTTI:function(){function t(t,e,i){i||(i=rtl.tTypeInfo),rtl.debug_rtti&&rtl.debug('initRTTI.newBaseTI "'+t+'" '+e+' ("'+i.name+'")');var s=Object.create(i);return s.name=t,s.kind=e,rtl[t]=s,s}function e(e,i,s,n){var r=t(e,1,rtl.tTypeInfoInteger);return r.minvalue=i,r.maxvalue=s,r.ordtype=n,r}function i(t,e){var i=Object.create(rtl.tTypeMember);i.name=t,i.kind=e,rtl[t]=i}rtl.debug_rtti&&rtl.debug("initRTTI"),rtl.tTypeInfo={name:"tTypeInfo",kind:0,$module:null,attr:null},t("tTypeInfoInteger",1),e("shortint",-128,127,0),e("byte",0,255,1),e("smallint",-32768,32767,2),e("word",0,65535,3),e("longint",-2147483648,2147483647,4),e("longword",0,4294967295,5),e("nativeint",-4503599627370496,0xfffffffffffff,6),e("nativeuint",0,0xfffffffffffff,7),t("char",2),t("string",3),t("tTypeInfoEnum",4,rtl.tTypeInfoInteger),t("tTypeInfoSet",5),t("double",6),t("boolean",7),t("tTypeInfoProcVar",8),t("tTypeInfoMethodVar",9,rtl.tTypeInfoProcVar),t("tTypeInfoArray",10),t("tTypeInfoDynArray",11),t("tTypeInfoPointer",15),t("pointer",15,rtl.tTypeInfoPointer).reftype=null,t("jsvalue",16),t("tTypeInfoRefToProcVar",17,rtl.tTypeInfoProcVar),rtl.tTypeMember={attr:null},i("tTypeMemberField",1),i("tTypeMemberMethod",2),i("tTypeMemberProperty",3),rtl.tTypeMembers={};var s=t("tTypeInfoStruct",0);s.$addMember=function(t,e,i){if(rtl.debug_rtti){if(!rtl.hasString(t)||"$"===t.charAt())throw'invalid member "'+t+'", this="'+this.name+'"';if(!rtl.is(e,rtl.tTypeMember))throw'invalid ancestor "'+e+":"+e.name+'", "'+this.name+"."+t+'"';if(null!=i&&"object"!=typeof i)throw'invalid options "'+i+'", "'+this.name+"."+t+'"'}var s=Object.create(e);if(s.name=t,this.members[t]=s,this.names.push(t),rtl.isObject(i))for(var n in i)i.hasOwnProperty(n)&&(s[n]=i[n]);return s},s.addField=function(t,e,i){var s=this.$addMember(t,rtl.tTypeMemberField,i);if(rtl.debug_rtti&&!rtl.is(e,rtl.tTypeInfo))throw'invalid type "'+e+'", "'+this.name+"."+t+'"';return s.typeinfo=e,this.fields.push(t),s},s.addFields=function(){for(var t=0;t<arguments.length;){var e=arguments[t++],i=arguments[t++];t<arguments.length&&"object"==typeof arguments[t]?this.addField(e,i,arguments[t++]):this.addField(e,i)}},s.addMethod=function(t,e,i,s,n,r){var o=this.$addMember(t,rtl.tTypeMemberMethod,r);return o.methodkind=e,o.procsig=rtl.newTIProcSig(i,s,n),this.methods.push(t),o},s.addProperty=function(t,e,i,s,n,r){var o=this.$addMember(t,rtl.tTypeMemberProperty,r);return o.flags=e,o.typeinfo=i,o.getter=s,o.setter=n,o.params=rtl.isArray(o.params)?rtl.newTIParams(o.params):null,this.properties.push(t),rtl.isString(o.stored)||(o.stored=""),o},s.getField=function(t){return this.members[this.fields[t]]},s.getMethod=function(t){return this.members[this.methods[t]]},s.getProperty=function(t){return this.members[this.properties[t]]},t("tTypeInfoRecord",12,rtl.tTypeInfoStruct),t("tTypeInfoClass",13,rtl.tTypeInfoStruct),t("tTypeInfoClassRef",14),t("tTypeInfoInterface",18,rtl.tTypeInfoStruct),t("tTypeInfoHelper",19,rtl.tTypeInfoStruct),t("tTypeInfoExtClass",20,rtl.tTypeInfoClass)},tSectionRTTI:{$module:null,$inherited:function(t,e,i){rtl.debug_rtti&&rtl.debug('tSectionRTTI.newTI "'+(this.$module?this.$module.$name:"(no module)")+'"."'+t+'" ('+e.name+") "+(i?"init":"forward"));var s=this[t];if(s){if(!s.$forward)throw'duplicate type "'+t+'"';if(!e.isPrototypeOf(s))throw'typeinfo ancestor mismatch "'+t+'" ancestor="'+e.name+'" t.name="'+s.name+'"'}else(s=Object.create(e)).name=t,s.$module=this.$module,this[t]=s;if(i)for(var n in delete s.$forward,i)i.hasOwnProperty(n)&&(s[n]=i[n]);else s.$forward=!0;return s},$Scope:function(t,e,i){var s=this.$inherited(t,e,i);return s.members={},s.names=[],s.fields=[],s.methods=[],s.properties=[],s},$TI:function(t,e,i){var s=this.$inherited(t,rtl.tTypeInfo,i);return s.kind=e,s},$Int:function(t,e){return this.$inherited(t,rtl.tTypeInfoInteger,e)},$Enum:function(t,e){return this.$inherited(t,rtl.tTypeInfoEnum,e)},$Set:function(t,e){return this.$inherited(t,rtl.tTypeInfoSet,e)},$StaticArray:function(t,e){return this.$inherited(t,rtl.tTypeInfoArray,e)},$DynArray:function(t,e){return this.$inherited(t,rtl.tTypeInfoDynArray,e)},$ProcVar:function(t,e){return this.$inherited(t,rtl.tTypeInfoProcVar,e)},$RefToProcVar:function(t,e){return this.$inherited(t,rtl.tTypeInfoRefToProcVar,e)},$MethodVar:function(t,e){return this.$inherited(t,rtl.tTypeInfoMethodVar,e)},$Record:function(t,e){return this.$Scope(t,rtl.tTypeInfoRecord,e)},$Class:function(t,e){return this.$Scope(t,rtl.tTypeInfoClass,e)},$ClassRef:function(t,e){return this.$inherited(t,rtl.tTypeInfoClassRef,e)},$Pointer:function(t,e){return this.$inherited(t,rtl.tTypeInfoPointer,e)},$Interface:function(t,e){return this.$Scope(t,rtl.tTypeInfoInterface,e)},$Helper:function(t,e){return this.$Scope(t,rtl.tTypeInfoHelper,e)},$ExtClass:function(t,e){return this.$Scope(t,rtl.tTypeInfoExtClass,e)}},newTIParam:function(t){return{name:t[0],typeinfo:t[1],flags:rtl.isNumber(t[2])?t[2]:0}},newTIParams:function(t){var e=[];if(rtl.isArray(t))for(var i=0;i<t.length;i++)e.push(rtl.newTIParam(t[i]));return e},newTIProcSig:function(t,e,i){return{params:rtl.newTIParams(t),resulttype:e||null,flags:i||0}},addResource:function(t){rtl.$res[t.name]=t},getResource:function(t){var e=rtl.$res[t];return void 0!==e?e:null},getResourceList:function(){return Object.keys(rtl.$res)}};rtl.module("System",[],(function(){"use strict";var t=this,e=t.$impl;this.LineEnding="\n",this.sLineBreak=this.LineEnding,this.MaxLongint=2147483647,this.Maxint=2147483647,this.TTextLineBreakStyle={0:"tlbsLF",tlbsLF:0,1:"tlbsCRLF",tlbsCRLF:1,2:"tlbsCR",tlbsCR:2},rtl.recNewT(this,"TMethod",(function(){this.Code=null,this.Data=null,this.$eq=function(t){return this.Code===t.Code&&this.Data===t.Data},this.$assign=function(t){return this.Code=t.Code,this.Data=t.Data,this}})),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.InheritsFrom=function(t){return null!=t&&(this==t||t.isPrototypeOf(this))},this.MethodAddress=function(t){var e=null;if(e=null,""===t)return e;var i,s=0,n=this.$rtti,r="";for(i=t.toLowerCase();""===r&&null!=n;){for(s=0;""===r&&s<n.methods.length;)n.getMethod(s).name.toLowerCase()===i&&(r=n.getMethod(s).name),s+=1;""===r&&(n=n.ancestor)}return""!==r&&(e=this[r]),e},this.FieldAddress=function(t){if(null,""===t)return null;for(var e=this.$class,i=null,s=t.toLowerCase(),n=null;null!==e;){for(var r=0,o=(i=e.$rtti).fields.length-1;r<=o;r++)if((n=i.getField(r)).name.toLowerCase()===s)return n;e=e.$ancestor?e.$ancestor:null}return null},this.ClassInfo=function(){return this.$rtti},this.AfterConstruction=function(){},this.BeforeDestruction=function(){}})),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.vtInteger=0,this.vtExtended=3,this.vtWideChar=9,this.vtCurrency=12,this.vtUnicodeString=18,this.vtNativeInt=19,rtl.recNewT(this,"TVarRec",(function(){this.VType=0,this.VJSValue=void 0,this.$eq=function(t){return this.VType===t.VType&&this.VJSValue===t.VJSValue&&this.VJSValue===t.VJSValue&&this.VJSValue===t.VJSValue&&this.VJSValue===t.VJSValue&&this.VJSValue===t.VJSValue&&this.VJSValue===t.VJSValue&&this.VJSValue===t.VJSValue},this.$assign=function(t){return this.VType=t.VType,this.VJSValue=t.VJSValue,this.VJSValue=t.VJSValue,this.VJSValue=t.VJSValue,this.VJSValue=t.VJSValue,this.VJSValue=t.VJSValue,this.VJSValue=t.VJSValue,this.VJSValue=t.VJSValue,this}})),this.VarRecs=function(){var e=[],i=0,s=null;for(e=[];i<arguments.length;)(s=t.TVarRec.$new()).VType=rtl.trunc(arguments[i]),i+=1,s.VJSValue=arguments[i],i+=1,e.push(t.TVarRec.$clone(s));return e},this.Frac=function(t){return t%1},this.Trunc=function(e){return Math.trunc||(Math.trunc=function(t){return t=+t,isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t}),t.Trunc=Math.trunc,Math.trunc(e)},this.DefaultTextLineBreakStyle=0,this.Int=function(e){return t.Trunc(e)},this.Copy=function(t,e,i){return e<1&&(e=1),i>0?t.substring(e-1,e+i-1):""},this.Copy$1=function(t,e){return e<1&&(e=1),t.substr(e-1)},this.Delete=function(e,i,s){var n;i<1||i>e.get().length||s<=0||(n=e.get(),e.set(t.Copy(n,1,i-1)+t.Copy$1(n,i+s)))},this.Pos=function(t,e){return e.indexOf(t)+1},this.Insert=function(e,i,s){var n;""!==e&&(n=i.get(),s<1?i.set(e+n):s>n.length?i.set(n+e):i.set(t.Copy(n,1,s-1)+e+t.Copy(n,s,n.length)))},this.upcase=function(t){return t.toUpperCase()},this.val=function(t,i,s){i.set(e.valint(t,-9007199254740991,9007199254740991,s))},this.val$6=function(t,i,s){i.set(e.valint(t,-2147483648,2147483647,s))},this.StringOfChar=function(t,e){var i="";if(e>0&&t.repeat)return t.repeat(e);i="";for(var s=1,n=e;s<=n;s++)s,i+=t;return i},this.Writeln=function(){var t=0,i=0,s="";if(i=arguments.length-1,null!=e.WriteCallBack)for(var n=0,r=i;n<=r;n++)t=n,e.WriteCallBack(arguments[t],t===i);else{s=e.WriteBuf;for(var o=0,l=i;o<=l;o++)s=s+""+arguments[t=o];console.log(s),e.WriteBuf=""}},this.Assigned=function(t){return null!=t&&null!=t&&(!rtl.isArray(t)||t.length>0)},t.$implcode=function(){e.WriteBuf="",e.WriteCallBack=null,e.valint=function(e,i,s,n){var r=0,o=0;if(""===e)return n.set(1),r;if(o=Number(e),isNaN(o)){var l=t.Copy(e,1,1);if("$"===l)o=Number("0x"+t.Copy$1(e,2));else if("&"===l)o=Number("0o"+t.Copy$1(e,2));else{if("%"!==l)return n.set(1),r;o=Number("0b"+t.Copy$1(e,2))}}return isNaN(o)||o!==t.Int(o)?n.set(1):o<i||o>s?n.set(2):(r=t.Trunc(o),n.set(0)),r}},t.$init=function(){rtl.exitcode=0}}),[]),rtl.module("RTLConsts",["System"],(function(){"use strict";this.$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."},SListIndexError:{org:"List index (%s) out of bounds"},SSortedListError:{org:"Operation not allowed on sorted list"},SDuplicateString:{org:"String list does not allow duplicates"},SErrFindNeedsSortedList:{org:"Cannot use find on unsorted list"},SInvalidName:{org:'Invalid component name: "%s"'},SDuplicateName:{org:'Duplicate component name: "%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'},SErrInvalidInteger:{org:'Invalid integer value: "%s"'},SErrInvalidFloat:{org:'Invalid floating-point value: "%s"'}}})),rtl.module("Types",["System"],(function(){"use strict";var t=this;this.TDirection={0:"FromBeginning",FromBeginning:0,1:"FromEnd",FromEnd:1},this.TDuplicates={0:"dupIgnore",dupIgnore:0,1:"dupAccept",dupAccept:1,2:"dupError",dupError:2},rtl.recNewT(this,"TPoint",(function(){this.x=0,this.y=0,this.$eq=function(t){return this.x===t.x&&this.y===t.y},this.$assign=function(t){return this.x=t.x,this.y=t.y,this};var e=t.$rtti.$Record("TPoint",{});e.addField("x",rtl.longint),e.addField("y",rtl.longint)})),rtl.recNewT(this,"TRect",(function(){this.Left=0,this.Top=0,this.Right=0,this.Bottom=0,this.$eq=function(t){return this.Left===t.Left&&this.Top===t.Top&&this.Right===t.Right&&this.Bottom===t.Bottom},this.$assign=function(t){return this.Left=t.Left,this.Top=t.Top,this.Right=t.Right,this.Bottom=t.Bottom,this};var e=t.$rtti.$Record("TRect",{});e.addField("Left",rtl.longint),e.addField("Top",rtl.longint),e.addField("Right",rtl.longint),e.addField("Bottom",rtl.longint)})),this.Rect=function(e,i,s,n){var r=t.TRect.$new();return r.Left=e,r.Top=i,r.Right=s,r.Bottom=n,r},this.Point=function(e,i){var s=t.TPoint.$new();return s.x=e,s.y=i,s}})),rtl.module("JS",["System","Types"],(function(){"use strict";var t=this;this.isBoolean=function(t){return"boolean"==typeof t},this.isNull=function(t){return null===t},this.isUndefined=function(t){return null==t},this.toBoolean=function(e){return!!t.isBoolean(e)&&!(0==e)},this.ToString=function(t){return rtl.isString(t)?""+t:""}})),rtl.module("SysUtils",["System","RTLConsts","JS"],(function(){"use strict";var t=this,e=t.$impl;this.FreeAndNil=function(t){var e=null;null!==(e=t.get())&&(t.set(null),e.$destroy("Destroy"))},rtl.recNewT(this,"TFormatSettings",(function(){this.CurrencyDecimals=0,this.CurrencyFormat=0,this.CurrencyString="",this.DateSeparator="",this.DecimalSeparator="",this.LongDateFormat="",this.LongTimeFormat="",this.NegCurrFormat=0,this.ShortDateFormat="",this.ShortTimeFormat="",this.ThousandSeparator="",this.TimeAMString="",this.TimePMString="",this.TimeSeparator="",this.TwoDigitYearCenturyWindow=0,this.InitLocaleHandler=null,this.$new=function(){var t=Object.create(this);return t.DateTimeToStrFormat=rtl.arraySetLength(null,"",2),t.LongDayNames=rtl.arraySetLength(null,"",7),t.LongMonthNames=rtl.arraySetLength(null,"",12),t.ShortDayNames=rtl.arraySetLength(null,"",7),t.ShortMonthNames=rtl.arraySetLength(null,"",12),t},this.$eq=function(t){return this.CurrencyDecimals===t.CurrencyDecimals&&this.CurrencyFormat===t.CurrencyFormat&&this.CurrencyString===t.CurrencyString&&this.DateSeparator===t.DateSeparator&&rtl.arrayEq(this.DateTimeToStrFormat,t.DateTimeToStrFormat)&&this.DecimalSeparator===t.DecimalSeparator&&this.LongDateFormat===t.LongDateFormat&&rtl.arrayEq(this.LongDayNames,t.LongDayNames)&&rtl.arrayEq(this.LongMonthNames,t.LongMonthNames)&&this.LongTimeFormat===t.LongTimeFormat&&this.NegCurrFormat===t.NegCurrFormat&&this.ShortDateFormat===t.ShortDateFormat&&rtl.arrayEq(this.ShortDayNames,t.ShortDayNames)&&rtl.arrayEq(this.ShortMonthNames,t.ShortMonthNames)&&this.ShortTimeFormat===t.ShortTimeFormat&&this.ThousandSeparator===t.ThousandSeparator&&this.TimeAMString===t.TimeAMString&&this.TimePMString===t.TimePMString&&this.TimeSeparator===t.TimeSeparator&&this.TwoDigitYearCenturyWindow===t.TwoDigitYearCenturyWindow},this.$assign=function(t){return this.CurrencyDecimals=t.CurrencyDecimals,this.CurrencyFormat=t.CurrencyFormat,this.CurrencyString=t.CurrencyString,this.DateSeparator=t.DateSeparator,this.DateTimeToStrFormat=t.DateTimeToStrFormat.slice(0),this.DecimalSeparator=t.DecimalSeparator,this.LongDateFormat=t.LongDateFormat,this.LongDayNames=t.LongDayNames.slice(0),this.LongMonthNames=t.LongMonthNames.slice(0),this.LongTimeFormat=t.LongTimeFormat,this.NegCurrFormat=t.NegCurrFormat,this.ShortDateFormat=t.ShortDateFormat,this.ShortDayNames=t.ShortDayNames.slice(0),this.ShortMonthNames=t.ShortMonthNames.slice(0),this.ShortTimeFormat=t.ShortTimeFormat,this.ThousandSeparator=t.ThousandSeparator,this.TimeAMString=t.TimeAMString,this.TimePMString=t.TimePMString,this.TimeSeparator=t.TimeSeparator,this.TwoDigitYearCenturyWindow=t.TwoDigitYearCenturyWindow,this},this.GetJSLocale=function(){return Intl.DateTimeFormat().resolvedOptions().locale},this.GetLocaleDecimalSeparator=function(t){var e=1.1;return e=e.toLocaleString(t).substring(1,2)},this.GetLocaleLongDayName=function(t,e){var i=new Date(2017,0,1);return i.setDate(i.getDate()+t-1),i.toLocaleDateString(e,{weekday:"long"})},this.GetLocaleLongMonthName=function(t,e){return new Date(2017,t-1,1).toLocaleDateString(e,{month:"long"})},this.GetLocaleLongTimeFormat=function(e){var i="";return i="hh:nn:ss","EN-US"===t.UpperCase(e)&&(i="hh:nn:ss AMPM"),i};this.GetLocaleShortDateFormat=function(e){var i;t.TStringHelper.Empty,e=t.TStringHelper.ToLower.call({get:function(){return e},set:function(t){e=t}}),(i=t.TStringHelper.IndexOf.call({get:function(){return e},set:function(t){e=t}},"-"))>=0?e=t.TStringHelper.Substring$1.call({get:function(){return e},set:function(t){e=t}},0,i)+t.TStringHelper.ToUpper.call({a:t.TStringHelper.Substring.call({get:function(){return e},set:function(t){e=t}},i),get:function(){return this.a},set:function(t){this.a=t}}):2===t.TStringHelper.GetLength.call({get:function(){return e},set:function(t){e=t}})&&(e=e+"-"+t.TStringHelper.ToUpper.call({get:function(){return e},set:function(t){e=t}}));return{"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"}[e]||"dd/MM/yyyy"},this.GetLocaleShortDayName=function(t,e){var i=new Date(2017,0,1);i.setDate(i.getDate()+t-1);var s="";return s=""==e?navigator.language:e,i.toLocaleDateString(s,{weekday:"short"})},this.GetLocaleShortMonthName=function(t,e){var i=new Date(2017,t-1,1),s="";return s=""==e?navigator.language:e,i.toLocaleDateString(s,{month:"short"})},this.GetLocaleShortTimeFormat=function(e){var i="";return i="hh:nn","EN-US"===t.UpperCase(e)&&(i="h:nn AMPM"),i},this.Create=function(){var e=t.TFormatSettings.$new();return e.$assign(t.TFormatSettings.Create$1(t.TFormatSettings.GetJSLocale())),e};var i=["/",".","-"],s=[":",".","-"],n=[",","."],r=[".",","];this.Create$1=function(e){var o=t.TFormatSettings.$new(),l="",a=0,h="";h=t.UpperCase(e),1===pas.System.Pos("DE-",h)?(o.LongDayNames[0]="Sonntag",o.LongDayNames[1]="Montag",o.LongDayNames[2]="Dienstag",o.LongDayNames[3]="Mittwoch",o.LongDayNames[4]="Donnerstag",o.LongDayNames[5]="Freitag",o.LongDayNames[6]="Samstag",o.ShortDayNames[0]="Son",o.ShortDayNames[1]="Mon",o.ShortDayNames[2]="Die",o.ShortDayNames[3]="Mit",o.ShortDayNames[4]="Don",o.ShortDayNames[5]="Fre",o.ShortDayNames[6]="Sam",o.ShortMonthNames[0]="Jan",o.ShortMonthNames[1]="Feb",o.ShortMonthNames[2]="M�r",o.ShortMonthNames[3]="Apr",o.ShortMonthNames[4]="Mai",o.ShortMonthNames[5]="Jun",o.ShortMonthNames[6]="Jul",o.ShortMonthNames[7]="Aug",o.ShortMonthNames[8]="Sep",o.ShortMonthNames[9]="Okt",o.ShortMonthNames[10]="Nov",o.ShortMonthNames[11]="Dez",o.LongMonthNames[0]="Januar",o.LongMonthNames[1]="Februar",o.LongMonthNames[2]="M�rz",o.LongMonthNames[3]="April",o.LongMonthNames[4]="Mai",o.LongMonthNames[5]="Juni",o.LongMonthNames[6]="Juli",o.LongMonthNames[7]="August",o.LongMonthNames[8]="September",o.LongMonthNames[9]="Oktober",o.LongMonthNames[10]="November",o.LongMonthNames[11]="Dezember"):1===pas.System.Pos("FR-",t.UpperCase(e))?(o.LongDayNames[0]="Dimanche",o.LongDayNames[1]="Lundi",o.LongDayNames[2]="Mardi",o.LongDayNames[3]="Mecredi",o.LongDayNames[4]="Jeudi",o.LongDayNames[5]="Vendredi",o.LongDayNames[6]="Samedi",o.ShortDayNames[0]="Dim",o.ShortDayNames[1]="Lun",o.ShortDayNames[2]="Mar",o.ShortDayNames[3]="Mer",o.ShortDayNames[4]="Jeu",o.ShortDayNames[5]="Ven",o.ShortDayNames[6]="Sam",o.ShortMonthNames[0]="Jan",o.ShortMonthNames[1]="F�v",o.ShortMonthNames[2]="Mar",o.ShortMonthNames[3]="Avr",o.ShortMonthNames[4]="Mai",o.ShortMonthNames[5]="Jun",o.ShortMonthNames[6]="Jul",o.ShortMonthNames[7]="Ao�",o.ShortMonthNames[8]="Sep",o.ShortMonthNames[9]="Oct",o.ShortMonthNames[10]="Nov",o.ShortMonthNames[11]="Dec",o.LongMonthNames[0]="Janvier",o.LongMonthNames[1]="F�vrier",o.LongMonthNames[2]="Mars",o.LongMonthNames[3]="Avril",o.LongMonthNames[4]="Mai",o.LongMonthNames[5]="Juin",o.LongMonthNames[6]="Juillet",o.LongMonthNames[7]="Ao�t",o.LongMonthNames[8]="Septembre",o.LongMonthNames[9]="Octobre",o.LongMonthNames[10]="Novembre",o.LongMonthNames[11]="D�cembre"):1===pas.System.Pos("ES-",t.UpperCase(e))?(o.LongDayNames[0]="Domingo",o.LongDayNames[1]="Lunes",o.LongDayNames[2]="Martes",o.LongDayNames[3]="Mi�rcoles",o.LongDayNames[4]="Jueves",o.LongDayNames[5]="Viernes",o.LongDayNames[6]="S�bado",o.ShortDayNames[0]="Dom",o.ShortDayNames[1]="Lun",o.ShortDayNames[2]="Mar",o.ShortDayNames[3]="Mi�",o.ShortDayNames[4]="Jue",o.ShortDayNames[5]="Vie",o.ShortDayNames[6]="Sab",o.ShortMonthNames[0]="Ene",o.ShortMonthNames[1]="Feb",o.ShortMonthNames[2]="Mar",o.ShortMonthNames[3]="Abr",o.ShortMonthNames[4]="May",o.ShortMonthNames[5]="Jun",o.ShortMonthNames[6]="Jul",o.ShortMonthNames[7]="Ago",o.ShortMonthNames[8]="Sep",o.ShortMonthNames[9]="Oct",o.ShortMonthNames[10]="Nov",o.ShortMonthNames[11]="Dic",o.LongMonthNames[0]="January",o.LongMonthNames[1]="Febrero",o.LongMonthNames[2]="Marzi",o.LongMonthNames[3]="Abril",o.LongMonthNames[4]="Mayo",o.LongMonthNames[5]="Junio",o.LongMonthNames[6]="Julio",o.LongMonthNames[7]="Agusto",o.LongMonthNames[8]="Septiembre",o.LongMonthNames[9]="Octubre",o.LongMonthNames[10]="Noviembre",o.LongMonthNames[11]="Diciembre"):(o.LongDayNames[0]="Sunday",o.LongDayNames[1]="Monday",o.LongDayNames[2]="Tuesday",o.LongDayNames[3]="Wednesday",o.LongDayNames[4]="Thursday",o.LongDayNames[5]="Friday",o.LongDayNames[6]="Saturday",o.ShortDayNames[0]="Sun",o.ShortDayNames[1]="Mon",o.ShortDayNames[2]="Tue",o.ShortDayNames[3]="Wed",o.ShortDayNames[4]="Thu",o.ShortDayNames[5]="Fri",o.ShortDayNames[6]="Sat",o.ShortMonthNames[0]="Jan",o.ShortMonthNames[1]="Feb",o.ShortMonthNames[2]="Mar",o.ShortMonthNames[3]="Apr",o.ShortMonthNames[4]="May",o.ShortMonthNames[5]="Jun",o.ShortMonthNames[6]="Jul",o.ShortMonthNames[7]="Aug",o.ShortMonthNames[8]="Sep",o.ShortMonthNames[9]="Oct",o.ShortMonthNames[10]="Nov",o.ShortMonthNames[11]="Dec",o.LongMonthNames[0]="January",o.LongMonthNames[1]="February",o.LongMonthNames[2]="March",o.LongMonthNames[3]="April",o.LongMonthNames[4]="May",o.LongMonthNames[5]="June",o.LongMonthNames[6]="July",o.LongMonthNames[7]="August",o.LongMonthNames[8]="September",o.LongMonthNames[9]="October",o.LongMonthNames[10]="November",o.LongMonthNames[11]="December"),o.DateTimeToStrFormat[0]="c",o.DateTimeToStrFormat[1]="f",o.DateSeparator="-",o.TimeSeparator=":",o.ShortDateFormat="yyyy-mm-dd",o.LongDateFormat="ddd, yyyy-mm-dd",o.DecimalSeparator=".",o.ThousandSeparator=",",o.TimeAMString="AM",o.TimePMString="PM",o.TwoDigitYearCenturyWindow=50,o.ShortTimeFormat=t.TFormatSettings.GetLocaleShortTimeFormat(e),o.LongTimeFormat=t.TFormatSettings.GetLocaleLongTimeFormat(e),o.ShortDateFormat=t.TFormatSettings.GetLocaleShortDateFormat(e);for(var u=0,d=rtl.length(i)-1;u<=d;u++)a=u,t.TStringHelper.IndexOf.call({p:o,get:function(){return this.p.ShortDateFormat},set:function(t){this.p.ShortDateFormat=t}},i[a])>=0&&(o.DateSeparator=i[a]);var c=new Date("Jan 1, 1980 06:07:08 GMT+00:00");h="";h=""==e?navigator.language:e,l=c.toLocaleTimeString(h);for(var F=0,p=rtl.length(s)-1;F<=p;F++)a=F,t.TStringHelper.IndexOf.call({get:function(){return l},set:function(t){l=t}},s[a])>=0&&(o.TimeSeparator=s[a]);for(a=1;a<=7;a++)o.ShortDayNames[a-1]=t.TFormatSettings.GetLocaleShortDayName(a,e);for(a=1;a<=7;a++)o.LongDayNames[a-1]=t.TFormatSettings.GetLocaleLongDayName(a,e);for(a=1;a<=12;a++)o.ShortMonthNames[a-1]=t.TFormatSettings.GetLocaleShortMonthName(a,e);for(a=1;a<=12;a++)o.LongMonthNames[a-1]=t.TFormatSettings.GetLocaleLongMonthName(a,e);o.DecimalSeparator=t.TFormatSettings.GetLocaleDecimalSeparator(e);for(var C=0,m=rtl.length(n)-1;C<=m;C++)if(a=C,o.DecimalSeparator===n[a]){o.ThousandSeparator=r[a];break}return null!=t.TFormatSettings.InitLocaleHandler&&t.TFormatSettings.InitLocaleHandler(t.UpperCase(e),t.TFormatSettings.$clone(o)),o},this.Invariant=function(){var i=t.TFormatSettings.$new();return e.FInvariantCreated||(e.FInvariant.$assign(t.TFormatSettings.Create$1("EN-US")),e.FInvariant.CurrencyString="¤",e.FInvariant.CurrencyFormat=0,e.FInvariant.CurrencyDecimals=2,e.FInvariant.DateSeparator="/",e.FInvariant.TimeSeparator=":",e.FInvariant.ShortDateFormat="MM/dd/yyyy",e.FInvariant.LongDateFormat="dddd, dd MMMMM yyyy HH:mm:ss",e.FInvariant.TimeAMString="AM",e.FInvariant.TimePMString="PM",e.FInvariant.ShortTimeFormat="HH:mm",e.FInvariant.LongTimeFormat="HH:mm:ss",e.FInvariant.ShortMonthNames=e.DefaultShortMonthNames.slice(0),e.FInvariant.LongMonthNames=e.DefaultLongMonthNames.slice(0),e.FInvariant.ShortDayNames=e.DefaultShortDayNames.slice(0),e.FInvariant.LongDayNames=e.DefaultLongDayNames.slice(0),e.FInvariant.ThousandSeparator=",",e.FInvariant.DecimalSeparator=".",e.FInvariant.TwoDigitYearCenturyWindow=50,e.FInvariant.NegCurrFormat=0,e.FInvariantCreated=!0),i.$assign(e.FInvariant),i}}),!0),rtl.createClass(this,"Exception",pas.System.TObject,(function(){this.LogMessageOnCreate=!1,this.$init=function(){pas.System.TObject.$init.call(this),this.FMessage="",this.FJSError=null,this.FStack=void 0},this.$final=function(){this.FJSError=void 0,pas.System.TObject.$final.call(this)},this.Create$1=function(t){return this.FMessage=t,this.FJSError=new Error(t),this.FStack=this.FJSError.stack,this.LogMessageOnCreate&&pas.System.Writeln("Created exception ",this.$classname," with message: ",t),this},this.CreateFmt=function(e,i){return this.Create$1(t.Format(e,i)),this}})),rtl.createClass(this,"EConvertError",this.Exception,(function(){})),rtl.createClass(this,"EVariantError",this.Exception,(function(){})),this.CharInSet=function(t,e){var i=!1,s=0;for(i=!1,s=rtl.length(e)-1;!i&&s>=0;)i=t===e[s],s-=1;return i},this.Trim=function(t){return t.replace(/^[\s\uFEFF\xA0\x00-\x1f]+/,"").replace(/[\s\uFEFF\xA0\x00-\x1f]+$/,"")},this.TrimLeft=function(t){return t.replace(/^[\s\uFEFF\xA0\x00-\x1f]+/,"")},this.UpperCase=function(t){return t.toUpperCase()},this.LowerCase=function(t){return t.toLowerCase()},this.CompareStr=function(t,e){var i,s=t.length,n=e.length;return s<=n?t<(i=e.substr(0,s))?-1:t>i?1:s<n?-1:0:(i=t.substr(0,n))<e?-1:1},this.CompareText=function(t,e){var i=t.toLowerCase(),s=e.toLowerCase();return i>s?1:i<s?-1:0},this.AnsiSameText=function(t,e){return t.toLowerCase()==e.toLowerCase()},this.Format=function(e,i){return t.Format$1(e,i,t.FormatSettings)},this.Format$1=function(i,s,n){var r="",o=0,l=0,a=0,h=0,u=0,d="",c="",F=0,p=0,C=0,m=!1,S=0;function y(){var t=0;function n(){var n=0,r=0;if(-1===t){for(l=o;o<=u&&i.charAt(o-1)<="9"&&i.charAt(o-1)>="0";)o+=1;if(o>u&&e.DoFormatError(1,i),"*"===i.charAt(o-1)){255===F?r=a:(r=F,F+=1),(o>l||r>rtl.length(s)-1)&&e.DoFormatError(1,i),a=r+1;var h=s[r].VType;0===h||19===h?t=s[r].VJSValue:e.DoFormatError(1,i),o+=1}else l<o?(pas.System.val(pas.System.Copy(i,l,o-l),{get:function(){return t},set:function(e){t=e}},{get:function(){return n},set:function(t){n=t}}),n>0&&e.DoFormatError(1,i)):t=-1}}return F=255,p=-1,C=-1,t=-1,o+=1,"%"===i.charAt(o-1)?"%":(":"!==i.charAt(o-1)?n():t=0,":"===i.charAt(o-1)&&(-1===t&&e.DoFormatError(2,i),F=t,t=-1,o+=1),"-"===i.charAt(o-1)?(m=!0,o+=1):m=!1,n(),-1!==t&&(p=t,t=-1),"."===i.charAt(o-1)&&(o+=1,n(),-1===t&&(t=0),C=t),pas.System.upcase(i.charAt(o-1)))}function f(t,n){var r=!1;return r=!1,a=(h=255===F?a:F)+1,h>rtl.length(s)-1||s[h].VType!==t?(n&&e.DoFormatError(3,i),a-=1,r):r=!0}for(r="",u=i.length,o=1,l=1,a=0;o<=u;){for(;o<=u&&"%"!==i.charAt(o-1);)o+=1;if(o>l&&(r+=pas.System.Copy(i,l,o-l)),o<u){var g=y();if("D"===g)(f(0,!1)||f(19,!0))&&(c=t.IntToStr(s[h].VJSValue)),p=Math.abs(p),F=C-c.length,"-"!==c.charAt(0)?c=pas.System.StringOfChar("0",F)+c:pas.System.Insert(pas.System.StringOfChar("0",F+1),{get:function(){return c},set:function(t){c=t}},2);else if("U"===g)f(0,!1)?c=t.IntToStr(s[h].VJSValue>>>0):f(19,!0)&&(c=t.IntToStr(s[h].VJSValue)),p=Math.abs(p),F=C-c.length,c=pas.System.StringOfChar("0",F)+c;else if("E"===g)f(12,!1)?c=t.FloatToStrF$1(s[h].VJSValue/1e4,2,3,C,n):f(3,!0)&&(c=t.FloatToStrF$1(s[h].VJSValue,2,3,C,n));else if("F"===g)f(12,!1)?c=t.FloatToStrF$1(s[h].VJSValue/1e4,0,9999,C,n):(f(0,!1)||f(3,!0))&&(c=t.FloatToStrF$1(s[h].VJSValue,0,9999,C,n));else if("G"===g)f(12,!1)?c=t.FloatToStrF$1(s[h].VJSValue/1e4,1,C,3,n):f(3,!0)&&(c=t.FloatToStrF$1(s[h].VJSValue,1,C,3,n));else if("N"===g)f(12,!1)?c=t.FloatToStrF$1(s[h].VJSValue/1e4,3,9999,C,n):f(3,!0)&&(c=t.FloatToStrF$1(s[h].VJSValue,3,9999,C,n));else if("M"===g)f(12,!1)?c=t.FloatToStrF$1(s[h].VJSValue/1e4,4,9999,C,n):f(3,!0)&&(c=t.FloatToStrF$1(s[h].VJSValue,4,9999,C,n));else if("S"===g)(f(18,!1)||f(9,!0))&&(d=s[h].VJSValue),F=d.length,-1!==C&&F>C&&(F=C),c=pas.System.Copy(d,1,F);else if("P"===g)f(0,!1)?c=t.IntToHex(s[h].VJSValue,8):f(0,!0)&&(c=t.IntToHex(s[h].VJSValue,16));else if("X"===g)if(f(0,!1)?(S=s[h].VJSValue,F=16):f(19,!0)&&(S=s[h].VJSValue,F=31),C>F)c=t.IntToHex(S,F);else{for(F=1;rtl.shl(1,4*F)<=S&&F<16;)F+=1;F>C&&(C=F),c=t.IntToHex(S,C)}else"%"===g&&(c="%");-1!==p&&c.length<p&&(m?c+=pas.System.StringOfChar(" ",p-c.length):c=pas.System.StringOfChar(" ",p-c.length)+c),r+=c}l=o+=1}return r};var i=rtl.createSet(null,65,90,null,97,122,95),s=rtl.unionSet(i,rtl.createSet(null,48,57));this.IsValidIdent=function(t,e,n){var r,o=!1,l=!1,a=0;if((r=t.length)<1)return!1;for(l=!0,o=!1,a=1;a<=r;){if(l){if(!(t.charCodeAt(a-1)in i))return o;l=!1}else if(e&&"."===t.charAt(a-1)){if(n){if(a>=r)return o;l=!0}}else if(!(t.charCodeAt(a-1)in s))return o;a+=1}return o=!0},this.TStringReplaceFlag={0:"rfReplaceAll",rfReplaceAll:0,1:"rfIgnoreCase",rfIgnoreCase:1},this.StringReplace=function(t,i,s,n){var r,o="";return o="",0 in n&&(o="g"),1 in n&&(o+="i"),r=i.replace(new RegExp(e.RESpecials,"g"),"\\$1"),t.replace(new RegExp(r,o),s)},this.IntToStr=function(t){return""+t},this.TryStrToInt$1=function(e,i,s){var n=!1,r=0;return(n=(n=t.TryStrToInt$3(e,{get:function(){return r},set:function(t){r=t}},s))&&-2147483648<=r&&r<=2147483647)&&i.set(r),n},this.TryStrToInt$2=function(i,s){return e.IntTryStrToInt(i,s,t.FormatSettings.DecimalSeparator)},this.TryStrToInt$3=function(t,i,s){return e.IntTryStrToInt(t,i,s.DecimalSeparator)},this.StrToIntDef=function(e,i){var s=0;return t.TryStrToInt$2(e,{get:function(){return s},set:function(t){s=t}})?s:i},this.StrToInt=function(e){var i=0;if(!t.TryStrToInt$2(e,{get:function(){return i},set:function(t){i=t}}))throw t.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidInteger"),pas.System.VarRecs(18,e)]);return i},this.IntToHex=function(e,i){var s="";for(s="",e<0&&e<0&&(e=4294967295+e+1),s=e.toString(16),s=t.UpperCase(s);s.length<i;)s="0"+s;return s},this.TFloatFormat={0:"ffFixed",ffFixed:0,1:"ffGeneral",ffGeneral:1,2:"ffExponent",ffExponent:2,3:"ffNumber",ffNumber:3,4:"ffCurrency",ffCurrency:4},this.FloatToStr=function(e){return t.FloatToStr$1(e,t.FormatSettings)},this.FloatToStr$1=function(e,i){return t.FloatToStrF$1(e,1,15,0,i)},this.FloatToStrF$1=function(t,i,s,n,r){var o,l,a="";l=r.DecimalSeparator,o=r.ThousandSeparator;var h=i;return 1===h?a=e.FormatGeneralFloat(t,s,l):2===h?a=e.FormatExponentFloat(t,s,n,l):0===h?a=e.FormatFixedFloat(t,n,l):3===h?a=e.FormatNumberFloat(t,n,l,o):4===h&&(a=e.FormatNumberCurrency(1e4*t,n,r)),4!==i&&a.length>1&&"-"===a.charAt(0)&&e.RemoveLeadingNegativeSign({get:function(){return a},set:function(t){a=t}},l,o),a};this.TryStrToFloat$3=function(e,i,s){var n,r,o=!1,l=0,a=0,h="",u=0;for(o=!1,h=e,""!==s.ThousandSeparator&&(h=t.StringReplace(h,s.ThousandSeparator,"",rtl.createSet(0))),"."!==s.DecimalSeparator&&(h=t.StringReplace(h,s.DecimalSeparator,".",{})),u=0,l=1,a=1,r=h.length;l<=r;){var d=h.charAt(l-1);if("+"===d||"-"===d){if(1===u)return o;if(0===u){if(l>a)return o}else if(2===u&&l>a+1)return o}else if(d>="0"&&d<="9");else if("."===d){if(0!==u)return o;u=1,a=l}else{if("E"!==d&&"e"!==d)return o;if(2===u)return o;u=2,a=l}l+=1}return n=parseFloat(h),(o=!isNaN(n))&&i.set(rtl.getNumber(n)),o},this.StrToFloat$1=function(e,i){var s=0;if(!t.TryStrToFloat$3(e,{get:function(){return s},set:function(t){s=t}},i))throw t.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrInvalidFloat"),pas.System.VarRecs(18,e)]);return s},this.OnShowException=null,this.ShowException=function(i,s){var n="";n=rtl.getResStr(t,"SApplicationException")+i.$classname,t.Exception.isPrototypeOf(i)&&(n=n+" : "+i.FMessage),e.DoShowException(n)},this.TimeSeparator="",this.DateSeparator="",this.ShortDateFormat="",this.LongDateFormat="",this.ShortTimeFormat="",this.LongTimeFormat="",this.DecimalSeparator="",this.ThousandSeparator="",this.TimeAMString="",this.TimePMString="",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.CurrencyFormat=0,this.NegCurrFormat=0,this.CurrencyDecimals=0,this.CurrencyString="",rtl.createHelper(this,"TStringHelper",null,(function(){this.Empty="",this.GetLength=function(){return this.get().length},this.LowerCase=function(e){return t.LowerCase(e)},this.UpperCase=function(e){return t.UpperCase(e)},this.IndexOf=function(e){return t.TStringHelper.IndexOf$4.call(this,e,0,t.TStringHelper.GetLength.call(this))},this.IndexOf$4=function(t,e,i){var s,n=0;return s=pas.System.Copy(this.get(),e+1,i),-1!==(n=pas.System.Pos(t,s)-1)&&(n+=e),n},this.Substring=function(e){return t.TStringHelper.Substring$1.call(this,e,t.TStringHelper.GetLength.call(this)-e)},this.Substring$1=function(t,e){return pas.System.Copy(this.get(),t+1,e)},this.ToLower=function(){return t.TStringHelper.LowerCase(this.get())},this.ToUpper=function(){return t.TStringHelper.UpperCase(this.get())}})),rtl.createHelper(this,"TDoubleHelper",null,(function(){this.ToString$3=function(){return t.FloatToStr(this.get())}})),rtl.createHelper(this,"TIntegerHelper",null,(function(){this.ToString$1=function(){return t.IntToStr(this.get())}})),t.$implcode=function(){e.DefaultShortMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e.DefaultLongMonthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],e.DefaultShortDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],e.DefaultLongDayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],e.FInvariant=t.TFormatSettings.$new(),e.FInvariantCreated=!1,e.DoShowException=function(e){null!=t.OnShowException?t.OnShowException(e):window.alert(e)},e.feInvalidFormat=1,e.feMissingArgument=2,e.feInvalidArgIndex=3,e.DoFormatError=function(e,i){var s=e;if(1===s)throw t.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidFormat"),pas.System.VarRecs(18,i)]);if(2===s)throw t.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SArgumentMissing"),pas.System.VarRecs(18,i)]);if(3===s)throw t.EConvertError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidArgIndex"),pas.System.VarRecs(18,i)])},e.maxdigits=15,e.ReplaceDecimalSep=function(t,e){var i;return(i=pas.System.Pos(".",t))>0?pas.System.Copy(t,1,i-1)+e+pas.System.Copy(t,i+1,t.length-i):t},e.FormatGeneralFloat=function(i,s,n){var r="",o=0,l=0,a=0,h=0;if((-1===s||s>15)&&(s=15),r=rtl.floatToStr(i,s+7),r=t.TrimLeft(r),0===(o=pas.System.Pos(".",r)))return r;if(0===(l=pas.System.Pos("E",r)))return r=e.ReplaceDecimalSep(r,n);for(a=l+2,h=0;a<=r.length;)h=10*h+r.charCodeAt(a-1)-48,a+=1;if("-"===r.charAt(l+1-1)&&(h=-h),o+h<l&&h>-6){if(r=rtl.strSetLength(r,l-1),h>=0){for(var u=0,d=h-1;u<=d;u++)a=u,r=rtl.setCharAt(r,o-1,r.charAt(o+1-1)),o+=1;for(r=rtl.setCharAt(r,o-1,"."),o=1,"-"===r.charAt(o-1)&&(o+=1);"0"===r.charAt(o-1)&&o<r.length&&pas.System.Copy(r,o+1,n.length)!==n;)pas.System.Delete({get:function(){return r},set:function(t){r=t}},o,1)}else pas.System.Insert(pas.System.Copy("00000",1,-h),{get:function(){return r},set:function(t){r=t}},o-1),r=rtl.setCharAt(r,o-h-1,r.charAt(o-h-1-1)),r=rtl.setCharAt(r,o-1,"."),-1!==h&&(r=rtl.setCharAt(r,o-h-1-1,"0"));for(a=r.length;a>0&&"0"===r.charAt(a-1);)a-=1;"."===r.charAt(a-1)&&(a-=1),r=0===a||1===a&&"-"===r.charAt(0)?"0":rtl.strSetLength(r,a)}else{for(;"0"===r.charAt(l-1-1);)pas.System.Delete({get:function(){return r},set:function(t){r=t}},l-1,1),l-=1;for(r.charAt(l-1-1)===n&&(pas.System.Delete({get:function(){return r},set:function(t){r=t}},l-1,1),l-=1),"+"===r.charAt(l+1-1)?pas.System.Delete({get:function(){return r},set:function(t){r=t}},l+1,1):l+=1;"0"===r.charAt(l+1-1);)pas.System.Delete({get:function(){return r},set:function(t){r=t}},l+1,1)}return r=e.ReplaceDecimalSep(r,n)},e.FormatExponentFloat=function(i,s,n,r){var o="",l=0;for(r=t.FormatSettings.DecimalSeparator,(-1===s||s>15)&&(s=15),o=rtl.floatToStr(i,s+7);" "===o.charAt(0);)pas.System.Delete({get:function(){return o},set:function(t){o=t}},1,1);if(0===(l=pas.System.Pos("E",o)))return o=e.ReplaceDecimalSep(o,r);if(l+=2,n>4&&(n=4),(n=o.length-l-n+1)<0)pas.System.Insert(pas.System.Copy("0000",1,-n),{get:function(){return o},set:function(t){o=t}},l);else for(;n>0&&"0"===o.charAt(l-1);){if(pas.System.Delete({get:function(){return o},set:function(t){o=t}},l,1),l>o.length){pas.System.Delete({get:function(){return o},set:function(t){o=t}},l-2,2);break}n-=1}return o=e.ReplaceDecimalSep(o,r)},e.FormatFixedFloat=function(t,i,s){var n="";return-1===i?i=2:i>18&&(i=18),""!==(n=rtl.floatToStr(t,0,i))&&" "===n.charAt(0)&&pas.System.Delete({get:function(){return n},set:function(t){n=t}},1,1),n=e.ReplaceDecimalSep(n,s)},e.FormatNumberFloat=function(t,i,s,n){var r="",o=0;if(-1===i?i=2:i>15&&(i=15),""!==(r=rtl.floatToStr(t,0,i))&&" "===r.charAt(0)&&pas.System.Delete({get:function(){return r},set:function(t){r=t}},1,1),(o=pas.System.Pos(".",r))<=0&&(o=r.length+1),r=e.ReplaceDecimalSep(r,s),o-=3,""!==n&&"\0"!==n)for(;o>1;)"-"!==r.charAt(o-1-1)&&pas.System.Insert(n,{get:function(){return r},set:function(t){r=t}},o),o-=3;return r},e.RemoveLeadingNegativeSign=function(t,e,i){var s,n=!1,r=0;n=!1,s=i;for(var o=2,l=t.get().length;o<=l&&(r=o,n=t.get().charCodeAt(r-1)in rtl.createSet(48,e.charCodeAt(),69,43)||t.get().charAt(r-1)===s);o++);return n&&"-"===t.get().charAt(0)&&pas.System.Delete(t,1,1),n},e.FormatNumberCurrency=function(t,i,s){var n,r,o,l,a="",h=0;if(o=s.DecimalSeparator,l=s.ThousandSeparator,r=s.CurrencyString,-1===i?i=s.CurrencyDecimals:i>18&&(i=18),(n="-"===(a=rtl.floatToStr(t/1e4,0,i)).charAt(0))&&pas.System.Delete({get:function(){return a},set:function(t){a=t}},1,1),h=pas.System.Pos(".",a),""!==l)for(0!==h?a=e.ReplaceDecimalSep(a,o):h=a.length+1,h-=3;h>1;)pas.System.Insert(l,{get:function(){return a},set:function(t){a=t}},h),h-=3;if(n&&e.RemoveLeadingNegativeSign({get:function(){return a},set:function(t){a=t}},o,l),n){var u=s.NegCurrFormat;0===u?a="("+r+a+")":1===u?a="-"+r+a:2===u?a=r+"-"+a:3===u?a=r+a+"-":4===u?a="("+a+r+")":5===u?a="-"+a+r:6===u?a=a+"-"+r:7===u?a=a+r+"-":8===u?a="-"+a+" "+r:9===u?a="-"+r+" "+a:10===u?a=a+" "+r+"-":11===u?a=r+" "+a+"-":12===u?a=r+" -"+a:13===u?a=a+"- "+r:14===u?a="("+r+" "+a+")":15===u&&(a="("+a+" "+r+")")}else{var d=s.CurrencyFormat;0===d?a=r+a:1===d?a+=r:2===d?a=r+" "+a:3===d&&(a=a+" "+r)}return a},e.RESpecials="([\\$\\+\\[\\]\\(\\)\\\\\\.\\*\\^\\?\\|])",e.IntTryStrToInt=function(e,i,s){var n,r,o=10,l="";if(l=e,0!==pas.System.Pos(s,l)||0!==pas.System.Pos(".",l))return!1;var a=pas.System.Copy(l,1,1);return"$"===a?o=16:"&"===a?o=8:"%"===a&&(o=2),(16===o||0===pas.System.Pos("e",t.LowerCase(l)))&&(10!==o&&pas.System.Delete({get:function(){return l},set:function(t){l=t}},1,1),r=parseInt(l,o),(n=!isNaN(r))&&i.set(rtl.trunc(r)),n)},e.InitGlobalFormatSettings=function(){t.FormatSettings.$assign(t.TFormatSettings.Create()),t.TimeSeparator=t.FormatSettings.TimeSeparator,t.DateSeparator=t.FormatSettings.DateSeparator,t.ShortDateFormat=t.FormatSettings.ShortDateFormat,t.LongDateFormat=t.FormatSettings.LongDateFormat,t.ShortTimeFormat=t.FormatSettings.ShortTimeFormat,t.LongTimeFormat=t.FormatSettings.LongTimeFormat,t.DecimalSeparator=t.FormatSettings.DecimalSeparator,t.ThousandSeparator=t.FormatSettings.ThousandSeparator,t.TimeAMString=t.FormatSettings.TimeAMString,t.TimePMString=t.FormatSettings.TimePMString,t.CurrencyFormat=t.FormatSettings.CurrencyFormat,t.NegCurrFormat=t.FormatSettings.NegCurrFormat,t.CurrencyDecimals=t.FormatSettings.CurrencyDecimals,t.CurrencyString=t.FormatSettings.CurrencyString},t.$resourcestrings={SApplicationException:{org:"Application raised an exception: "}}},t.$init=function(){e.InitGlobalFormatSettings(),t.ShortMonthNames=e.DefaultShortMonthNames.slice(0),t.LongMonthNames=e.DefaultLongMonthNames.slice(0),t.ShortDayNames=e.DefaultShortDayNames.slice(0),t.LongDayNames=e.DefaultLongDayNames.slice(0)}}),[]),rtl.module("TypInfo",["System","SysUtils","Types","RTLConsts","JS"],(function(){"use strict";var t=this,e=t.$impl;this.pfGetFunction=1,this.pfSetProcedure=2,this.pfHasIndex=16,rtl.createClass(this,"EPropertyError",pas.SysUtils.Exception,(function(){})),this.GetPropInfo=function(t,e){var i=null,s=null,n=0,r=null;for(r=t;null!==r;){if(s=r.members[e],rtl.isExt(s,rtl.tTypeMemberProperty))return s;if(!rtl.isExt(r,rtl.tTypeInfoClass))break;r=r.ancestor}i=null;do{for(var o=0,l=t.properties.length-1;o<=l;o++)if(n=o,0===pas.SysUtils.CompareText(e,t.properties[n]))return s=t.members[t.properties[n]],rtl.isExt(s,rtl.tTypeMemberProperty)&&(i=s),i;if(!rtl.isExt(t,rtl.tTypeInfoClass))break;t=t.ancestor}while(null!==t);return i},this.FindPropInfo=function(e,i){var s;if(null===(s=t.GetPropInfo(e.$rtti,i)))throw t.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SErrPropertyNotFound"),pas.System.VarRecs(18,i)]);return s},this.GetJSValueProp$1=function(i,s){var n=void 0,r=e.GetPropGetterKind(s);if(0===r)throw t.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SCantReadPropertyS"),pas.System.VarRecs(18,s.name)]);if(1===r)n=i[s.getter];else if(2===r)n=(16&s.flags)>0?i[s.getter](s.index):i[s.getter]();else if(3===r)throw t.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SIndexedPropertyNeedsParams"),pas.System.VarRecs(18,s.name)]);return n},this.GetJSValueProp$3=function(e,i){return t.GetJSValueProp$1(e,i)},this.SetJSValueProp$1=function(i,s,n){var r=e.GetPropSetterKind(s);if(0===r)throw t.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SCantWritePropertyS"),pas.System.VarRecs(18,s.name)]);if(1===r)i[s.setter]=n;else if(2===r)(16&s.flags)>0?i[s.setter](s.index,n):i[s.setter](n);else if(3===r)throw t.EPropertyError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SIndexedPropertyNeedsParams"),pas.System.VarRecs(18,s.name)])},this.SetJSValueProp$3=function(e,i,s){t.SetJSValueProp$1(e,i,s)},this.GetOrdProp$1=function(e,i){var s=0,n="",r=0,o=void 0;if(5===i.typeinfo.kind)for(n in s=0,t.GetJSValueProp$3(e,i))(r=parseInt(n,10))<32&&(s+=1<<r);else 2===i.typeinfo.kind?(o=t.GetJSValueProp$3(e,i),s=rtl.isNumber(o)?rtl.trunc(o):""===(n=""+o)?0:n.charCodeAt(0)):s=rtl.trunc(t.GetJSValueProp$3(e,i));return s},this.SetMethodProp=function(e,i,s){var n,r=null;r=null===(n=s.Code)?null:rtl.isFunction(n)?n.scope===s.Data&&(rtl.isFunction(n.fn)||rtl.isString(n.fn))?n:rtl.isString(n.fn)?rtl.createCallback(s.Data,""+n.fn):rtl.createCallback(s.Data,n):rtl.createCallback(s.Data,n),t.SetJSValueProp$3(e,i,r)},this.SetMethodProp$1=function(e,i,s){t.SetMethodProp(e,t.FindPropInfo(e,i),s)},t.$implcode=function(){e.TGetterKind={0:"gkNone",gkNone:0,1:"gkField",gkField:1,2:"gkFunction",gkFunction:2,3:"gkFunctionWithParams",gkFunctionWithParams:3},e.GetPropGetterKind=function(t){return""===t.getter?0:(1&t.flags)>0?rtl.length(t.params)>0?3:2:1},e.TSetterKind={0:"skNone",skNone:0,1:"skField",skField:1,2:"skProcedure",skProcedure:2,3:"skProcedureWithParams",skProcedureWithParams:3},e.GetPropSetterKind=function(t){return""===t.setter?0:(2&t.flags)>0?rtl.length(t.params)>0?3:2:1}}}),[]),rtl.module("Web",["System","Types","JS"],(function(){"use strict";rtl.createClassExt(this,"TJSFocusEvent",Event,"",(function(){this.$init=function(){},this.$final=function(){}})),this.$rtti.$ExtClass("TJSHTMLElement",{ancestor:this.$rtti.TJSElement,jsclass:"HTMLElement"}),this.$rtti.$ExtClass("TJSXMLHttpRequest",{ancestor:this.$rtti.TJSXMLHttpRequestEventTarget,jsclass:"XMLHttpRequest"}),rtl.createClass(this,"TJSKeyNames",pas.System.TObject,(function(){this.Alt="Alt",this.CapsLock="CapsLock",this.Control="Control",this.Shift="Shift",this.Enter="Enter",this.Tab="Tab",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.Delete="Delete",this.Insert="Insert",this.Escape="Escape",this.Pause="Pause",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"}))})),rtl.module("Classes",["System","RTLConsts","Types","SysUtils","JS","TypInfo"],(function(){"use strict";var t=this,e=t.$impl;this.$rtti.$MethodVar("TNotifyEvent",{procsig:rtl.newTIProcSig([["Sender",pas.System.$rtti.TObject]]),methodkind:0}),rtl.createClass(this,"EListError",pas.SysUtils.Exception,(function(){})),rtl.createClass(this,"EStringListError",this.EListError,(function(){})),rtl.createClass(this,"EComponentError",pas.SysUtils.Exception,(function(){})),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}),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=void 0,pas.System.TObject.$final.call(this)},this.Get=function(t){return(t<0||t>=this.FCount)&&this.RaiseIndexError(t),this.FList[t]},this.Put=function(t,e){(t<0||t>=this.FCount)&&this.RaiseIndexError(t),this.FList[t]=e},this.SetCapacity=function(t){t<this.FCount&&this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListCapacityError"),""+t),t!==this.FCapacity&&(this.FList=rtl.arraySetLength(this.FList,void 0,t),this.FCapacity=t)},this.SetCount=function(t){t<0&&this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListCountError"),""+t),t>this.FCount&&t>this.FCapacity&&this.SetCapacity(t),this.FCount=t},this.RaiseIndexError=function(t){this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),""+t)},this.Destroy=function(){this.Clear(),pas.System.TObject.Destroy.call(this)},this.Add=function(t){var e;return this.FCount===this.FCapacity&&this.Expand(),this.FList[this.FCount]=t,e=this.FCount,this.FCount+=1,e},this.Clear=function(){rtl.length(this.FList)>0&&(this.SetCount(0),this.SetCapacity(0))},this.Delete=function(t){(t<0||t>=this.FCount)&&this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),""+t),this.FCount=this.FCount-1,this.FList.splice(t,1),this.FCapacity-=1},this.Error=function(e,i){throw t.EListError.$create("CreateFmt",[e,pas.System.VarRecs(18,i)])},this.Expand=function(){var t=0;return this.FCount<this.FCapacity||(t=4,this.FCapacity>3&&(t+=4),this.FCapacity>8&&(t+=8),this.FCapacity>127&&(t+=this.FCapacity>>>2),this.SetCapacity(this.FCapacity+t),this),this},this.IndexOf=function(t){var e,i=0;for(i=0,e=this.FCount;i<e&&this.FList[i]!=t;)i+=1;return i>=e&&(i=-1),i},this.IndexOfItem=function(t,e){var i=0;if(0===e)i=this.IndexOf(t);else for(i=this.FCount-1;i>=0&&this.FList[i]!=t;)i-=1;return i},this.Insert=function(t,e){(t<0||t>this.FCount)&&this.$class.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),""+t),this.FList.splice(t,0,e),this.FCapacity+=1,this.FCount+=1},this.Last=function(){return 0===this.FCount?null:this.Get(this.FCount-1)},this.Remove=function(t){var e;return-1!==(e=this.IndexOf(t))&&this.Delete(e),e}})),this.TListNotification={0:"lnAdded",lnAdded:0,1:"lnExtracted",lnExtracted:1,2:"lnDeleted",lnDeleted:2},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=void 0,pas.System.TObject.$final.call(this)},this.Get=function(t){return this.FList.Get(t)},this.Put=function(t,e){var i;i=this.Get(t),this.FList.Put(t,e),pas.System.Assigned(i)&&this.Notify(i,2),pas.System.Assigned(e)&&this.Notify(e,0)},this.Notify=function(t,e){pas.System.Assigned(t)},this.GetCount=function(){return this.FList.FCount},this.Create$1=function(){return pas.System.TObject.Create.call(this),this.FList=t.TFPList.$create("Create"),this},this.Destroy=function(){null!=this.FList&&this.Clear(),pas.SysUtils.FreeAndNil({p:this,get:function(){return this.p.FList},set:function(t){this.p.FList=t}})},this.Add=function(t){var e;return e=this.FList.Add(t),pas.System.Assigned(t)&&this.Notify(t,0),e},this.Clear=function(){for(;this.FList.FCount>0;)this.Delete(this.GetCount()-1)},this.Delete=function(t){var e;e=this.FList.Get(t),this.FList.Delete(t),pas.System.Assigned(e)&&this.Notify(e,2)},this.IndexOf=function(t){return this.FList.IndexOf(t)},this.Insert=function(t,e){this.FList.Insert(t,e),pas.System.Assigned(e)&&this.Notify(e,0)},this.Remove=function(t){var e;return-1!==(e=this.IndexOf(t))&&this.Delete(e),e}})),rtl.createClass(this,"TPersistent",pas.System.TObject,(function(){this.AssignError=function(t){var e="";throw e=null!==t?t.$classname:"Nil",pas.SysUtils.EConvertError.$create("Create$1",["Cannot assign a "+e+" to a "+this.$classname+"."])},this.AssignTo=function(t){t.AssignError(this)},this.GetOwner=function(){return null,null},this.Assign=function(t){null!==t?t.AssignTo(this):this.AssignError(null)},this.SetEvent=function(t,e,i){this.SetEvent$1(this,t,e,i)},this.SetEvent$1=function(t,e,i,s){var n=pas.System.TMethod.$new();if(n.Code=e.$class.MethodAddress(s),null===n.Code)throw pas.SysUtils.Exception.$create("Create$1",[e.$classname+' has no published method "'+s+'"']);n.Data=e,pas.TypInfo.SetMethodProp$1(t,i,n)}})),rtl.createClass(this,"TStrings",this.TPersistent,(function(){this.$init=function(){t.TPersistent.$init.call(this),this.FSpecialCharsInited=!1,this.FAlwaysQuote=!1,this.FQuoteChar="",this.FDelimiter="",this.FNameValueSeparator="",this.FUpdateCount=0,this.FLBS=0,this.FSkipLastLineBreak=!1,this.FStrictDelimiter=!1,this.FLineBreak=""},this.GetValue=function(t){var e,i="",s="";return i="",-1!==(e=this.IndexOfName(t))&&this.GetNameValue(e,{get:function(){return s},set:function(t){s=t}},{get:function(){return i},set:function(t){i=t}}),i},this.SetDelimiter=function(t){this.CheckSpecialChars(),this.FDelimiter=t},this.DoSetTextStr=function(t,e){var i="",s=0;try{for(this.BeginUpdate(),e&&this.Clear(),s=1;this.GetNextLinebreak(t,{get:function(){return i},set:function(t){i=t}},{get:function(){return s},set:function(t){s=t}});)this.Add(i)}finally{this.EndUpdate()}},this.GetNameValueSeparator=function(){return this.CheckSpecialChars(),this.FNameValueSeparator},this.GetSkipLastLineBreak=function(){return this.CheckSpecialChars(),this.FSkipLastLineBreak},this.SetSkipLastLineBreak=function(t){this.CheckSpecialChars(),this.FSkipLastLineBreak=t},this.Error=function(e,i){throw t.EStringListError.$create("CreateFmt",[e,pas.System.VarRecs(18,pas.SysUtils.IntToStr(i))])},this.GetCapacity=function(){return this.GetCount()},this.GetObject=function(t){return null,null},this.GetTextStr=function(){var t="",e=0,i="";if(this.CheckSpecialChars(),this.FLineBreak!==pas.System.sLineBreak)i=this.FLineBreak;else{var s=this.FLBS;0===s?i="\n":1===s?i="\r\n":2===s&&(i="\r")}t="";for(var n=0,r=this.GetCount()-1;n<=r;n++)e=n,t+=this.Get(e),(e<this.GetCount()-1||!this.GetSkipLastLineBreak())&&(t+=i);return t},this.PutObject=function(t,e){},this.SetTextStr=function(t){this.CheckSpecialChars(),this.DoSetTextStr(t,!0)},this.SetUpdateState=function(t){},this.DoCompareText=function(t,e){return pas.SysUtils.CompareText(t,e)},this.SetDelimitedText=function(t){var e=0,i=0,s=!1;this.CheckSpecialChars(),this.BeginUpdate(),e=1,i=1,s=!1;try{if(this.Clear(),this.FStrictDelimiter)for(;e<=t.length;){if(s&&e<=t.length&&t.charAt(e-1)===this.FDelimiter&&(e+=1),e<=t.length)if(t.charAt(e-1)===this.FQuoteChar){for(i=e+1;i<=t.length&&(t.charAt(i-1)!==this.FQuoteChar||i+1<=t.length&&t.charAt(i+1-1)===this.FQuoteChar);)i<=t.length&&t.charAt(i-1)===this.FQuoteChar?i+=2:i+=1;this.Add(pas.SysUtils.StringReplace(pas.System.Copy(t,e+1,i-e-1),this.FQuoteChar+this.FQuoteChar,this.FQuoteChar,rtl.createSet(0))),e=i+1}else{for(i=e;i<=t.length&&t.charAt(i-1)!==this.FDelimiter;)i+=1;this.Add(pas.System.Copy(t,e,i-e)),e=i}else s&&this.Add("");s=!0}else for(;e<=t.length;){for(s&&e<=t.length&&t.charAt(e-1)===this.FDelimiter&&(e+=1);e<=t.length&&t.charCodeAt(e-1)<=32;)e+=1;if(e<=t.length)if(t.charAt(e-1)===this.FQuoteChar){for(i=e+1;i<=t.length&&(t.charAt(i-1)!==this.FQuoteChar||i+1<=t.length&&t.charAt(i+1-1)===this.FQuoteChar);)i<=t.length&&t.charAt(i-1)===this.FQuoteChar?i+=2:i+=1;this.Add(pas.SysUtils.StringReplace(pas.System.Copy(t,e+1,i-e-1),this.FQuoteChar+this.FQuoteChar,this.FQuoteChar,rtl.createSet(0))),e=i+1}else{for(i=e;i<=t.length&&t.charCodeAt(i-1)>32&&t.charAt(i-1)!==this.FDelimiter;)i+=1;this.Add(pas.System.Copy(t,e,i-e)),e=i}else s&&this.Add("");for(;e<=t.length&&t.charCodeAt(e-1)<=32;)e+=1;s=!0}}finally{this.EndUpdate()}},this.CheckSpecialChars=function(){this.FSpecialCharsInited||(this.FQuoteChar='"',this.FDelimiter=",",this.FNameValueSeparator="=",this.FLBS=pas.System.DefaultTextLineBreakStyle,this.FSpecialCharsInited=!0,this.FLineBreak=pas.System.sLineBreak)},this.GetNextLinebreak=function(t,e,i){var s,n,r=!1,o=0,l=0;return e.set(""),r=!1,t.length-i.get()<0?r:(s=t.indexOf("\n",i.get()-1)+1,n=t.indexOf("\r",i.get()-1)+1,l=1,s>0&&n>0?(s-n==1&&(l=2),o=s<n?s:n):o=s>0&&n<1?s:n>0&&s<1?n:t.length+1,e.set(pas.System.Copy(t,i.get(),o-i.get())),i.set(o+l),r=!0)},this.Create$1=function(){return pas.System.TObject.Create.call(this),this.FAlwaysQuote=!1,this},this.Destroy=function(){pas.System.TObject.Destroy.call(this)},this.Add=function(t){var e;return e=this.GetCount(),this.Insert(this.GetCount(),t),e},this.AddObject=function(t,e){var i;return i=this.Add(t),this.PutObject(i,e),i},this.AddStrings=function(t){for(var e=0,i=0,s=t.GetCount()-1;i<=s;i++)e=i,this.AddObject(t.Get(e),t.GetObject(e))},this.Assign=function(e){var i=null;if(t.TStrings.isPrototypeOf(e)){i=e,this.BeginUpdate();try{this.Clear(),this.FSpecialCharsInited=i.FSpecialCharsInited,this.FQuoteChar=i.FQuoteChar,this.FDelimiter=i.FDelimiter,this.FNameValueSeparator=i.FNameValueSeparator,this.FLBS=i.FLBS,this.FLineBreak=i.FLineBreak,this.AddStrings(i)}finally{this.EndUpdate()}}else t.TPersistent.Assign.call(this,e)},this.BeginUpdate=function(){0===this.FUpdateCount&&this.SetUpdateState(!0),this.FUpdateCount+=1},this.EndUpdate=function(){this.FUpdateCount>0&&(this.FUpdateCount-=1),0===this.FUpdateCount&&this.SetUpdateState(!1)},this.IndexOf=function(t){var e=0;for(e=0;e<this.GetCount()&&0!==this.DoCompareText(this.Get(e),t);)e+=1;return e===this.GetCount()&&(e=-1),e},this.IndexOfName=function(t){var e=0,i=0,s="";for(this.CheckSpecialChars(),e=0;e<this.GetCount();){if(s=this.Get(e),(i=pas.System.Pos(this.FNameValueSeparator,s)-1)>=0&&0===this.DoCompareText(t,pas.System.Copy(s,1,i)))return e;e+=1}return e=-1},this.GetNameValue=function(t,e,i){var s;this.CheckSpecialChars(),i.set(this.Get(t)),0!==(s=pas.System.Pos(this.FNameValueSeparator,i.get()))?(e.set(pas.System.Copy(i.get(),1,s-1)),i.set(pas.System.Copy(i.get(),s+1,i.get().length-s))):e.set("")}})),rtl.recNewT(this,"TStringItem",(function(){this.FString="",this.FObject=null,this.$eq=function(t){return this.FString===t.FString&&this.FObject===t.FObject},this.$assign=function(t){return this.FString=t.FString,this.FObject=t.FObject,this}})),this.TStringsSortStyle={0:"sslNone",sslNone:0,1:"sslUser",sslUser:1,2:"sslAuto",sslAuto:2},rtl.createClass(this,"TStringList",this.TStrings,(function(){this.$init=function(){t.TStrings.$init.call(this),this.FList=[],this.FCount=0,this.FOnChange=null,this.FOnChanging=null,this.FDuplicates=0,this.FCaseSensitive=!1,this.FOwnsObjects=!1,this.FSortStyle=0},this.$final=function(){this.FList=void 0,this.FOnChange=void 0,this.FOnChanging=void 0,t.TStrings.$final.call(this)},this.GetSorted=function(){return this.FSortStyle in rtl.createSet(1,2)},this.Grow=function(){var t=0;(t=this.GetCapacity())>=256?t+=rtl.trunc(t/4):0===t?t=4:t*=4,this.SetCapacity(t)},this.InternalClear=function(t,e){var i=0;if(t<this.FCount){if(this.FOwnsObjects)for(var s=t,n=this.FCount-1;s<=n;s++)i=s,this.FList[i].FString="",pas.SysUtils.FreeAndNil({p:this.FList[i],get:function(){return this.p.FObject},set:function(t){this.p.FObject=t}});else for(var r=t,o=this.FCount-1;r<=o;r++)i=r,this.FList[i].FString="";this.FCount=t}e||this.SetCapacity(0)},this.CheckIndex=function(t){(t<0||t>=this.FCount)&&this.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),t)},this.Changed=function(){0===this.FUpdateCount&&null!=this.FOnChange&&this.FOnChange(this)},this.Changing=function(){0===this.FUpdateCount&&null!=this.FOnChanging&&this.FOnChanging(this)},this.Get=function(t){return this.CheckIndex(t),this.FList[t].FString},this.GetCapacity=function(){return rtl.length(this.FList)},this.GetCount=function(){return this.FCount},this.GetObject=function(t){return this.CheckIndex(t),this.FList[t].FObject},this.PutObject=function(t,e){this.CheckIndex(t),this.Changing(),this.FList[t].FObject=e,this.Changed()},this.SetCapacity=function(e){e<0&&this.Error(rtl.getResStr(pas.RTLConsts,"SListCapacityError"),e),e!==this.GetCapacity()&&(this.FList=rtl.arraySetLength(this.FList,t.TStringItem,e))},this.SetUpdateState=function(t){t?this.Changing():this.Changed()},this.InsertItem=function(t,e){this.InsertItem$1(t,e,null)},this.InsertItem$1=function(e,i,s){var n=t.TStringItem.$new();this.Changing(),this.FCount===this.GetCapacity()&&this.Grow(),n.FString=i,n.FObject=s,this.FList.splice(e,0,n),this.FCount+=1,this.Changed()},this.DoCompareText=function(t,e){return this.FCaseSensitive?pas.SysUtils.CompareStr(t,e):pas.SysUtils.CompareText(t,e)},this.Destroy=function(){this.InternalClear(0,!1),t.TStrings.Destroy.call(this)},this.Add=function(t){var e=0;if(2!==this.FSortStyle)e=this.FCount;else if(this.Find(t,{get:function(){return e},set:function(t){e=t}})){var i=this.FDuplicates;if(0===i)return e;2===i&&this.Error(rtl.getResStr(pas.RTLConsts,"SDuplicateString"),0)}return this.InsertItem(e,t),e},this.Clear=function(){0!==this.FCount&&(this.Changing(),this.InternalClear(0,!1),this.Changed())},this.Find=function(e,i){var s=!1,n=0,r=0,o=0,l=0;if(s=!1,i.set(-1),!this.GetSorted())throw t.EListError.$create("Create$1",[rtl.getResStr(pas.RTLConsts,"SErrFindNeedsSortedList")]);for(n=0,r=this.GetCount()-1;n<=r;)o=n+rtl.trunc((r-n)/2),(l=this.DoCompareText(e,this.FList[o].FString))>0?n=o+1:(r=o-1,0===l&&(s=!0,1!==this.FDuplicates&&(n=o)));return i.set(n),s},this.IndexOf=function(e){var i=0;return this.GetSorted()?this.Find(e,{get:function(){return i},set:function(t){i=t}})||(i=-1):i=t.TStrings.IndexOf.call(this,e),i},this.Insert=function(t,e){2===this.FSortStyle?this.Error(rtl.getResStr(pas.RTLConsts,"SSortedListError"),0):((t<0||t>this.FCount)&&this.Error(rtl.getResStr(pas.RTLConsts,"SListIndexError"),t),this.InsertItem(t,e))}})),rtl.createClass(this,"TCollectionItem",this.TPersistent,(function(){this.$init=function(){t.TPersistent.$init.call(this),this.FCollection=null,this.FID=0},this.$final=function(){this.FCollection=void 0,t.TPersistent.$final.call(this)},this.GetIndex=function(){return null!=this.FCollection?this.FCollection.FItems.IndexOf(this):-1},this.SetCollection=function(t){t!==this.FCollection&&(null!=this.FCollection&&this.FCollection.RemoveItem(this),null!=t&&t.InsertItem(this))},this.Changed=function(t){null!==this.FCollection&&0===this.FCollection.FUpdateCount&&(t?this.FCollection.Update(null):this.FCollection.Update(this))},this.GetOwner=function(){return this.FCollection},this.SetDisplayName=function(t){this.Changed(!1)},this.Create$1=function(t){return pas.System.TObject.Create.call(this),this.SetCollection(t),this},this.Destroy=function(){this.SetCollection(null),pas.System.TObject.Destroy.call(this)}})),this.TCollectionNotification={0:"cnAdded",cnAdded:0,1:"cnExtracting",cnExtracting:1,2:"cnDeleting",cnDeleting:2},rtl.createClass(this,"TCollection",this.TPersistent,(function(){this.$init=function(){t.TPersistent.$init.call(this),this.FItemClass=null,this.FItems=null,this.FUpdateCount=0,this.FNextID=0,this.FPropName=""},this.$final=function(){this.FItemClass=void 0,this.FItems=void 0,t.TPersistent.$final.call(this)},this.GetCount=function(){return this.FItems.FCount},this.InsertItem=function(t){this.FItemClass.isPrototypeOf(t)&&(this.FItems.Add(t),t.FCollection=this,t.FID=this.FNextID,this.FNextID+=1,this.SetItemName(t),this.Notify(t,0),this.Changed())},this.RemoveItem=function(t){var e;this.Notify(t,1),-1!==(e=this.FItems.IndexOfItem(t,1))&&this.FItems.Delete(e),t.FCollection=null,this.Changed()},this.DoClear=function(){for(var t=null;this.FItems.FCount>0;)null!=(t=rtl.getObject(this.FItems.Last()))&&t.$destroy("Destroy")},this.Changed=function(){0===this.FUpdateCount&&this.Update(null)},this.GetItem=function(t){return rtl.getObject(this.FItems.Get(t))},this.SetItemName=function(t){},this.Update=function(t){},this.Notify=function(t,e){},this.Create$1=function(e){return pas.System.TObject.Create.call(this),this.FItemClass=e,this.FItems=t.TFPList.$create("Create"),this},this.Destroy=function(){this.FUpdateCount=1;try{this.DoClear()}finally{this.FUpdateCount=0}null!=this.FItems&&this.FItems.$destroy("Destroy"),pas.System.TObject.Destroy.call(this)},this.Owner=function(){return this.GetOwner()},this.Add=function(){return this.FItemClass.$create("Create$1",[this])},this.Assign=function(e){var i=0;if(t.TCollection.isPrototypeOf(e)){this.Clear();for(var s=0,n=e.GetCount()-1;s<=n;s++)i=s,this.Add().Assign(e.GetItem(i))}else t.TPersistent.Assign.call(this,e)},this.BeginUpdate=function(){this.FUpdateCount+=1},this.Clear=function(){if(0!==this.FItems.FCount){this.BeginUpdate();try{this.DoClear()}finally{this.EndUpdate()}}},this.EndUpdate=function(){this.FUpdateCount>0&&(this.FUpdateCount-=1),0===this.FUpdateCount&&this.Changed()}})),rtl.createClass(this,"TOwnedCollection",this.TCollection,(function(){this.$init=function(){t.TCollection.$init.call(this),this.FOwner=null},this.$final=function(){this.FOwner=void 0,t.TCollection.$final.call(this)},this.GetOwner=function(){return this.FOwner},this.Create$2=function(e,i){return this.FOwner=e,t.TCollection.Create$1.call(this,i),this}})),this.TOperation={0:"opInsert",opInsert:0,1:"opRemove",opRemove:1},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.TComponentStyleItem={0:"csInheritable",csInheritable:0,1:"csCheckPropAvail",csCheckPropAvail:1,2:"csSubComponent",csSubComponent:2,3:"csTransient",csTransient:3},this.$rtti.$inherited("TComponentName",rtl.string,{}),rtl.createClass(this,"TComponent",this.TPersistent,(function(){this.$init=function(){t.TPersistent.$init.call(this),this.FOwner=null,this.FName="",this.FTag=0,this.FComponents=null,this.FFreeNotifies=null,this.FComponentState={},this.FComponentStyle={},this.FLeft=0,this.FTop=0},this.$final=function(){this.FOwner=void 0,this.FComponents=void 0,this.FFreeNotifies=void 0,this.FComponentState=void 0,this.FComponentStyle=void 0,t.TPersistent.$final.call(this)},this.GetComponent=function(t){return null==this.FComponents?null:rtl.getObject(this.FComponents.Get(t))},this.GetComponentCount=function(){return null==this.FComponents?0:this.FComponents.FCount},this.Insert=function(e){null==this.FComponents&&(this.FComponents=t.TFPList.$create("Create")),this.FComponents.Add(e),e.FOwner=this},this.Remove=function(t){t.FOwner=null,null!=this.FComponents&&(this.FComponents.Remove(t),0===this.FComponents.FCount&&(this.FComponents.$destroy("Destroy"),this.FComponents=null))},this.RemoveNotification=function(t){null!==this.FFreeNotifies&&(this.FFreeNotifies.Remove(t),0===this.FFreeNotifies.FCount&&(this.FFreeNotifies.$destroy("Destroy"),this.FFreeNotifies=null,this.FComponentState=rtl.excludeSet(this.FComponentState,8)))},this.SetReference=function(t){var e=null,i=null,s=null;""!==this.FName&&null!=this.FOwner&&(s=this.FOwner,null!=(e=this.FOwner.$class.FieldAddress(this.FName))&&(i=t?this:null,s[""+e.name]=i))},this.ChangeName=function(t){this.FName=t},this.GetOwner=function(){return this.FOwner},this.Loaded=function(){this.FComponentState=rtl.excludeSet(this.FComponentState,0)},this.Loading=function(){this.FComponentState=rtl.includeSet(this.FComponentState,0)},this.Notification=function(t,e){var i=0;if(1===e&&this.RemoveFreeNotification(t),null!=this.FComponents)for(i=this.FComponents.FCount-1;i>=0;)rtl.getObject(this.FComponents.Get(i)).Notification(t,e),(i-=1)>=this.FComponents.FCount&&(i=this.FComponents.FCount-1)},this.SetDesigning=function(t,e){var i=0;if(this.FComponentState=t?rtl.includeSet(this.FComponentState,4):rtl.excludeSet(this.FComponentState,4),null!=this.FComponents&&e)for(var s=0,n=this.FComponents.FCount-1;s<=n;s++)i=s,rtl.getObject(this.FComponents.Get(i)).SetDesigning(t,!0)},this.SetName=function(e){if(this.FName!==e){if(""!==e&&!pas.SysUtils.IsValidIdent(e,!1,!1))throw t.EComponentError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SInvalidName"),pas.System.VarRecs(18,e)]);null!=this.FOwner?this.FOwner.ValidateRename(this,this.FName,e):this.ValidateRename(null,this.FName,e),this.SetReference(!1),this.ChangeName(e),this.SetReference(!0)}},this.SetParentComponent=function(t){},this.ValidateRename=function(e,i,s){if(null!==e&&0!==pas.SysUtils.CompareText(i,s)&&e.FOwner===this&&null!==this.FindComponent(s))throw t.EComponentError.$create("CreateFmt",[rtl.getResStr(pas.RTLConsts,"SDuplicateName"),pas.System.VarRecs(18,s)]);4 in this.FComponentState&&null!==this.FOwner&&this.FOwner.ValidateRename(e,i,s)},this.ValidateContainer=function(t){t.ValidateInsert(this)},this.ValidateInsert=function(t){},this.GetLeft=function(){return this.FLeft},this.GetTop=function(){return this.FTop},this.SetLeft=function(t){this.FLeft=t},this.SetTop=function(t){this.FTop=t},this.Create$1=function(t){return this.FComponentStyle=rtl.createSet(0),null!=t&&t.InsertComponent(this),this},this.Destroy=function(){var t=0,e=null;if(this.Destroying(),null!=this.FFreeNotifies){for(t=this.FFreeNotifies.FCount-1;t>=0;)e=rtl.getObject(this.FFreeNotifies.Get(t)),this.FFreeNotifies.Delete(t),e.Notification(this,1),null===this.FFreeNotifies?t=0:t>this.FFreeNotifies.FCount&&(t=this.FFreeNotifies.FCount),t-=1;pas.SysUtils.FreeAndNil({p:this,get:function(){return this.p.FFreeNotifies},set:function(t){this.p.FFreeNotifies=t}})}this.DestroyComponents(),null!==this.FOwner&&this.FOwner.RemoveComponent(this),pas.System.TObject.Destroy.call(this)},this.BeforeDestruction=function(){3 in this.FComponentState||this.Destroying()},this.DestroyComponents=function(){for(var t=null;null!=this.FComponents;)t=rtl.getObject(this.FComponents.Last()),this.Remove(t),t.$destroy("Destroy")},this.Destroying=function(){var t=0;if(!(3 in this.FComponentState)&&(this.FComponentState=rtl.includeSet(this.FComponentState,3),null!=this.FComponents))for(var e=0,i=this.FComponents.FCount-1;e<=i;e++)t=e,rtl.getObject(this.FComponents.Get(t)).Destroying()},this.AfterLoadDFMValues=function(){this.EndUpdate(),this.Loaded()},this.BeforeLoadDFMValues=function(){4 in this.FComponentState||this.Loading(),this.BeginUpdate()},this.BeginUpdate=function(){},this.EndUpdate=function(){},this.FindComponent=function(t){var e=null,i=0;if(e=null,""===t||null==this.FComponents)return e;for(var s=0,n=this.FComponents.FCount-1;s<=n;s++)if(i=s,0===pas.SysUtils.CompareText(rtl.getObject(this.FComponents.Get(i)).FName,t))return e=rtl.getObject(this.FComponents.Get(i));return e},this.RemoveFreeNotification=function(t){this.RemoveNotification(t),t.RemoveNotification(this)},this.InsertComponent=function(t){t.ValidateContainer(this),this.ValidateRename(t,"",t.FName),null!==t.FOwner&&t.FOwner.RemoveComponent(t),this.Insert(t),4 in this.FComponentState&&t.SetDesigning(!0,!0),this.Notification(t,0)},this.RemoveComponent=function(t){this.Notification(t,1),this.Remove(t),t.SetDesigning(!1,!0),this.ValidateRename(t,t.FName,"")};var e=this.$rtti;e.addProperty("Name",6,t.$rtti.TComponentName,"FName","SetName"),e.addProperty("Tag",0,rtl.nativeint,"FTag","FTag",{Default:0})})),rtl.createClass(this,"TLoadHelper",pas.System.TObject,(function(){})),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.GetClass=function(t){var i=null;return i=null,""===t?i:e.ClassList.hasOwnProperty(t)?i=rtl.getObject(e.ClassList[t]):i},this.SetLoadHelperClass=function(t){var i;return i=e.GlobalLoadHelper,e.GlobalLoadHelper=t,i},t.$implcode=function(){e.GlobalLoadHelper=null,e.ClassList=null},t.$init=function(){e.ClassList=new Object}}),["Web"]),rtl.module("WEBLib.Consts",["System"],(function(){"use strict";this.$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"},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:"Verzögern"},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.WebTools","WEBLib.Graphics"],(function(){"use strict";var t=this,e=t.$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}),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 t=this.$rtti;t.addProperty("Caption",0,rtl.string,"FCaption","FCaption"),t.addProperty("ElementClassName",0,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","FElementClassName"),t.addProperty("Tag",0,rtl.longint,"FTag","FTag",{Default:0})})),rtl.createClass(this,"TCustomDialogButtons",pas.Classes.TOwnedCollection,(function(){this.GetItem$1=function(t){return this.GetItem(t)}})),rtl.createClass(this,"TMessageDlg",pas["WEBLib.Controls"].TCustomControl,(function(){this.$init=function(){pas["WEBLib.Controls"].TCustomControl.$init.call(this),this.FOpacity=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=!1,this.FDown=!1,this.FElementTitleClassName="",this.FElementButtonClassName="",this.FElementContentClassName="",this.FDialogText=null,this.FCustomButtons=null,this.FElementDialogClassName="",this.FAutoLanguage=!1},this.$final=function(){this.FLayer$1=void 0,this.FDlg=void 0,this.FCancel=void 0,this.FOnButtonClick=void 0,this.FOnClose=void 0,this.FButtons=void 0,this.FDialogProc=void 0,this.FDialogText=void 0,this.FCustomButtons=void 0,pas["WEBLib.Controls"].TCustomControl.$final.call(this)},this.SetDialogText=function(t){this.FDialogText.Assign(t)},this.SetCustomButtons=function(t){this.FCustomButtons.Assign(t)},this.CreateElement=function(){var t=null;return 4 in this.FComponentState?t=null:pas["WEBLib.Controls"].TCustomControl.CreateElement.call(this),t};this.GetDialogText=function(t){var e="",i="",s=0;if(e="Undefined",t<this.FDialogText.GetCount()&&(e=this.FDialogText.Get(t)),this.FAutoLanguage){i=pas["WEBLib.WebTools"].GetBrowserLocale(),s=0,1===pas.System.Pos("es",i)&&(s=3),1===pas.System.Pos("fr",i)&&(s=1),1===pas.System.Pos("de",i)&&(s=2),1===pas.System.Pos("nl",i)&&(s=4);var n=s;if(3===n){var r=t;0===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SWarningES"):1===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SErrorES"):2===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SInformationES"):3===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SConfirmES"):5===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SOKES"):6===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SCancelES"):7===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SYesES"):8===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SNoES"):9===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SAbortES"):10===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SRetryES"):11===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SIgnoreES"):12===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SAllES"):13===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SYesToAllES"):14===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SNoToAllES"):15===r?e=rtl.getResStr(pas["WEBLib.Consts"],"SHelpES"):16===r&&(e=rtl.getResStr(pas["WEBLib.Consts"],"SCloseES"))}else if(1===n){var o=t;0===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SWarningFR"):1===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SErrorFR"):2===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SInformationFR"):3===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SConfirmFR"):5===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SOKFR"):6===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SCancelFR"):7===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SYesFR"):8===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SNoFR"):9===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SAbortFR"):10===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SRetryFR"):11===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SIgnoreFR"):12===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SAllFR"):13===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SYesToAllFR"):14===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SNoToAllFR"):15===o?e=rtl.getResStr(pas["WEBLib.Consts"],"SHelpFR"):16===o&&(e=rtl.getResStr(pas["WEBLib.Consts"],"SCloseFR"))}else if(2===n){var l=t;0===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SWarningDE"):1===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SErrorDE"):2===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SInformationDE"):3===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SConfirmDE"):5===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SOKDE"):6===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SCancelDE"):7===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SYesDE"):8===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SNoDE"):9===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SAbortDE"):10===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SRetryDE"):11===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SIgnoreDE"):12===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SAllDE"):13===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SYesToAllDE"):14===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SNoToAllDE"):15===l?e=rtl.getResStr(pas["WEBLib.Consts"],"SHelpDE"):16===l&&(e=rtl.getResStr(pas["WEBLib.Consts"],"SCloseDE"))}else if(4===n){var a=t;0===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SWarningNL"):1===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SErrorNL"):2===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SInformationNL"):3===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SConfirmNL"):5===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SOKNL"):6===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SCancelNL"):7===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SYesNL"):8===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SNoNL"):9===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SAbortNL"):10===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SRetryNL"):11===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SIgnoreNL"):12===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SAllNL"):13===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SYesToAllNL"):14===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SNoToAllNL"):15===a?e=rtl.getResStr(pas["WEBLib.Consts"],"SHelpNL"):16===a&&(e=rtl.getResStr(pas["WEBLib.Consts"],"SCloseNL"))}}return e},this.BindEvents=function(){},this.SetDialogResult=function(t){this.FDialogResult=t,0!==this.FDialogResult&&this.Close()},this.CreateButton=function(t,e,i){var s=null;return(s=document.createElement("BUTTON")).innerHTML=t,1===pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary?(s.setAttribute("type","BUTTON"),s.setAttribute("class","btn "+i),s.setAttribute("data-dismiss","modal-dialog")):(s.style.setProperty("width","100px"),s.style.setProperty("margin-left","5px"),""!==this.FElementButtonClassName?s.setAttribute("class",this.FElementButtonClassName+" "+i):""!==pas["WEBLib.Forms"].Application.FThemeButtonClassName&&s.setAttribute("class",pas["WEBLib.Forms"].Application.FThemeButtonClassName+" "+i)),s.id=t,s.addEventListener("click",rtl.createCallback(this,"HandleButtonClick")),s.addEventListener("keydown",rtl.createCallback(this,"HandleKeyDown")),e.get()&&(setTimeout((function(){s.focus()}),1),e.set(!1)),s},this.HandleDocMouseMove=function(t){var e=0,i=0,s=null;return this.FDown&&(e=t.screenX-this.FMdx,i=t.screenY-this.FMdy,(s=this.FDlg).style.setProperty("transform",""),s.style.setProperty("position","absolute"),s.style.setProperty("left",pas.SysUtils.IntToStr(Math.round(this.FDlgX+e))+"px"),s.style.setProperty("top",pas.SysUtils.IntToStr(Math.round(this.FDlgY+i))+"px"),(s=this.FCancel).style.setProperty("position","absolute"),s.style.setProperty("top","0"),s.style.setProperty("right","0")),!0,!0},this.HandleDocMouseUp=function(t){return this.FDown=!1,document.body.removeEventListener("mousemove",rtl.createCallback(this,"HandleDocMouseMove")),document.body.removeEventListener("mouseup",rtl.createCallback(this,"HandleDocMouseUp")),!0,!0},this.HandleMouseDown=function(t){var e;return this.FMdx=Math.round(t.screenX),this.FMdy=Math.round(t.screenY),e=this.FDlg.getBoundingClientRect(),this.FDlgX=Math.round(pas.System.Int(e.left)),this.FDlgY=Math.round(pas.System.Int(e.top)),this.FDown=!0,this.FCaptured$1||(this.FCaptured$1=!0,document.body.addEventListener("mousemove",rtl.createCallback(this,"HandleDocMouseMove")),document.body.addEventListener("mouseup",rtl.createCallback(this,"HandleDocMouseUp"))),!0,!0},this.HandleButtonClick=function(t){var e,i=0;if(this.SetDialogResult(0),(e=t.target.getAttribute("id"))===this.GetDialogText(7)?this.SetDialogResult(6):e===this.GetDialogText(8)?this.SetDialogResult(7):e===this.GetDialogText(5)?this.SetDialogResult(1):e===this.GetDialogText(6)?this.SetDialogResult(2):e===this.GetDialogText(9)?this.SetDialogResult(3):e===this.GetDialogText(10)?this.SetDialogResult(4):e===this.GetDialogText(11)?this.SetDialogResult(5):e===this.GetDialogText(12)?this.SetDialogResult(12):e===this.GetDialogText(13)?this.SetDialogResult(13):e===this.GetDialogText(14)?this.SetDialogResult(14):e===this.GetDialogText(15)?this.SetDialogResult(9):e===this.GetDialogText(16)&&this.SetDialogResult(8),0===this.FDialogResult&&this.FCustomButtons.GetCount()>0)for(var s=0,n=this.FCustomButtons.GetCount()-1;s<=n;s++)if(i=s,e===this.FCustomButtons.GetItem$1(i).FCaption){this.SetDialogResult(100+i);break}return null!=this.FOnButtonClick&&this.FOnButtonClick(this),!0,!0},this.HandleKeyDown=function(t){var e,i=!1;return e=this.GetKeyCode(t.key,!0),pas.System.Assigned(e)?(27===e&&this.SetDialogResult(2),i=!0):i},this.InitBootstrapStyle=function(){this.FElementButtonClassName="btn",this.FElementContentClassName="text-body",this.FElementTitleClassName="text-body",this.FElementDialogClassName="shadow-lg p-3 mb-5 bg-white rounded"},this.InsertInputElement=function(t,e){},this.CreateInitialize=function(){pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this),this.FOpacity=.2,this.FMessage="",this.FAutoLanguage=!0,this.FMsgDlgType=2,this.FDialogText=pas.Classes.TStringList.$create("Create$1"),this.FDialogText.SetSkipLastLineBreak(!0),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=4,this.FCustomButtons=t.TCustomDialogButtons.$create("Create$2",[this,t.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=!1,this.FCaptured$1=!1,null!=this.FOnClose&&this.FOnClose(this),null!=this.FDialogProc&&this.FDialogProc(this.FDialogResult)},this.Show$1=function(){var t=null,i=null,s=null,n=null,r=null,o=null,l=null,a=null,h=null,u=null,d=null,c=null,F="",p="",C="",m="",S="",y="",f="",g=!1,E=0;if(null!==pas["WEBLib.Forms"].Application&&null!==pas["WEBLib.Forms"].Application.FMainForm){pas["WEBLib.Forms"].Application.HasCSS(e.lMaterial)||this.AddControlLink("material",e.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.createCallback(this,"HandleKeyDown")),g=!0,C=this.FTitle,this.FMessage=e.StringToHTML(this.FMessage);var T=this.FMsgDlgType;0===T?(F="warning",p="orange",C=this.GetDialogText(0)):1===T?(F="cancel",p="red",C=this.GetDialogText(1)):2===T?(F="info",p="blue",C=this.GetDialogText(2)):3===T?(F="help",p="blue",C=this.GetDialogText(3)):4===T&&(F="",p="",C=this.GetDialogText(4)),1===pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary?(this.FDlg=document.createElement("DIV"),this.FDlg.setAttribute("class","modal-dialog"),this.FDlg.setAttribute("role","document"),this.FDlg.style.setProperty("z-index","1999998"),(a=document.createElement("DIV")).style.setProperty("top","0"),a.style.setProperty("left","0"),a.style.setProperty("right","0"),a.style.setProperty("bottom","0"),a.style.setProperty("z-index","1999997"),a.style.setProperty("display","block"),a.setAttribute("class","modal show fade"),document.body.appendChild(a),a.appendChild(this.FDlg),d=this.FDlg,(u=document.createElement("DIV")).setAttribute("class","modal-content "+this.FElementDialogClassName),d.appendChild(u),c=u,d=u,(u=document.createElement("DIV")).setAttribute("class","modal-header"),c.appendChild(u),d=u,(u=document.createElement("H5")).setAttribute("class","modal-title"),u.innerHTML=C,d.appendChild(u),3 in this.FButtons&&((u=document.createElement("BUTTON")).setAttribute("type","button"),u.setAttribute("class","close btn btn-danger"),u.setAttribute("data-dismiss","modal-dialog"),u.setAttribute("aria-label","Close"),u.setAttribute("id",this.GetDialogText(6)),u.addEventListener("click",rtl.createCallback(this,"HandleButtonClick")),d.appendChild(u),d=u,(u=document.createElement("SPAN")).setAttribute("aria-hidden","true"),u.setAttribute("id",this.GetDialogText(6)),u.innerHTML="×",d.appendChild(u)),(u=document.createElement("DIV")).setAttribute("class","modal-body"),c.appendChild(u),d=u,4!==this.FMsgDlgType&&((s=document.createElement("SPAN")).innerHTML='<i class="material-icons" style="color:'+p+'!important;font-size:48px!important">'+F+"</i>",s.style.setProperty("display","inline-block"),s.style.setProperty("float","left"),s.style.setProperty("padding-right","15px"),d.appendChild(s)),(u=document.createElement("H6")).innerHTML=this.FMessage,d.appendChild(u),this.InsertInputElement(d,{get:function(){return g},set:function(t){g=t}}),(u=document.createElement("DIV")).setAttribute("class","modal-footer"),c.appendChild(u),o=d=u,this.FDlg=a):(f="5",y="26",S="#f1f1f1",m="#ababab",this.FDlg=document.createElement("DIV"),document.body.appendChild(this.FDlg),l=this.FDlg,""!==this.FElementDialogClassName?l.setAttribute("class",this.FElementDialogClassName):(l.style.setProperty("background-color","white"),l.style.setProperty("border","1px solid "+m),l.style.setProperty("font-family","Arial"),l.style.setProperty("font-size","10pt")),l.style.setProperty("cursor","default"),l.style.setProperty("position","fixed"),l.style.setProperty("min-width","300px"),l.style.setProperty("min-height","125px"),l.style.setProperty("max-width","100%"),l.style.setProperty("max-height","100%"),l.style.setProperty("top","50%"),l.style.setProperty("left","50%"),l.style.setProperty("transform","translate(-50%, -50%)"),l.style.setProperty("z-index","1999998"),l.style.setProperty("box-shadow","5px 5px 5px gray"),h=document.createElement("DIV"),this.FCancel=h,h.innerHTML='<i id="Cancel" class="material-icons" style="font-size:16px!important">clear</i>',h.id="Cancel",h.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(pas["WEBLib.Forms"].Application.FThemeTextColor)),h.style.setProperty("position","fixed"),h.style.setProperty("top","0"),h.style.setProperty("right","0"),h.style.setProperty("padding",f+"px"),h.style.setProperty("height",y+"px"),h.style.setProperty("line-height",y+"px"),h.addEventListener("click",rtl.createCallback(this,"HandleButtonClick")),l.appendChild(h),(t=document.createElement("DIV")).innerHTML=C,""!==this.FElementTitleClassName?t.setAttribute("class",this.FElementTitleClassName):(t.style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(pas["WEBLib.Forms"].Application.FThemeColor)),t.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(pas["WEBLib.Forms"].Application.FThemeTextColor))),t.style.setProperty("cursor","move"),t.style.setProperty("padding-left",f+"px"),t.style.setProperty("height",y+"px"),t.style.setProperty("vertical-align","middle"),t.style.setProperty("line-height",y+"px"),t.style.setProperty("border-bottom","1px solid "+m),t.style.setProperty("-moz-user-select","none"),t.style.setProperty("-webkit-user-select","none"),t.style.setProperty("-ms-user-select","none"),t.style.setProperty("user-select","none"),t.style.setProperty("-o-user-select","none"),t.addEventListener("mousedown",rtl.createCallback(this,"HandleMouseDown")),l.appendChild(t),(i=document.createElement("DIV")).style.setProperty("padding",f+"px"),i.style.setProperty("height","auto"),i.style.setProperty("min-height","50px"),i.style.setProperty("border-bottom","1px solid "+m),4!==this.FMsgDlgType&&((s=document.createElement("DIV")).innerHTML='<i class="material-icons" style="color:'+p+'!important;font-size:48px!important">'+F+"</i>",s.style.setProperty("display","inline-block"),s.style.setProperty("float","left"),s.style.setProperty("padding-right","15px"),i.appendChild(s)),this.FMessage=pas.SysUtils.StringReplace(this.FMessage,pas.System.sLineBreak,"<BR>",rtl.createSet(0)),(r=document.createElement("DIV")).innerHTML=this.FMessage,r.style.setProperty("height","auto"),r.style.setProperty("min-height","50px"),r.style.setProperty("white-space","pre-wrap"),(n=document.createElement("LABEL")).innerHTML=this.FMessage,""!==this.FElementTitleClassName&&n.setAttribute("class",this.FElementContentClassName),r.appendChild(n),i.appendChild(n),this.InsertInputElement(i,{get:function(){return g},set:function(t){g=t}}),l.appendChild(i),(o=document.createElement("DIV")).style.setProperty("background-color",S),o.style.setProperty("padding",f+"px"),o.style.setProperty("min-height",y+"px"),o.style.setProperty("height","auto"),o.style.setProperty("line-height",y+"px"),o.style.setProperty("text-align","right"),l.appendChild(o)),rtl.eqSet(this.FButtons,{})&&0===this.FCustomButtons.GetCount()?o.appendChild(this.CreateButton(this.GetDialogText(5),{get:function(){return g},set:function(t){g=t}},"")):(0 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(7),{get:function(){return g},set:function(t){g=t}},"")),1 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(8),{get:function(){return g},set:function(t){g=t}},"")),2 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(5),{get:function(){return g},set:function(t){g=t}},"")),3 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(6),{get:function(){return g},set:function(t){g=t}},"")),4 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(9),{get:function(){return g},set:function(t){g=t}},"")),5 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(10),{get:function(){return g},set:function(t){g=t}},"")),6 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(11),{get:function(){return g},set:function(t){g=t}},"")),7 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(12),{get:function(){return g},set:function(t){g=t}},"")),9 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(13),{get:function(){return g},set:function(t){g=t}},"")),8 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(14),{get:function(){return g},set:function(t){g=t}},"")),10 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(15),{get:function(){return g},set:function(t){g=t}},"")),11 in this.FButtons&&o.appendChild(this.CreateButton(this.GetDialogText(16),{get:function(){return g},set:function(t){g=t}},"")));for(var b=0,P=this.FCustomButtons.GetCount()-1;b<=P;b++)E=b,o.appendChild(this.CreateButton(this.FCustomButtons.GetItem$1(E).FCaption,{get:function(){return g},set:function(t){g=t}},this.FCustomButtons.GetItem$1(E).FElementClassName));(a=this.FLayer$1).style.setProperty("background-color","black"),a.style.setProperty("opacity",pas["WEBLib.WebTools"].DoubleToHTML(this.FOpacity)),a.style.setProperty("top","0"),a.style.setProperty("left","0"),a.style.setProperty("right","0"),a.style.setProperty("bottom","0"),a.style.setProperty("z-index","19990"),a.style.setProperty("webkit-user-select","none"),a.style.setProperty("moz-user-select","none"),a.style.setProperty("khtml-user-select","none"),a.style.setProperty("ms-user-select","none"),a.style.setProperty("user-select","none"),a.style.setProperty("position","fixed")}},this.ShowDialog$1=function(t,e,i,s){return 0,this.FButtons=rtl.refSet(i),this.FMessage=t,this.FMsgDlgType=e,this.FDialogProc=s,this.SetDialogResult(0),this.Show$1(),0};var i=this.$rtti;i.addProperty("AutoLanguage",0,rtl.boolean,"FAutoLanguage","FAutoLanguage",{Default:!0}),i.addProperty("Buttons",0,t.$rtti.TMsgDlgButtons,"FButtons","FButtons",{Default:{}}),i.addProperty("CustomButtons",2,t.$rtti.TCustomDialogButtons,"FCustomButtons","SetCustomButtons"),i.addProperty("DialogText",2,pas.Classes.$rtti.TStringList,"FDialogText","SetDialogText"),i.addProperty("DialogType",0,t.$rtti.TMsgDlgType,"FMsgDlgType","FMsgDlgType",{Default:t.TMsgDlgType.mtCustom}),i.addProperty("Message",0,rtl.string,"FMessage","FMessage"),i.addProperty("Opacity",0,rtl.double,"FOpacity","FOpacity"),i.addProperty("ElementButtonClassName",0,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementButtonClassName","FElementButtonClassName"),i.addProperty("ElementDialogClassName",0,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementDialogClassName","FElementDialogClassName"),i.addProperty("ElementTitleClassName",0,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementTitleClassName","FElementTitleClassName"),i.addProperty("ElementContentClassName",0,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementContentClassName","FElementContentClassName"),i.addProperty("Title",0,rtl.string,"FTitle","FTitle"),i.addProperty("OnButtonClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnButtonClick","FOnButtonClick"),i.addProperty("OnClose",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClose","FOnClose")})),this.MessageDlg=function(i,s,n,r){null==e.WebLibDlg&&(e.WebLibDlg=t.TMessageDlg.$create("Create$1",[null]),1===pas["WEBLib.Forms"].Application.FMainForm.FCSSLibrary&&e.WebLibDlg.InitBootstrapStyle()),e.WebLibDlg.ShowDialog$1(i,s,rtl.refSet(n),r)},t.$implcode=function(){e.lMaterial="https://fonts.googleapis.com/icon?family=Material+Icons",e.WebLibDlg=null,e.StringToHTML=function(t){var e="";return e=pas.SysUtils.StringReplace(t,"\r","<BR>",rtl.createSet(0)),e=pas.SysUtils.StringReplace(e,"\n","",rtl.createSet(0))}},t.$init=function(){e.WebLibDlg=null}}),["WEBLib.Forms","WEBLib.Consts"]),rtl.module("Math",["System"],(function(){"use strict"})),rtl.module("WEBLib.Utils",["System","Types","Web","SysUtils","Math","Classes","JS"],(function(){"use strict";var t=this;rtl.createHelper(this,"TLongIntHelper",null,(function(){this.ToString=function(){return t.TLongIntHelper.ToString$1(this.get())},this.ToString$1=function(t){return t.toString()}})),this.FormatProp=function(t,e){return pas.SysUtils.Format$1(t,e,pas.SysUtils.TFormatSettings.Invariant())}}),["RTLConsts","WEBLib.Consts"]),rtl.module("WEBLib.Controls",["System","Classes","WEBLib.Graphics","Types","SysUtils","Web","JS"],(function(){"use strict";var t=this,e=t.$impl;this.VK_BACK=8,this.VK_RETURN=13,this.VK_ESCAPE=27,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_DELETE=46,this.WHEEL_DELTA=120,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.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},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.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(t){return this.req===t.req},this.$assign=function(t){return this.req=t.req,this},t.$rtti.$Record("TJSXMLHttpRequestRecord",{}).addField("req",pas.Web.$rtti.TJSXMLHttpRequest)})),rtl.recNewT(this,"TJSEventRecord",(function(){this.event=null,this.$eq=function(t){return this.event===t.event},this.$assign=function(t){return this.event=t.event,this},t.$rtti.$Record("TJSEventRecord",{}).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(t){return this.element===t.element},this.$assign=function(t){return this.element=t.element,this},t.$rtti.$Record("TJSHTMLElementRecord",{}).addField("element",pas.Web.$rtti.TJSHTMLElement)})),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.TControlStyleValue={0:"csAcceptsControls",csAcceptsControls:0,1:"csSetCaption",csSetCaption:1},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=void 0,pas.Classes.TPersistent.$final.call(this)},this.SetLeft=function(t){t!==this.FLeft&&(this.FLeft=t,this.DoChange())},this.SetTop=function(t){t!==this.FTop&&(this.FTop=t,this.DoChange())},this.SetRight=function(t){t!==this.FRight&&(this.FRight=t,this.DoChange())},this.SetBottom=function(t){t!==this.FBottom&&(this.FBottom=t,this.DoChange())},this.DoChange=function(){null!=this.FOnChange&&this.FOnChange(this)},this.Create$1=function(){return this.FLeft=3,this.FTop=3,this.FBottom=3,this.FRight=3,this},this.Assign=function(e){t.TMargins.isPrototypeOf(e)?(this.FLeft=rtl.as(e,t.TMargins).FLeft,this.FTop=rtl.as(e,t.TMargins).FTop,this.FBottom=rtl.as(e,t.TMargins).FBottom,this.FRight=rtl.as(e,t.TMargins).FRight):pas.Classes.TPersistent.Assign.apply(this,arguments)};var e=this.$rtti;e.addProperty("Left",2,rtl.longint,"FLeft","SetLeft",{Default:3}),e.addProperty("Top",2,rtl.longint,"FTop","SetTop",{Default:3}),e.addProperty("Right",2,rtl.longint,"FRight","SetRight",{Default:3}),e.addProperty("Bottom",2,rtl.longint,"FBottom","SetBottom",{Default:3})})),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=void 0,pas.Classes.TPersistent.$final.call(this)},this.SetLeft=function(t){this.FLeft!==t&&(this.FLeft=t,this.DoChange())},this.SetTop=function(t){this.FTop!==t&&(this.FTop=t,this.DoChange())},this.SetRight=function(t){this.FRight!==t&&(this.FRight=t,this.DoChange())},this.SetBottom=function(t){this.FBottom!==t&&(this.FBottom=t,this.DoChange())},this.DoChange=function(){null!=this.FOnChange&&this.FOnChange(this)},this.Create$1=function(){return pas.System.TObject.Create.call(this),this.FLeft=0,this.FTop=0,this.FRight=0,this.FBottom=0,this},this.Assign=function(e){t.TPadding.isPrototypeOf(e)&&(this.FLeft=rtl.as(e,t.TPadding).FLeft,this.FRight=rtl.as(e,t.TPadding).FRight,this.FTop=rtl.as(e,t.TPadding).FTop,this.FBottom=rtl.as(e,t.TPadding).FBottom)};var e=this.$rtti;e.addProperty("Left",2,rtl.longint,"FLeft","SetLeft",{Default:0}),e.addProperty("Top",2,rtl.longint,"FTop","SetTop",{Default:0}),e.addProperty("Right",2,rtl.longint,"FRight","SetRight",{Default:0}),e.addProperty("Bottom",2,rtl.longint,"FBottom","SetBottom",{Default:0})})),rtl.createClass(this,"TControl",pas.Classes.TComponent,(function(){this.$init=function(){pas.Classes.TComponent.$init.call(this),this.FGotFocus=!1,this.FAcceptDrag=!1,this.FCaptureDown=!1,this.FMouseInsideLayer=!1,this.FLayer=null,this.FCaptured=!1,this.FControlCreated=!1,this.FUpdateCount=0,this.FBlockUpdateElement=!1,this.FElement=null,this.FID="",this.FNew=!1,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=!1,this.FHint="",this.FRole="",this.FShowHint=!1,this.FTabOrder=0,this.FTabStop=!1,this.FVisible=!1,this.FWidth=0,this.FHeight=0,this.FTag$1=0,this.FAlign=0,this.FAnchors={},this.FAlignWithMargins=!1,this.FIsAligning=!1,this.FOnMouseEnter=null,this.FOnMouseLeave=null,this.FCursor=0,this.FDoubleBuffered=!1,this.FControlStyle={},this.FMargins=null,this.FOnMouseWheel=null,this.FParentDoubleBuffered=!1,this.FParentColor=!1,this.FParentFont=!1,this.FParentBiDiMode=!1,this.FOnTouchMove=null,this.FOnTouchStart=null,this.FOnTouchEnd=null,this.FOnTouchCancel=null,this.FLinkTouchEvents=!1,this.FWidthStyle=0,this.FHeightStyle=0,this.FWidthPercent=0,this.FHeightPercent=0,this.FOrigRect=pas.Types.TRect.$new(),this.FOrigParentRect=pas.Types.TRect.$new(),this.FIsResizing=!1,this.FShowFocus=!1,this.FBorderWidth=0,this.FOrigTop=0,this.FOrigLeft=0,this.FUpdateTopLeft=!1,this.FEnablePropagation=!1,this.FParentShowHint=!1,this.FScriptLoaded=!1,this.FControlScriptCountLoaded=0,this.FRequiredScripts=null,this.FElementFont=0,this.FElementPosition=0,this.FParentElement=null,this.FClipChildren=!1,this.FTextDirection=0,this.FEventStopPropagation={},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=!1,this.FWheelAccumulator=0,this.FWheelMousePos=pas.Types.TPoint.$new(),this.FBiDiMode=0,this.FOnMouseWheelDown=null,this.FOnMouseWheelUp=null,this.FNoUserSelect=!1,this.FEventsBound=!1,this.FDragMode=0,this.FToolTip=void 0,this.FColor=0},this.$final=function(){this.FLayer=void 0,this.FElement=void 0,this.FContainer=void 0,this.FElementEvent=void 0,this.FLastElementEvent=void 0,this.FFont=void 0,this.FParent=void 0,this.FPrevParent=void 0,this.FControls=void 0,this.FOnDragOver=void 0,this.FOnDragDrop=void 0,this.FOnStartDrag=void 0,this.FonEndDrag=void 0,this.FOnClick=void 0,this.FOnDblClick=void 0,this.FOnMouseDown=void 0,this.FOnMouseUp=void 0,this.FOnMouseMove=void 0,this.FOnKeyDown=void 0,this.FOnKeyUp=void 0,this.FOnKeyPress=void 0,this.FOnEnter=void 0,this.FOnExit=void 0,this.FAnchors=void 0,this.FOnMouseEnter=void 0,this.FOnMouseLeave=void 0,this.FControlStyle=void 0,this.FMargins=void 0,this.FOnMouseWheel=void 0,this.FOnTouchMove=void 0,this.FOnTouchStart=void 0,this.FOnTouchEnd=void 0,this.FOnTouchCancel=void 0,this.FOrigRect=void 0,this.FOrigParentRect=void 0,this.FRequiredScripts=void 0,this.FParentElement=void 0,this.FEventStopPropagation=void 0,this.FOnResize=void 0,this.FWheelMousePos=void 0,this.FOnMouseWheelDown=void 0,this.FOnMouseWheelUp=void 0,pas.Classes.TComponent.$final.call(this)},this.GetControlsCount=function(){return rtl.length(this.FControls)},this.GetControls=function(t){return this.FControls[t]},this.SetVisible=function(t){this.FVisible!==t&&(this.VisibleChanging(),this.FVisible=t,this.UpdateElement(),this.DoRealign(),this.AlignControl(this),this.VisibleChanged())},this.SetHint=function(t){this.FHint!==t&&(this.FHint=t,this.UpdateElement())},this.SetShowHint=function(t){this.FShowHint!==t&&(this.FShowHint=t,this.UpdateElement())},this.SetTabOrder=function(t){this.FTabOrder!==t&&(this.FTabOrder=t,this.UpdateElement())},this.SetTabStop=function(t){this.FTabStop!==t&&(this.FTabStop=t,this.UpdateElement())},this.SetAlign=function(t){this.FAlign!==t&&(this.FAlign=t,this.DoRealign())},this.SetAlignWithMargins=function(t){this.FAlignWithMargins!==t&&(this.FAlignWithMargins=t,this.DoRealign())},this.GetBoundsRect=function(){var t=pas.Types.TRect.$new();return t.Left=this.GetLeft(),t.Top=this.GetTop(),t.Right=this.GetLeft()+this.GetWidth(),t.Bottom=this.GetTop()+this.GetHeight(),t},this.SetID=function(t){var e=null,i=null,s=null,n=null,r=0,o=0,l=0,a=0;if(this.FNew&&this.FID!==t&&null!=(e=document.getElementById(t)))return r=this.FLeft,o=this.FTop,l=this.FWidth,a=this.FHeight,i=null,this.UnbindEvents(),null!=this.FContainer&&(this.FParentElement=this.FContainer.parentElement,i=document.createElement("SPAN"),this.MoveElements(this.FContainer,i)),n=this.FParent,this.SetParent(null),this.CreateWithID(t),this.SetParentComponent(n),this.FID=t,this.FWidth=l,this.FHeight=a,this.UpdateElement(),4 in this.FComponentState&&(this.FLeft=r,this.FTop=o),void(null!=i&&this.MoveElementsAndFree(i,this.GetElementHandle()));if(!this.FNew&&this.FID!==t){if(l=this.FWidth,a=this.FHeight,null!=(e=document.getElementById(this.FID))&&(i=document.createElement("SPAN"),this.MoveElements(e,i),this.UnbindEvents()),""!==t&&null!=(e=document.getElementById(t)))return this.CreateWithID(t),this.FID=t,this.FWidth=l,this.FHeight=a,this.UpdateElement(),void this.MoveElementsAndFree(i,this.FContainer);this.FNew=!0,this.FElement=null,this.CreateControl(),""===t&&(this.CreateInitialize(),this.FWidth=l,this.FHeight=a),null!=this.FParentElement?this.FParentElement.appendChild(this.GetContainer()):document.body.appendChild(this.GetContainer()),null!=(s=pas["WEBLib.Forms"].GetParentForm(this))&&(this.SetParent(s),this.SetElementPosition(0),this.SetLeft(0),this.SetTop(0)),null!=i&&this.MoveElementsAndFree(i,this.FContainer),this.UpdateElement(),this.UpdateElementSize()}this.FID=t,null!=this.FContainer&&this.FContainer.setAttribute("id",t)},this.SetMargins=function(t){this.FMargins.Assign(t)},this.SetAnchors=function(t){rtl.neSet(this.FAnchors,t)&&(this.FAnchors=rtl.refSet(t),0 in this.FComponentState||this.UpdateAnchoring())},this.GetElementEvent=function(){return this.FElementEvent},this.SetHeightStyle=function(t){this.FHeightStyle!==t&&(this.FHeightStyle=t,2===this.FHeightStyle&&null!=this.GetElementHandle()&&this.GetElementStyle().removeProperty("height"),this.UpdateElementSize(),this.ResetAnchoring(),this.DoBoundsChange())},this.SetWidthStyle=function(t){this.FWidthStyle!==t&&(this.FWidthStyle=t,2===this.FWidthStyle&&null!=this.GetElementHandle()&&this.GetElementStyle().removeProperty("width"),this.UpdateElementSize(),this.ResetAnchoring(),this.DoBoundsChange())},this.SetHeightPercent=function(t){this.FHeightPercent!==t&&(this.FHeightPercent=t,this.UpdateElementSize(),this.ResetAnchoring(),this.DoBoundsChange())},this.SetWidthPercent=function(t){this.FWidthPercent!==t&&(this.FWidthPercent=t,this.UpdateElementSize(),this.ResetAnchoring(),this.DoBoundsChange())},this.SetShowFocus=function(t){this.FShowFocus!==t&&(this.FShowFocus=t,this.UpdateElement())},this.GetIsLinked=function(){return!this.FNew},this.SetElementFont=function(t){this.FElementFont!==t&&(this.FElementFont=t,this.UpdateElementVisual())},this.SetElementPosition=function(t){this.FElementPosition!==t&&(this.FElementPosition=t,null!=this.GetElementHandle()&&(this.UpdateElementSize(),this.RecreateCanvas(),this.InternalResize()))},this.SetClipChildren=function(t){this.FClipChildren=t,this.UpdateElement()},this.SetChildOrderEx=function(t){this.FChildOrder=t},this.GetRole=function(){var t="";return t=this.FRole,null!=this.GetElementHandle()&&(t=this.GetElementHandle().getAttribute("role")),t},this.SetRole=function(t){this.FRole=t,null!=this.GetElementHandle()&&(""===t?this.GetElementHandle().removeAttribute("role"):this.GetElementHandle().setAttribute("role",t))},this.GetContainer=function(){return this.FContainer},this.GetChildContainer=function(){return this.FContainer},this.SetParentFont=function(t){t!==this.FParentFont&&t&&null!=this.FParent&&(this.BeginUpdate(),this.FFont.Assign(this.FParent.FFont),this.EndUpdate(),this.UpdateElement()),this.FParentFont=t},this.SetParentColor=function(t){this.FParentColor!==t&&t&&null!=this.FParent&&this.SetColor(this.FParent.FColor),this.FParentColor=t},this.SetDragMode=function(t){this.FDragMode=t,1===t?this.BeginDrag():this.DisableDrag()},this.SetWidth=function(t){this.FWidth!==t&&(this.FWidth=t,this.ResetAnchoring(),this.DoBoundsChange(),this.GetIsLinked()&&!this.IsUpdating()&&null!=this.GetElementHandle()&&(t>=0?this.GetElementStyle().setProperty("width",pas.SysUtils.IntToStr(t)+"px"):this.GetElementStyle().removeProperty("width")))},this.SetHeight=function(t){var e=null;this.FHeight!==t&&(this.FAlign in rtl.createSet(3,4,5)&&null!=this.GetElementHandle()&&(e=this.GetElementHandle().getBoundingClientRect()).top+t>=pas["WEBLib.Forms"].WinHeight()&&(t=Math.round(pas["WEBLib.Forms"].WinHeight()-e.top)),this.FHeight=t,this.ResetAnchoring(),this.DoBoundsChange(),this.GetIsLinked()&&!this.IsUpdating()&&null!=this.GetElementHandle()&&(t>=0?this.GetElementStyle().setProperty("height",pas.SysUtils.IntToStr(t)+"px"):this.GetElementStyle().removeProperty("height")))},this.SetWidthInt=function(t){this.FWidth=t},this.SetHeightInt=function(t){this.FHeight=t},this.SetEnabled=function(t){this.FEnabled!==t&&(this.FEnabled=t,this.UpdateElementData())},this.RecreateCanvas=function(){},this.VisibleChanging=function(){},this.VisibleChanged=function(){for(var t=0,e=0,i=this.GetControlsCount()-1;e<=i;e++)t=e,this.GetControls(t).VisibleChanged()},this.ColorChanging=function(){},this.GetWidth=function(){var t=0,e=null;return t=this.FWidth,null==this.GetElementHandle()||0 in this.FComponentState||(-1===t&&(t=Math.round(pas.System.Int(this.GetElementHandle().offsetWidth))),1!==this.FWidthStyle&&(e=this.GetElementHandle().getBoundingClientRect(),t=Math.round(pas.System.Int(e.right-e.left)))),t},this.GetHeight=function(){var t=0,e=null;return t=this.FHeight,null==this.GetElementHandle()||0 in this.FComponentState||(-1===t&&(t=Math.round(pas.System.Int(this.GetElementHandle().offsetHeight))),1!==this.FHeightStyle&&(e=this.GetElementHandle().getBoundingClientRect(),t=Math.round(pas.System.Int(e.bottom-e.top)))),t},this.GetOuterWidth=function(){return this.FWidth-this.FBorderWidth},this.GetOuterHeight=function(){return this.FHeight-this.FBorderWidth},this.GetDesignWidth=function(){return this.FWidth},this.GetDesignHeight=function(){return this.FHeight},this.GetDesignLeft=function(){return this.FLeft},this.GetDesignTop=function(){return this.FTop},this.GetLeft=function(){var t=0;return-1!==(t=this.FLeft)||null==this.GetElementHandle()||0 in this.FComponentState||(t=Math.round(this.GetElementHandle().offsetLeft)),t},this.GetTop=function(){var t=0;return-1!==(t=this.FTop)||null==this.GetElementHandle()||0 in this.FComponentState||(t=Math.round(this.GetElementHandle().offsetTop)),t},this.HandleAllocated=function(){return!0,!0},this.CreateElement=function(){return null,null},this.CreateChildElements=function(t){},this.ContainerElement=function(){return document.body},this.IsStructuralElement=function(){return!1,!1},this.IsEnabled=function(){return this.FEnabled},this.GetNewName=function(){var e,i="",s="";return i=this.$classname,pas.System.Delete({get:function(){return i},set:function(t){i=t}},1,1),s="",null!=(e=pas["WEBLib.Forms"].GetParentForm(this))&&(s=e.$classname),s+"_"+t.FindUniqueName(i)},this.IsInputControl=function(){return!1,!1},this.UseCSSFont=function(){return!(""===this.FElementClassName&&0===this.FElementFont&&!this.GetIsLinked())},this.UseCSSFontColor=function(){return!(pas["WEBLib.Forms"].Application.FThemed&&pas["WEBLib.Graphics"].ColorToRGB(this.FFont.FColor)===pas["WEBLib.Graphics"].RGB(0,0,0))},this.RecreateElement=function(){null!=this.GetContainer()&&(this.UnbindEvents(),this.GetContainer().parentNode.removeChild(this.GetContainer()),this.FElement=null,this.CreateControl(),null!=this.FParent&&null!=this.FParent.GetContainer()&&this.FParent.GetChildContainer().appendChild(this.GetContainer()))},this.BindElement=function(){},this.CreateInitialize=function(){this.FRequiredScripts=pas.Classes.TStringList.$create("Create$1"),this.FOrigRect.$assign(pas.Types.Rect(-1,-1,-1,-1)),this.FClipChildren=!0},this.DestroyControls=function(){for(var t=0,e=null,i=this.GetControlsCount()-1;i>=0;i--)t=i,e=this.GetControls(t),e=rtl.freeLoc(e)},this.ClearControls=function(){this.FControls=rtl.arraySetLength(this.FControls,null,0)},this.GetElementStyle=function(){return this.GetElementHandle().style},this.SetControlCursor=function(t){this.FCursor=t,""===this.FElementClassName&&null!=this.GetElementHandle()&&this.SetElementPointer(this.GetElementHandle(),t)},this.SetBiDiMode=function(t){null!=this.GetElementHandle()&&(0===t?this.GetElementHandle().removeAttribute("dir"):this.GetElementHandle().setAttribute("dir","rtl"))},this.GetMouseEventButton=function(t){var e=0;e=0;var i=t.button;return 0===i?e=0:1===i?e=2:2===i&&(e=1),e},this.GetMouseEventShiftState=function(t){var e={};return e={},t.shiftKey&&(e=rtl.unionSet(e,rtl.createSet(0))),t.ctrlKey&&(e=rtl.unionSet(e,rtl.createSet(2))),t.altKey&&(e=rtl.unionSet(e,rtl.createSet(1))),1==(1&t.buttons)&&(e=rtl.unionSet(e,rtl.createSet(3))),2==(2&t.buttons)&&(e=rtl.unionSet(e,rtl.createSet(4))),4==(4&t.buttons)&&(e=rtl.unionSet(e,rtl.createSet(5))),e},this.GetKeyBoardEventShiftState=function(t){var e={};return e={},t.shiftKey&&(e=rtl.unionSet(e,rtl.createSet(0))),t.ctrlKey&&(e=rtl.unionSet(e,rtl.createSet(2))),t.altKey&&(e=rtl.unionSet(e,rtl.createSet(1))),e},this.GetMouseWheelEventShiftState=function(t){var e={};return e={},t.shiftKey&&(e=rtl.unionSet(e,rtl.createSet(0))),t.ctrlKey&&(e=rtl.unionSet(e,rtl.createSet(2))),t.altKey&&(e=rtl.unionSet(e,rtl.createSet(1))),e},this.GetTouchEventShiftState=function(t){var e={};return e={},t.shiftKey&&(e=rtl.unionSet(e,rtl.createSet(0))),t.ctrlKey&&(e=rtl.unionSet(e,rtl.createSet(2))),t.altKey&&(e=rtl.unionSet(e,rtl.createSet(1))),e},this.HandleDoClick=function(t){return this.FElementEvent=t,0 in this.FEventStopPropagation&&this.StopPropagation(),this.FEnabled&&this.Click(),!0,this.FElementEvent=null,!0},this.HandleDoWheel=function(t){var e,i=!1,s=0,n=0;return this.FElementEvent=t,this.StopPropagation(),this.XYToClient(t.clientX,t.clientY,{get:function(){return s},set:function(t){s=t}},{get:function(){return n},set:function(t){n=t}}),this.FWheelMousePos.x=Math.round(s),this.FWheelMousePos.y=Math.round(n),e=rtl.refSet(this.GetMouseWheelEventShiftState(t)),i=!1,this.MouseWheel(rtl.refSet(e),pas.System.Trunc(-t.deltaY),{get:function(){return i},set:function(t){i=t}}),!0,this.FElementEvent=null,!0},this.HandleDoDblClick=function(t){return this.FElementEvent=t,4 in this.FEventStopPropagation&&this.StopPropagation(),this.FEnabled&&this.DblClick(),!0,this.FElementEvent=null,!0},this.HandleDoMouseDown=function(i){var s,n,r=!1,o=0,l=0;return this.FElementEvent=i,1 in this.FEventStopPropagation&&this.StopPropagation(),this.CanFocus()||this.PreventDefault(),e.FMouseX=Math.round(i.clientX),e.FMouseY=Math.round(i.clientY),this.XYToClient(i.clientX,i.clientY,{get:function(){return o},set:function(t){o=t}},{get:function(){return l},set:function(t){l=t}}),this.HasVertScrollBar()&&o>this.GetWidth()-t.GetScrollBarWidth()||this.HasHorzScrollBar()&&l>this.GetHeight()-t.GetScrollBarHeight()||(s=rtl.refSet(this.GetMouseEventShiftState(i)),n=this.GetMouseEventButton(i),this.MouseDown(n,rtl.refSet(s),pas.System.Trunc(o),pas.System.Trunc(l)),r=!0,this.FElementEvent=null),r},this.HandleDoMouseUp=function(e){var i,s,n=!1,r=0,o=0;return this.FElementEvent=e,2 in this.FEventStopPropagation&&this.StopPropagation(),this.XYToClient(e.clientX,e.clientY,{get:function(){return r},set:function(t){r=t}},{get:function(){return o},set:function(t){o=t}}),this.HasVertScrollBar()&&r>this.GetWidth()-t.GetScrollBarWidth()||this.HasHorzScrollBar()&&o>this.GetHeight()-t.GetScrollBarHeight()?(this.FElementEvent=null,n):(i=rtl.refSet(this.GetMouseEventShiftState(e)),s=this.GetMouseEventButton(e),0===this.FDragMode&&this.DisableDrag(),this.MouseUp(s,rtl.refSet(i),pas.System.Trunc(r),pas.System.Trunc(o)),n=!0,this.FElementEvent=null,n)},this.HandleDoMouseMove=function(t){var i,s=0,n=0;return this.FElementEvent=t,e.FCursorX=Math.round(t.clientX),e.FCursorY=Math.round(t.clientY),3 in this.FEventStopPropagation&&this.StopPropagation(),this.XYToClient(t.clientX,t.clientY,{get:function(){return s},set:function(t){s=t}},{get:function(){return n},set:function(t){n=t}}),i=rtl.refSet(this.GetMouseEventShiftState(t)),this.MouseMove(rtl.refSet(i),pas.System.Trunc(s),pas.System.Trunc(n)),!0,this.FElementEvent=null,!0},this.HandleDoMouseLeave=function(t){var e=!1;return this.Captured()?e:(t.stopPropagation(),this.DoMouseLeave(),e=!0)},this.HandleDoContextMenu=function(t){return!0,!0},this.LayerHandleDoMouseEnter=function(t){return 0===t.buttons&&this.Captured()&&!this.FMouseInsideLayer&&(this.ReleaseCapture(),this.HandleDoMouseUp(t),this.HandleDoMouseLeave(t)),this.FMouseInsideLayer=!0,!0,!0},this.LayerHandleDoMouseLeave=function(t){return this.FMouseInsideLayer=!1,!0,!0},this.HandleDoMouseEnter=function(t){var e=!1;return this.Captured()?e:(t.stopPropagation(),this.DoMouseEnter(),e=!0)},this.HandleDoKeyDown=function(t){var e=0,i={};return this.FElementEvent=t,6 in this.FEventStopPropagation&&this.StopPropagation(),null==t.key||(e=this.GetKeyCode(t.key,!0),i=rtl.refSet(this.GetKeyBoardEventShiftState(t)),this.KeyDown({get:function(){return e},set:function(t){e=t}},rtl.refSet(i))),!0,0===e&&this.PreventDefault(),this.FElementEvent=null,!0},this.HandleDoKeyUp=function(t){var e=0,i={},s="";return this.FElementEvent=t,7 in this.FEventStopPropagation&&this.StopPropagation(),null==t.key||(e=this.GetKeyCode(t.key,!0),i=rtl.refSet(this.GetKeyBoardEventShiftState(t)),27===e&&(s="",this.KeyPress({get:function(){return s},set:function(t){s=t}})),this.KeyUp({get:function(){return e},set:function(t){e=t}},rtl.refSet(i))),!0,0===e&&this.PreventDefault(),this.FElementEvent=null,!0},this.HandleDoKeyPress=function(t){var e="";return this.FElementEvent=t,5 in this.FEventStopPropagation&&this.StopPropagation(),this.IsKeyCharacter(t.key)&&(e=this.GetKeyChar(t.key),this.KeyPress({get:function(){return e},set:function(t){e=t}})),!0,"\0"===e&&this.PreventDefault(),this.FElementEvent=null,!0},this.HandleDoInput=function(e){var i=!1,s="",n="";return t.IsAndroid()&&(this.FElementEvent=e,5 in this.FEventStopPropagation&&this.StopPropagation(),s="\0",""!==e.data&&(n=e.data,s=pas.System.Assigned(n)?n.charAt(n.length-1):"\b",this.KeyPress({get:function(){return s},set:function(t){s=t}})),i=!0,"\0"===s&&this.PreventDefault(),this.FElementEvent=null),i},this.HandleDoExit=function(t){return this.DoExit(),!0,!0},this.HandleDoEnter=function(t){return this.FElementEvent=t,this.StopPropagation(),this.DoEnter(),!0,this.FElementEvent=null,this.FGotFocus=!0,!0},this.HandleDoTouchStart=function(t){var e=0,i=0,s=null,n={};return this.FElementEvent=t,this.FLastElementEvent=t,this.StopPropagation(),this.FAllowTouch||this.PreventDefault(),t.touches.length>0&&(s=t.touches.item(0),this.XYToClient(s.clientX,s.clientY,{get:function(){return e},set:function(t){e=t}},{get:function(){return i},set:function(t){i=t}}),n=rtl.refSet(this.GetTouchEventShiftState(t)),this.FLinkTouchEvents&&this.MouseDown(0,rtl.refSet(n),pas.System.Trunc(e),pas.System.Trunc(i)),this.TouchStart(pas.System.Trunc(e),pas.System.Trunc(i))),!0,this.FElementEvent=null,!0},this.HandleDoTouchMove=function(t){var e=0,i=0,s=null,n={};return this.FElementEvent=t,this.FLastElementEvent=t,this.StopPropagation(),this.FAllowTouch||this.PreventDefault(),this.Captured()&&this.PreventDefault(),t.touches.length>0&&(s=t.touches.item(0),this.XYToClient(s.clientX,s.clientY,{get:function(){return e},set:function(t){e=t}},{get:function(){return i},set:function(t){i=t}}),n=rtl.refSet(this.GetTouchEventShiftState(t)),this.FLinkTouchEvents&&this.MouseMove(rtl.refSet(n),pas.System.Trunc(e),pas.System.Trunc(i)),this.TouchMove(pas.System.Trunc(e),pas.System.Trunc(i))),this.FElementEvent=null,!0,!0},this.HandleDoTouchEnd=function(t){var e=0,i=0,s=null,n={};return this.FElementEvent=t,this.FAllowTouch||this.PreventDefault(),this.ReleaseCapture(),this.StopPropagation(),null!=this.FLastElementEvent&&this.FLastElementEvent.touches.length>0&&(s=this.FLastElementEvent.touches.item(0),this.XYToClient(s.clientX,s.clientY,{get:function(){return e},set:function(t){e=t}},{get:function(){return i},set:function(t){i=t}}),n=rtl.refSet(this.GetTouchEventShiftState(t)),this.FLinkTouchEvents&&this.MouseUp(0,rtl.refSet(n),pas.System.Trunc(e),pas.System.Trunc(i)),this.TouchEnd(pas.System.Trunc(e),pas.System.Trunc(i))),this.FElementEvent=null,!0,!0},this.HandleDoTouchCancel=function(t){var e=0,i=0,s=null,n={};return this.FElementEvent=t,this.ReleaseCapture(),this.StopPropagation(),t.touches.length>0&&(s=t.touches.item(0),this.XYToClient(s.clientX,s.clientY,{get:function(){return e},set:function(t){e=t}},{get:function(){return i},set:function(t){i=t}}),n=rtl.refSet(this.GetTouchEventShiftState(t)),this.FLinkTouchEvents&&this.MouseUp(0,rtl.refSet(n),pas.System.Trunc(e),pas.System.Trunc(i)),this.TouchCancel(pas.System.Trunc(e),pas.System.Trunc(i))),this.FElementEvent=null,!0,!0},this.HandleDoDragStart=function(t){var i=null;return this.FElementEvent=t,t.stopPropagation(),i=null,this.DoStartDrag({get:function(){return i},set:function(t){i=t}}),e.DragObject=null!=i?i:this,!0,!0},this.HandleDoDragOver=function(t){var i;return this.FElementEvent=t,t.stopPropagation(),this.DragOver(e.DragObject,t.clientX,t.clientY,2,{p:this,get:function(){return this.p.FAcceptDrag},set:function(t){this.p.FAcceptDrag=t}}),!this.FAcceptDrag||this.IsInputControl()&&0!==t.dataTransfer.items.length||t.preventDefault(),i=!this.FAcceptDrag,this.FElementEvent=null,i},this.HandleDoDragEnter=function(t){var i;return this.FElementEvent=t,t.stopPropagation(),this.FAcceptDrag=this.IsInputControl(),this.DragOver(e.DragObject,t.clientX,t.clientY,0,{p:this,get:function(){return this.p.FAcceptDrag},set:function(t){this.p.FAcceptDrag=t}}),this.FAcceptDrag&&t.preventDefault(),i=!this.FAcceptDrag,this.FElementEvent=null,i},this.HandledoDragLeave=function(t){return this.FElementEvent=t,t.stopPropagation(),this.DragOver(e.DragObject,t.clientX,t.clientY,1,{p:this,get:function(){return this.p.FAcceptDrag},set:function(t){this.p.FAcceptDrag=t}}),!0,this.FElementEvent=null,!0},this.HandleDoDragEnd=function(t){return this.FElementEvent=t,t.stopPropagation(),this.DoEndDrag(e.DragObject,t.clientX,t.clientY),!0,0===this.FDragMode&&this.DisableDrag(),this.FElementEvent=null,!0},this.HandleDoDragDrop=function(t){var i;return this.FElementEvent=t,t.stopPropagation(),this.FAcceptDrag?(this.IsInputControl()||t.preventDefault(),this.DragDrop(e.DragObject,t.clientX,t.clientY)):t.preventDefault(),i=this.FAcceptDrag,this.FElementEvent=null,i},this.HandleFontChanged=function(t){0===this.FUpdateCount&&(this.SetParentFont(!1),this.ParentFontChanged()),this.FontChanged()},this.ParentFontChanged=function(){for(var t=0,e=0,i=this.GetControlsCount()-1;e<=i;e++)t=e,this.GetControls(t).FParentFont&&(this.GetControls(t).FFont.Assign(this.FFont),this.GetControls(t).FontChanged(),this.GetControls(t).FParentFont=!0,this.GetControls(t).ParentFontChanged())},this.DoExit=function(){null!=this.FOnExit&&this.FOnExit(this)},this.DoEnter=function(){null!=this.FOnEnter&&this.FOnEnter(this)},this.Click=function(){null!=this.FOnClick&&this.IsEnabled()&&this.FOnClick(this)},this.UpdateElement=function(){this.FBlockUpdateElement||this.FUpdateCount>0||null==this.GetElementHandle()||this.GetElementHandle()===this.ContainerElement()||this.IsUpdating()||(this.UpdateElementData(),this.GetIsLinked()||this.UpdateElementVisual())},this.UpdateElementSize=function(){var t=null,e=0,i=0,s=0,n=null,r=null;if(!(this.FBlockUpdateElement||this.FUpdateCount>0||this.GetIsLinked()||null==this.GetElementHandle()||this.GetElementHandle()===this.ContainerElement())){for(t=this.GetElementStyle(),e=0,i=0,n=this.FParent;null!=n&&0===this.FElementPosition&&0!==n.FElementPosition&&!pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(n);){if(n.GetIsLinked()&&null!=n.GetElementHandle()&&"absolute"!==n.GetElementHandle().getAttribute("position")){r=n.GetElementHandle().getBoundingClientRect(),e=Math.round(r.left),i=Math.round(r.top);break}n=n.FParent}null!=this.FParent&&this.FParent.IsStructuralElement()&&(e=this.FParent.GetLeft(),i=this.FParent.GetTop()),0===this.FElementPosition?(-1!==this.FTop?t.setProperty("top",pas.SysUtils.IntToStr(this.FTop+i)+"px"):t.setProperty("top",""),-1!==this.FLeft?t.setProperty("left",pas.SysUtils.IntToStr(this.FLeft+e)+"px"):t.setProperty("left","")):(t.removeProperty("top"),t.removeProperty("left")),1===this.FWidthStyle&&(s=this.GetOuterWidth(),-1!==this.FWidth?t.setProperty("width",pas.SysUtils.IntToStr(s)+"px"):t.removeProperty("width")),2===this.FWidthStyle&&t.removeProperty("width"),1===this.FHeightStyle&&(-1!==this.FHeight?t.setProperty("height",pas.SysUtils.IntToStr(this.GetOuterHeight())+"px"):t.removeProperty("height")),2===this.FHeightStyle&&t.removeProperty("height"),0===this.FWidthStyle&&(-1!==this.FWidth?t.setProperty("width",pas["WEBLib.Utils"].FormatProp("%.2f%%",pas.System.VarRecs(3,this.FWidthPercent))):t.removeProperty("width")),0===this.FHeightStyle&&(-1!==this.FHeight?t.setProperty("height",pas["WEBLib.Utils"].FormatProp("%.2f%%",pas.System.VarRecs(3,this.FHeightPercent))):t.removeProperty("height")),0===this.FElementPosition?t.setProperty("position","absolute"):1===this.FElementPosition?t.setProperty("position","relative"):t.removeProperty("position"),t.setProperty("box-sizing","border-box")}},this.UpdateElementVisual=function(){var e,i,s=null;if(null!=(e=this.GetElementHandle())&&!this.IsUpdating()){s=this.GetElementStyle(),this.FParentFont&&null!=this.FParent&&(this.FFont.FOnChange=null,this.FFont.Assign(this.FParent.FFont),this.FFont.FOnChange=rtl.createCallback(this,"HandleFontChanged")),""===this.FElementClassName&&(this.GetIsLinked()||(this.FClipChildren&&pas.SysUtils.LowerCase(e.tagName)!==pas["WEBLib.WebTools"].cBodyTag?s.setProperty("overflow","hidden"):s.setProperty("overflow","")),this.SetElementPointer(e,this.FCursor)),this.Captured()&&this.FLayer.style.setProperty("cursor",s.getPropertyValue("cursor")),""!==this.FElementClassName||this.CanShowFocus()?s.setProperty("outline",""):s.setProperty("outline","none"),this.UpdateElementSize();var n=this.FTextDirection;0===n?s.removeProperty("direction"):2===n?s.setProperty("direction","rtl"):1===n?s.setProperty("direction","ltr"):3===n&&s.setProperty("direction","inherit"),""===this.FElementClassName&&this.FNoUserSelect&&(s.setProperty("webkit-user-select","none"),s.setProperty("moz-user-select","none"),s.setProperty("khtml-user-select","none"),s.setProperty("ms-user-select","none"),s.setProperty("user-select","none"),s.setProperty("-webkit-tap-highlight-color","transparent")),this.SetElementColor(e,this.FColor),i=this.UseCSSFont(),t.SetHTMLElementFont(e,this.FFont,i),i?s.removeProperty("color"):this.IsEnabled()&&this.UseCSSFontColor()&&s.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor))}},this.UpdateElementData=function(){var t=null,e=null,i="",s="",n="",r=0,o=0;if(null!=this.GetElementHandle()){if(4 in this.FComponentState||(this.FVisible?this.GetElementStyle().setProperty("display",""):this.GetElementStyle().setProperty("display","none")),this.EnableTab(),this.IsEnabled()?this.FContainer.removeAttribute("disabled"):this.FContainer.setAttribute("disabled",""),this.GetIsLinked()&&""===this.FHint)return;if(""!==this.GetRole()&&this.FContainer.setAttribute("role",this.FRole),null!=(t=pas["WEBLib.Forms"].GetParentForm(this))&&1===t.FCSSLibrary&&this.FShowHint&&""!==this.FHint){e=this.GetElementHandle(),i=this.FHint;var l=pas["WEBLib.Forms"].Application.FHintPosition;0===l?n="left":2===l?n="right":1===l?n="top":3===l&&(n="bottom"),s=pas["WEBLib.Forms"].Application.FHintClassName,r=pas["WEBLib.Forms"].Application.FHintPause,o=pas["WEBLib.Forms"].Application.FHintHidePause,this.FTooltip=new bootstrap.Tooltip(e,{title:i,placement:n,customClass:s,delay:{show:r,hide:o}})}else this.FShowHint&&""!==this.FHint?this.FContainer.setAttribute("title",this.FHint):this.FContainer.removeAttribute("title");this.IsEnabled()&&1!==this.FElementFont?1!==this.FElementFont&&this.UseCSSFontColor()&&this.GetElementStyle().setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor)):this.GetElementStyle().removeProperty("color")}},this.UpdateParent=function(){this.InternalUpdateParent(),this.UpdateChildren(this.FPrevParent),this.UpdateChildren(this.FParent)},this.UpdateControlSize=function(t,e){this.FWidth=t,this.FHeight=e},this.InternalUpdateParent=function(){var t=null;t=this.FPrevParent,this.FNew&&(this.CreateControl(),null!=this.GetContainer()&&(null!=this.FParent&&null==this.FParent.GetContainer()&&this.FParent.CreateControl(),this.FParent!==t&&null!=t&&null!=t.GetContainer()&&this.GetContainer().parentNode===t.GetChildContainer()&&t.GetChildContainer().removeChild(this.GetContainer()),null!=this.FParent&&null!=this.FParent.GetContainer()&&this.FParent.GetChildContainer().appendChild(this.GetContainer())))},this.UpdateChildren=function(e){var i=0,s=null;if(null!=e&&!(3 in this.FComponentState)){0!==e.FAlign&&e.DoRealign(),t.TCustomControl.isPrototypeOf(e)&&(rtl.as(e,t.TCustomControl).RecreateCanvas(),rtl.as(e,t.TCustomControl).Invalidate());for(var n=0,r=e.GetControlsCount()-1;n<=r;n++)i=n,s=e.GetControls(i),this.UpdateChildren(s)}},this.DisableTab=function(){var t=0;this.FTabStop&&this.CanFocus()||null!=this.GetContainer()&&this.GetContainer().setAttribute("tabindex","-1");for(var e=0,i=this.GetControlsCount()-1;e<=i;e++)t=e,this.GetControls(t).DisableTab()},this.EnableTab=function(){var t=0;null==this.FContainer||this.GetIsLinked()||(this.FTabStop&&this.CanFocus()?this.FContainer.setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder+1)):this.FContainer.setAttribute("tabindex","-1"));for(var e=0,i=this.GetControlsCount()-1;e<=i;e++)t=e,this.GetControls(t).EnableTab()},this.SetElementClassName=function(t){this.FElementClassName!==t&&(this.FElementClassName=t,null!=this.FContainer&&this.FContainer.setAttribute("class",t),this.UpdateElement())},this.SetColor=function(t){this.FColor=t,this.UpdateElementVisual(),this.ColorChanging()},this.SetFont=function(t){this.FFont.SetName(t.FName),this.FFont.SetSize(t.FSize),this.FFont.SetStyle(rtl.refSet(t.FStyle)),this.FFont.SetColor(t.FColor)},this.SetParent=function(t){var e;null!=t&&(t=t.CanAcceptChild(this)),e=this.FNew,this.FParent!==t&&(null!=this.FParent&&this.FParent.UnRegisterParent(this),this.FPrevParent=this.FParent,this.FParent=t,this.FGotFocus=!1,this.UpdateParent(),3 in this.FComponentState||(e||this.UpdateElement(),this.InitScript()),null!=this.FParent&&this.FParent.RegisterParent(this),0 in this.FComponentState&&null!=this.FParent&&!(0 in this.FParent.FComponentState)&&this.Loaded(),null==t||null==this.FParent||this.FParent.IsUpdating()||this.Realign(),3 in this.FComponentState||this.Invalidate())},this.RegisterParent=function(t){this.FControls=rtl.arraySetLength(this.FControls,null,rtl.length(this.FControls)+1),this.FControls[rtl.length(this.FControls)-1]=t},this.UnRegisterParent=function(t){var e=0,i=!1;i=!1;for(var s=0,n=rtl.length(this.FControls)-1;s<=n;s++)e=s,this.FControls[e]===t&&(i=!0),i&&e<rtl.length(this.FControls)-1&&(this.FControls[e]=this.FControls[e+1]);i&&(this.FControls=rtl.arraySetLength(this.FControls,null,rtl.length(this.FControls)-1))},this.CanAcceptChild=function(t){return this,this},this.SetLeft=function(t){this.FLeft!==t&&(this.FLeft=t,this.ResetAnchoring(),this.FUpdateTopLeft||(this.FOrigLeft=t),this.UpdateElementSize(),this.RecreateCanvas(),this.InternalResize(),0 in this.FComponentState||0===this.FAlign||null==this.FParent||this.DoRealign())},this.SetTop=function(t){this.FTop!==t&&(this.FTop=t,this.ResetAnchoring(),this.FUpdateTopLeft||(this.FOrigTop=t),this.UpdateElementSize(),this.RecreateCanvas(),this.InternalResize(),0 in this.FComponentState||0===this.FAlign||null==this.FParent||this.DoRealign())},this.MouseUp=function(t,e,i,s){this.FEnabled&&null!=this.FOnMouseUp&&this.FOnMouseUp(this,t,rtl.refSet(e),i,s)},this.MouseDown=function(t,e,i,s){this.FEnabled&&null!=this.FOnMouseDown&&this.FOnMouseDown(this,t,rtl.refSet(e),i,s)},this.MouseMove=function(t,e,i){this.FEnabled&&null!=this.FOnMouseMove&&this.FOnMouseMove(this,rtl.refSet(t),e,i)},this.TouchStart=function(t,e){null!=this.FOnTouchStart&&this.FOnTouchStart(this,t,e)},this.TouchMove=function(t,e){null!=this.FOnTouchMove&&this.FOnTouchMove(this,t,e)},this.TouchEnd=function(t,e){null!=this.FOnTouchEnd&&this.FOnTouchEnd(this,t,e)},this.TouchCancel=function(t,e){null!=this.FOnTouchCancel&&this.FOnTouchCancel(this,t,e)},this.DoMouseEnter=function(){null!=this.FOnMouseEnter&&this.FOnMouseEnter(this)},this.DoMouseLeave=function(){null!=this.FOnMouseLeave&&this.FOnMouseLeave(this)},this.MouseWheel=function(t,e,i){var s=!1;for(null!=this.FOnMouseWheel&&this.FOnMouseWheel(this,rtl.refSet(t),e,pas.Types.TPoint.$clone(pas.Types.Point(0,0)),i),this.FWheelAccumulator+=e;Math.abs(this.FWheelAccumulator)>=120;)s=this.FWheelAccumulator<0,this.FWheelAccumulator=Math.abs(this.FWheelAccumulator)-120,s?(0!==this.FWheelAccumulator&&(this.FWheelAccumulator=-this.FWheelAccumulator),this.DoMouseWheelDown(rtl.refSet(t),pas.Types.TPoint.$clone(this.FWheelMousePos))):this.DoMouseWheelUp(rtl.refSet(t),pas.Types.TPoint.$clone(this.FWheelMousePos))},this.DoMouseWheelDown=function(t,e){var i=!1;return i=!1,null!=this.FOnMouseWheelDown&&this.FOnMouseWheelDown(this,rtl.refSet(t),pas.Types.TPoint.$clone(e),{get:function(){return i},set:function(t){i=t}}),i},this.DoMouseWheelUp=function(t,e){var i=!1;return i=!1,null!=this.FOnMouseWheelUp&&this.FOnMouseWheelUp(this,rtl.refSet(t),pas.Types.TPoint.$clone(e),{get:function(){return i},set:function(t){i=t}}),i},this.DblClick=function(){null!=this.FOnDblClick&&this.FOnDblClick(this)},this.KeyDown=function(t,e){null!=this.FOnKeyDown&&this.FOnKeyDown(this,t,rtl.refSet(e))},this.KeyPress=function(t){null!=this.FOnKeyPress&&this.FOnKeyPress(this,t)},this.KeyUp=function(t,e){null!=this.FOnKeyUp&&this.FOnKeyUp(this,t,rtl.refSet(e))},this.SetFocus=function(){var t=null;this.CanFocus()&&null!=this.GetElementHandle()&&(t=this.GetElementHandle(),this.FGotFocus?t.focus():setTimeout((function(){t.focus()}),1))},this.DoMarginsChanged=function(t){this.DoRealign()},this.DoRealign=function(){null==this.FParent||this.FParent.IsUpdating()||this.FParent.AlignControl(this.FParent)},this.DoBoundsChange=function(){var t,e=!1;this.UpdateElementSize(),this.RecreateCanvas(),this.FIsResizing||(this.FIsResizing=!0,this.InternalResize(),this.DoRealign(),e=!1,null!=(t=pas["WEBLib.Forms"].GetParentForm(this))&&(e=(e=t.FIsResizing$1)||t.FUpdateCount>0),(e=(e=e||this.FUpdateCount>0)||this.FIsAligning)||this.UpdateChildAnchoring(),this.FIsResizing=!1)},this.DoEndDrag=function(t,e,i){null!=this.FonEndDrag&&this.FonEndDrag(this,t,e,i)},this.DoStartDrag=function(t){null!=this.FOnStartDrag&&this.FOnStartDrag(this,t)},this.DragOver=function(t,e,i,s,n){null!=this.FOnDragOver&&this.FOnDragOver(this,t,e,i,s,n)},this.Focused=function(){return this.FContainer===document.activeElement},this.GetID=function(){return this.FID},this.GetElementHandle=function(){var t=null;return t=null,null!=this.FContainer&&this.FControlCreated&&(t=this.FContainer),t},this.GetElementBindHandle=function(){return this.GetElementHandle()},this.GetKeyCode=function(t,e){var i=0;i=-1;var s=t;return"Up"===s?i=38:"Down"===s?i=40:"Left"===s?i=37:"Right"===s?i=39:"!"===s?i=56:'"'===s||"#"===s?i=51:"$"===s?i=186:"%"===s?i=192:"'"===s?i=52:"("===s?i=53:")"===s?i=219:"*"===s?i=106:"+"===s?i=107:"-"===s?i=109:","===s?i=44:"."===s?i=46:"/"===s?i=111:"\\"===s?i=226:"="===s?i=187:"<"===s||">"===s?i=226:s===pas.Web.TJSKeyNames.BackSpace?i=8:s===pas.Web.TJSKeyNames.Tab?i=9:s===pas.Web.TJSKeyNames.Enter?i=13:s===pas.Web.TJSKeyNames.Shift?i=16:s===pas.Web.TJSKeyNames.Control?i=17:s===pas.Web.TJSKeyNames.Alt?i=18:s===pas.Web.TJSKeyNames.Pause?i=19:s===pas.Web.TJSKeyNames.CapsLock?i=20:s===pas.Web.TJSKeyNames.Escape?i=27:s===pas.Web.TJSKeyNames.PageUp?i=33:s===pas.Web.TJSKeyNames.PageDown?i=34:s===pas.Web.TJSKeyNames._End?i=35:s===pas.Web.TJSKeyNames.Home?i=36:s===pas.Web.TJSKeyNames.ArrowLeft?i=37:s===pas.Web.TJSKeyNames.ArrowUp?i=38:s===pas.Web.TJSKeyNames.ArrowRight?i=39:s===pas.Web.TJSKeyNames.ArrowDown?i=40:s===pas.Web.TJSKeyNames.Insert?i=45:s===pas.Web.TJSKeyNames.Delete?i=46:s===pas.Web.TJSKeyNames.F1?i=112:s===pas.Web.TJSKeyNames.F2?i=113:s===pas.Web.TJSKeyNames.F3?i=114:s===pas.Web.TJSKeyNames.F4?i=115:s===pas.Web.TJSKeyNames.F5?i=116:s===pas.Web.TJSKeyNames.F6?i=117:s===pas.Web.TJSKeyNames.F7?i=118:s===pas.Web.TJSKeyNames.F8?i=119:s===pas.Web.TJSKeyNames.F9?i=120:s===pas.Web.TJSKeyNames.F10?i=121:s===pas.Web.TJSKeyNames.F11?i=122:s===pas.Web.TJSKeyNames.F12?i=123:s===pas.Web.TJSKeyNames.F13?i=124:s===pas.Web.TJSKeyNames.F14?i=125:s===pas.Web.TJSKeyNames.F15?i=126:s===pas.Web.TJSKeyNames.F16?i=127:s===pas.Web.TJSKeyNames.F17?i=128:s===pas.Web.TJSKeyNames.F18?i=129:s===pas.Web.TJSKeyNames.F19?i=130:s===pas.Web.TJSKeyNames.F20?i=131:pas.System.Assigned(t)&&t.length>0&&(i=t.charCodeAt(0),e&&i>=97&&i<=122?i&=223:i>=65&&i<=90?i|=64:i>122&&(i|=128)),i},this.GetKeyChar=function(t){var e="",i=0;i=-1,e="\0";var s=t;return s===pas.Web.TJSKeyNames.BackSpace?i=8:s===pas.Web.TJSKeyNames.Tab?i=9:s===pas.Web.TJSKeyNames.Enter?i=13:s===pas.Web.TJSKeyNames.Shift?i=16:s===pas.Web.TJSKeyNames.Control?i=17:s===pas.Web.TJSKeyNames.Alt?i=18:s===pas.Web.TJSKeyNames.Pause?i=19:s===pas.Web.TJSKeyNames.CapsLock?i=20:s===pas.Web.TJSKeyNames.Escape?i=27:s===pas.Web.TJSKeyNames.PageUp?i=33:s===pas.Web.TJSKeyNames.PageDown?i=34:s===pas.Web.TJSKeyNames._End?i=35:s===pas.Web.TJSKeyNames.Home?i=36:s===pas.Web.TJSKeyNames.ArrowLeft?i=37:s===pas.Web.TJSKeyNames.ArrowUp?i=38:s===pas.Web.TJSKeyNames.ArrowRight?i=39:s===pas.Web.TJSKeyNames.ArrowDown?i=40:s===pas.Web.TJSKeyNames.Insert?i=45:s===pas.Web.TJSKeyNames.Delete?i=46:s===pas.Web.TJSKeyNames.F1?i=112:s===pas.Web.TJSKeyNames.F2?i=113:s===pas.Web.TJSKeyNames.F3?i=114:s===pas.Web.TJSKeyNames.F4?i=115:s===pas.Web.TJSKeyNames.F5?i=116:s===pas.Web.TJSKeyNames.F6?i=117:s===pas.Web.TJSKeyNames.F7?i=118:s===pas.Web.TJSKeyNames.F8?i=119:s===pas.Web.TJSKeyNames.F9?i=120:s===pas.Web.TJSKeyNames.F10?i=121:s===pas.Web.TJSKeyNames.F11?i=122:s===pas.Web.TJSKeyNames.F12?i=123:s===pas.Web.TJSKeyNames.F13?i=124:s===pas.Web.TJSKeyNames.F14?i=125:s===pas.Web.TJSKeyNames.F15?i=126:s===pas.Web.TJSKeyNames.F16?i=127:s===pas.Web.TJSKeyNames.F17?i=128:s===pas.Web.TJSKeyNames.F18?i=129:s===pas.Web.TJSKeyNames.F19?i=130:s===pas.Web.TJSKeyNames.F20?i=131:e=t.charAt(0),-1!==i&&(e=String.fromCharCode(i)),e},this.IsKeyCharacter=function(t){var e=t;return"Up"!==e&&"Down"!==e&&"Left"!==e&&"Right"!==e&&e!==pas.Web.TJSKeyNames.Shift&&e!==pas.Web.TJSKeyNames.Control&&e!==pas.Web.TJSKeyNames.Alt&&e!==pas.Web.TJSKeyNames.Pause&&e!==pas.Web.TJSKeyNames.CapsLock&&e!==pas.Web.TJSKeyNames.PageUp&&e!==pas.Web.TJSKeyNames.PageDown&&e!==pas.Web.TJSKeyNames._End&&e!==pas.Web.TJSKeyNames.Home&&e!==pas.Web.TJSKeyNames.ArrowLeft&&e!==pas.Web.TJSKeyNames.ArrowUp&&e!==pas.Web.TJSKeyNames.ArrowRight&&e!==pas.Web.TJSKeyNames.ArrowDown&&e!==pas.Web.TJSKeyNames.Insert&&e!==pas.Web.TJSKeyNames.Delete&&e!==pas.Web.TJSKeyNames.F1&&e!==pas.Web.TJSKeyNames.F2&&e!==pas.Web.TJSKeyNames.F3&&e!==pas.Web.TJSKeyNames.F4&&e!==pas.Web.TJSKeyNames.F5&&e!==pas.Web.TJSKeyNames.F6&&e!==pas.Web.TJSKeyNames.F7&&e!==pas.Web.TJSKeyNames.F8&&e!==pas.Web.TJSKeyNames.F9&&e!==pas.Web.TJSKeyNames.F10&&e!==pas.Web.TJSKeyNames.F11&&e!==pas.Web.TJSKeyNames.F12&&e!==pas.Web.TJSKeyNames.F13&&e!==pas.Web.TJSKeyNames.F14&&e!==pas.Web.TJSKeyNames.F15&&e!==pas.Web.TJSKeyNames.F16&&e!==pas.Web.TJSKeyNames.F17&&e!==pas.Web.TJSKeyNames.F18&&e!==pas.Web.TJSKeyNames.F19&&e!==pas.Web.TJSKeyNames.F20},this.GetClientRect=function(){var t=pas.Types.TRect.$new(),e="",i=0,s=0;return e=pas.SysUtils.UpperCase(this.GetStyle("border-width")),s=0,(i=pas.System.Pos("PX",e))>0&&(pas.System.Delete({get:function(){return e},set:function(t){e=t}},i,2),pas.System.val$6(e,{get:function(){return s},set:function(t){s=t}},{get:function(){return i},set:function(t){i=t}})),t.$assign(pas.Types.Rect(0,0,this.GetWidth()-2*s,this.GetHeight()-2*s)),t},this.CreateControl=function(){null==this.FElement&&(this.FElement=this.CreateElement(),null!=this.FElement&&(this.FControlCreated=!0,this.FContainer=this.FElement,"body"!==this.GetID()&&this.GetContainer().setAttribute("id",this.GetID()),this.GetContainer().setAttribute("zindex","0"),""!==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(){null===this.FWheelPtr&&(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.BindEvents=function(){var t=null,e=null;null!=this.GetElementBindHandle()&&(this.GetMethodPointers(),this.FEventsBound=!0,t=this.GetElementBindHandle(),e=this.FWheelPtr,t.addEventListener("wheel",e,{passive:!0}),t.addEventListener("click",this.FClickPtr),t.addEventListener("dblclick",this.FDblClickPtr),t.addEventListener("mousedown",this.FMouseDownPtr),t.addEventListener("mouseup",this.FMouseUpPtr),t.addEventListener("mousemove",this.FMouseMovePtr),t.addEventListener("mouseleave",this.FMouseLeavePtr),t.addEventListener("mouseenter",this.FMouseEnterPtr),t.addEventListener("keydown",this.FKeyDownPtr),t.addEventListener("keyup",this.FKeyUpPtr),t.addEventListener("keypress",this.FKeyPressPtr),t.addEventListener("input",this.FInputPtr),t.addEventListener("focus",this.FEnterPtr),t.addEventListener("blur",this.FExitPtr),e=this.FTouchStartPtr,t.addEventListener("touchstart",e,{passive:!0}),e=this.FTouchMovePtr,t.addEventListener("touchmove",e,{passive:!0}),t.addEventListener("touchend",this.FTouchEndPtr),t.addEventListener("touchcancel",this.FTouchCancelPtr),t.addEventListener("contextmenu",this.FContextMenuPtr),t.addEventListener("dragstart",this.FDragStartPtr),t.addEventListener("dragover",this.FDragOverPtr),t.addEventListener("dragenter",this.FDragEnterPtr),t.addEventListener("dragleave",this.FDragLeavePtr),t.addEventListener("dragend",this.FDragEndPtr),t.addEventListener("drop",this.FDragDropPtr))},this.UnbindEvents=function(){var t=null;this.ReleaseCapture(),null!=this.GetElementBindHandle()&&((t=this.GetElementBindHandle()).removeEventListener("wheel",this.FWheelPtr),t.removeEventListener("click",this.FClickPtr),t.removeEventListener("dblclick",this.FDblClickPtr),t.removeEventListener("mousedown",this.FMouseDownPtr),t.removeEventListener("mouseup",this.FMouseUpPtr),t.removeEventListener("mousemove",this.FMouseMovePtr),t.removeEventListener("mouseleave",this.FMouseLeavePtr),t.removeEventListener("mouseenter",this.FMouseEnterPtr),t.removeEventListener("keydown",this.FKeyDownPtr),t.removeEventListener("keyup",this.FKeyUpPtr),t.removeEventListener("keypress",this.FKeyPressPtr),t.removeEventListener("focus",this.FEnterPtr),t.removeEventListener("blur",this.FExitPtr),t.removeEventListener("input",this.FInputPtr),t.removeEventListener("touchstart",this.FTouchStartPtr),t.removeEventListener("touchmove",this.FTouchMovePtr),t.removeEventListener("touchend",this.FTouchEndPtr),t.removeEventListener("touchcancel",this.FTouchEndPtr),t.removeEventListener("contextmenu",this.FContextMenuPtr))},this.AlignControls=function(t,e){var i=this,s=0;function n(t,s){var n=0,r=0,o=0,l=0;t.AnchoringInitialized()||i.InitAnchoring(),t.FUpdateTopLeft=!0,t.FAlignWithMargins?(n=t.FMargins.FLeft,r=t.FMargins.FTop,l=t.FMargins.FBottom,o=t.FMargins.FRight):(n=0,r=0,l=0,o=0);var a=s;1===a?(t.SetBoundsInt(e.Left+n,e.Top+r,e.Right-e.Left-n-o,t.GetHeight()),e.Top=e.Top+t.GetHeight()+r+l):2===a?(t.SetBoundsInt(e.Left+n,e.Bottom-t.GetHeight()-l-1,e.Right-e.Left-n-o-1,t.GetHeight()),e.Bottom=e.Bottom-t.GetHeight()-r-l):3===a?(t.SetBoundsInt(e.Left+n,e.Top+r,t.GetWidth(),e.Bottom-e.Top-r-l),e.Left=e.Left+t.GetWidth()+n+o):4===a?(t.SetBoundsInt(e.Right-t.GetWidth()-o,e.Top+r,t.GetWidth(),e.Bottom-e.Top-l-r),e.Right=e.Right-t.GetWidth()-o-n):5===a&&t.SetBoundsInt(e.Left+n,e.Top+r,e.Right-e.Left-n-o,e.Bottom-e.Top-l-r),t.FUpdateTopLeft=!1}function r(t){var e=0,s=0,r=0,o=null;o=pas.Classes.TList.$create("Create$1");for(var l=0,a=i.GetControlsCount()-1;l<=a;l++)if(e=l,i.GetControls(e).FAlign===t&&(i.GetControls(e).FVisible||4 in i.FComponentState)){r=o.GetCount();for(var h=o.GetCount()-1;h>=0;h--){s=h;var u=t;1===u?i.GetControls(e).FOrigTop<rtl.getObject(o.Get(s)).FOrigTop&&(r=s):3===u?i.GetControls(e).FOrigLeft<rtl.getObject(o.Get(s)).FOrigLeft&&(r=s):4===u?i.GetControls(e).FOrigLeft+i.GetControls(e).GetWidth()>rtl.getObject(o.Get(s)).FOrigLeft+rtl.getObject(o.Get(s)).GetWidth()&&(r=s):2===u&&i.GetControls(e).FOrigTop+i.GetControls(e).GetHeight()>rtl.getObject(o.Get(s)).FOrigTop+rtl.getObject(o.Get(s)).GetHeight()&&(r=s)}o.Insert(r,i.GetControls(e))}for(var d=0,c=o.GetCount()-1;d<=c;d++)e=d,n(rtl.getObject(o.Get(e)),t);o=rtl.freeLoc(o)}r(1),r(2),r(3),r(4),r(5),r(6);for(var o=0,l=this.GetControlsCount()-1;o<=l;o++)s=o,this.GetControls(s).AlignControl(this.GetControls(s))},this.AlignControl=function(t){var e,i=pas.Types.TRect.$new(),s=null,n="",r="",o="",l=null,a=null,h=0,u=0;this.FIsAligning||this.IsUpdating()||0 in this.FComponentState||(null==this.FParent||this.FParent.FVisible)&&(null!=(a=pas["WEBLib.Forms"].GetParentForm(this))&&a.IsUpdating()||(h=0,null!=a&&""!==a.FFormContainer&&pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(t)&&null!=(l=document.getElementById(a.FFormContainer))&&(s=l.getBoundingClientRect(),h=Math.round(s.top+1)),this.FIsAligning=!0,null!=t&&(null!=(e=t.GetElementHandle())&&(n=t.GetElementStyle().getPropertyValue("overflow"),r=t.GetElementStyle().getPropertyValue("overflow-x"),o=t.GetElementStyle().getPropertyValue("overflow-y"),this.FClipChildren&&pas.SysUtils.LowerCase(e.tagName)!==pas["WEBLib.WebTools"].cBodyTag?t.GetElementStyle().setProperty("overflow","hidden"):t.GetElementStyle().setProperty("overflow","")),i.$assign(this.GetClientRect()),i.Bottom=i.Bottom-h,this.GetIsLinked()&&(s=this.GetElementHandle().getBoundingClientRect(),i.$assign(pas.Types.Rect(0,0,Math.round(s.right-s.left),Math.round(s.bottom-s.top)))),i.Bottom+h>pas["WEBLib.Forms"].WinHeight()&&1!==this.FHeightStyle&&0!==this.FElementPosition&&!this.GetIsLinked()&&null==pas["WEBLib.Forms"].VSIDE&&(null!=this.FParent&&pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this.FParent)||pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this))&&(i.Bottom=pas["WEBLib.Forms"].WinHeight()-h),null!=e&&"BODY"===e.tagName&&(u=0,document.body.scrollHeight>document.body.clientHeight&&!(4 in this.FComponentState)&&(u=16),""!==a.FFormContainer?(i.Bottom=Math.round(Math.min(i.Bottom,pas["WEBLib.Forms"].WinHeight())),i.Right=Math.round(Math.min(i.Right-u,pas["WEBLib.Forms"].WinWidth()))):(i.Bottom=a.GetHeight(),i.Right=a.GetWidth())),pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(t)&&null==pas["WEBLib.Forms"].VSIDE&&(i.Bottom>pas["WEBLib.Forms"].WinHeight()&&(i.Bottom=pas["WEBLib.Forms"].WinHeight()),i.Right>pas["WEBLib.Forms"].WinWidth()&&(i.Right=pas["WEBLib.Forms"].WinWidth())),t.IsStructuralElement()&&i.$assign(this.FParent.GetClientRect()),this.AlignControls(t,i),null!=e&&(t.GetElementStyle().setProperty("overflow",n),t.GetElementStyle().setProperty("overflow-x",r),t.GetElementStyle().setProperty("overflow-y",o)),this.FIsAligning=!1)))},this.InitAnchoring=function(){var t=0,e=0,i=0;function s(e,i,s){var n;i.set(0),s.set(0),null!=(n=pas.TypInfo.GetPropInfo(e.$class.ClassInfo(),"BorderStyle"))&&((t=pas.TypInfo.GetOrdProp$1(e,n))in rtl.createSet(1,4,5)&&(i.set(4),s.set(4)),t in rtl.createSet(2,3)&&(i.set(16),s.set(16)))}if(!this.AnchoringInitialized()){e=0,i=0,pas["WEBLib.Forms"].TForm.isPrototypeOf(this)?(rtl.as(this,pas["WEBLib.Forms"].TForm).IsMiletus()&&s(this,{get:function(){return e},set:function(t){e=t}},{get:function(){return i},set:function(t){i=t}}),this.FOrigRect.$assign(pas.Types.Rect(0,0,this.GetDesignWidth()-e,this.GetDesignHeight()-i))):this.FOrigRect.$assign(pas.Types.Rect(this.GetDesignLeft(),this.GetDesignTop(),this.GetDesignLeft()+this.GetDesignWidth(),this.GetDesignTop()+this.GetDesignHeight())),null!=this.FParent&&(pas["WEBLib.Forms"].TForm.isPrototypeOf(this.FParent)?(rtl.as(this.FParent,pas["WEBLib.Forms"].TForm).IsMiletus()&&s(this.FParent,{get:function(){return e},set:function(t){e=t}},{get:function(){return i},set:function(t){i=t}}),this.FOrigParentRect.$assign(pas.Types.Rect(0,0,this.FParent.GetDesignWidth()-e,this.FParent.GetDesignHeight()-i))):(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 n=0,r=this.GetControlsCount()-1;n<=r;n++)t=n,this.GetControls(t).InitAnchoring()}},this.AnchoringInitialized=function(){return-1!==this.FOrigRect.Left||-1!==this.FOrigRect.Top},this.InitScript=function(){},this.Realign=function(){this.AlignControl(this)},this.Loaded=function(){var t=0;if(0 in this.FComponentState){pas.Classes.TComponent.Loaded.call(this);for(var e=0,i=this.GetControlsCount()-1;e<=i;e++)t=e,this.GetControls(t).FElementPosition in rtl.createSet(1,2)&&!this.GetControls(t).GetIsLinked()&&this.GetControls(t).FChildOrder>=0&&this.GetControls(t).FChildOrder<this.GetChildContainer().childNodes.length&&this.GetChildContainer().insertBefore(this.GetControls(t).GetContainer(),this.GetChildContainer().childNodes.item(this.GetControls(t).FChildOrder)),this.GetControls(t).Loaded();for(var s=0,n=this.GetComponentCount()-1;s<=n;s++)t=s,0 in this.GetComponent(t).FComponentState&&this.GetComponent(t).Loaded();5===this.FAlign&&null!=this.FParent&&this.SetBoundsInt(0,0,this.FParent.FWidth,this.FParent.FHeight),this.Resize(),this.UpdateElement()}},this.InternalResize=function(){0 in this.FComponentState||this.Resize()},this.FontChanged=function(){this.UpdateElementVisual()},this.SetElementColor=function(e,i){var s;s=!(pas["WEBLib.Forms"].Application.FThemed||""!==this.FElementClassName),this.GetIsLinked()||t.SetHTMLElementColor(e,i,!s)},this.MoveElements=function(t,e){if(t&&e)for(;t.childNodes.length;)e.appendChild(t.firstChild)},this.MoveElementsAndFree=function(t,e){if(t&&e){for(;t.childNodes.length;)e.appendChild(t.firstChild);t.remove()}},this.CreateWithID=function(e){var i;this.ClearMethodPointers(),this.FUpdateCount=0,this.FControlCreated=!1,this.FLinkTouchEvents=!0,this.FIsResizing=!1,(null!=this.FOwner&&0 in this.FOwner.FComponentState||null==this.FOwner)&&(null!=this.FOwner&&4 in this.FOwner.FComponentState||this.Loading()),this.FElementPosition=0,this.FWidthStyle=1,this.FHeightStyle=1,i=document.getElementById(e),this.FNew=!(null!=i),this.FFont=pas["WEBLib.Graphics"].TFont.$create("Create$1"),this.FFont.FOnChange=rtl.createCallback(this,"HandleFontChanged"),this.FNew?this.FContainer=null:(this.FContainer=i,this.FControlCreated=!0,this.FElementPosition=1,this.CreateChildElements(i),this.BindElement(),this.BindEvents()),this.FID=e,this.FEnabled=!0,this.FVisible=!0,this.FLeft=0,this.FTop=0,this.FAlign=0,this.FAlignWithMargins=!1,this.FIsAligning=!1,this.FParentFont=!0,this.FParentBiDiMode=!0,this.FParentColor=!1,this.FAnchors=rtl.createSet(0,1),this.FShowFocus=!1,this.FBorderWidth=0,this.FEnablePropagation=!1,this.FToolTip=null,this.FColor=16711422,this.FMargins=t.TMargins.$create("Create$1"),this.FMargins.FOnChange=rtl.createCallback(this,"DoMarginsChanged"),this.FParent=null,this.FPrevParent=null,0 in this.FControlStyle||this.ClearControls(),this.CreateInitialize()},this.AddInstanceStyle$1=function(t,e){var i,s,n;i=t,s=e,(n=document.getElementById(i))?n.innerHTML=s:((n=document.createElement("style")).type="text/css",n.id=i,n.innerHTML=s,document.getElementsByTagName("head")[0].appendChild(n))},this.AddControlLink=function(t,e){var i,s,n;i=t,s=e,(n=document.getElementById(i))||((n=document.createElement("link")).id=i,n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("href",s),document.getElementsByTagName("head")[0].appendChild(n))},this.AddControlScriptSource=function(t){var e,i=null;e=this.$classname+"SRC",null==document.getElementById(e)&&((i=document.createElement("script")).id=e,i.innerHTML=t,i.type="text/javascript",document.head.appendChild(i))},this.ResetAnchoring=function(){this.FOrigRect.$assign(pas.Types.Rect(-1,-1,-1,-1)),this.InitAnchoring()},this.UpdateSize=function(){var t=0;this.UpdateElementSize();for(var e=0,i=this.GetControlsCount()-1;e<=i;e++)t=e,this.GetControls(t).UpdateSize()},this.UpdateAnchoring=function(){var t=0,e=0,i=0,s=0,n=0,r=0,o=pas.Types.TRect.$new(),l=pas.Types.TRect.$new();0 in this.FComponentState||this.FControlCreated&&(-1===this.FOrigRect.Left&&-1===this.FOrigRect.Top&&this.InitAnchoring(),(null==this.FParent||this.FParent.AnchoringInitialized())&&(5!==this.FAlign&&(null==this.FParent||pas["WEBLib.Forms"].TForm.isPrototypeOf(this)||(l.$assign(this.FParent.GetBoundsRect()),t=l.Right-l.Left-(this.FOrigParentRect.Right-this.FOrigParentRect.Left),e=l.Bottom-l.Top-(this.FOrigParentRect.Bottom-this.FOrigParentRect.Top),o.$assign(this.FOrigRect),i=0,s=0,n=0,r=0,2 in this.FAnchors&&(0 in this.FAnchors?n=t:i=t),3 in this.FAnchors&&(1 in this.FAnchors?r=e:s=e),(3 in this.FAnchors||2 in this.FAnchors)&&this.SetBoundsInt(o.Left+i,o.Top+s,o.Right-o.Left+n,o.Bottom-o.Top+r))),this.UpdateChildAnchoring()))},this.UpdateChildAnchoring=function(){for(var t=0,e=0,i=this.GetControlsCount()-1;e<=i;e++)t=e,this.GetControls(t).UpdateAnchoring()},this.SetElementPointer=function(e,i){0!==i?e.style.setProperty("cursor",t.GetHTMLCursorName(i)):e.style.removeProperty("cursor")},this.IsUpdating=function(){return this.FUpdateCount>0},this.CanShowFocus=function(){return this.FShowFocus},this.RequiredScriptLoaded=function(t){rtl.asExt(t.target,HTMLScriptElement).title="tmswebloaded",this.FControlScriptCountLoaded+=1},this.GetStyle=function(t){var e,i="",s="";return s="",null==(e=this.GetElementHandle())?i:(window.getComputedStyle&&(s=getComputedStyle(e,"")[t]),e.currentStyle&&(s=e.currentStyle[t]),i=s)},this.SetBoundsInt=function(t,e,i,s){(t!==this.GetLeft()||e!==this.GetTop()||i!==this.GetWidth()&&1===this.FWidthStyle||s!==this.GetHeight()&&1===this.FHeightStyle||null!=this.FParent&&this.FParent.GetIsLinked())&&(this.FBlockUpdateElement=!0,this.FLeft=t,this.FTop=e,this.FWidth=i,this.FHeight=s,this.FBlockUpdateElement=!1,this.UpdateElementSize(),0!==this.FAlign?this.DoRealign():this.Realign(),this.RecreateCanvas(),this.DoBoundsChange(),this.Invalidate(),this.UpdateChildAnchoring())},this.EnableDrag=function(){null!=this.GetContainer()&&this.GetContainer().setAttribute("draggable","true")},this.DisableDrag=function(){null!=this.GetContainer()&&"true"===this.GetContainer().getAttribute("draggable")&&this.GetContainer().setAttribute("draggable","false")},this.Create$2=function(t){return this.FGotFocus=!1,this.FTabStop=!0,this.FAllowTouch=!0,this.CreateWithID(t),this},this.Create$1=function(t){var e,i,s=!1;return this.FGotFocus=!1,this.FEventsBound=!1,this.FTabStop=!0,this.FAllowTouch=!0,this.FNoUserSelect=!0,this.ClearMethodPointers(),pas.Classes.TComponent.Create$1.call(this,t),this.FEventStopPropagation=rtl.createSet(0,4,2,3,1,5,6,7),this.FScriptLoaded=!1,this.FElementFont=0,this.FElementPosition=0,this.FParentElement=null,this.FTextDirection=0,s=!1,null!=(i=pas["WEBLib.Forms"].GetParentForm(this))&&(s=4 in i.FComponentState),e=this.GetNewName(),s?this.CreateWithID(""):this.CreateWithID(e),null==t||4 in t.FComponentState||this.SetName(e),this},this.Destroy=function(){this.UnbindEvents(),this.DestroyControls(),null!=this.GetContainer()&&null!=this.FParent&&null!=this.FParent.GetChildContainer()&&(this.FParent.GetChildContainer()===this.GetContainer().parentNode&&this.FParent.GetChildContainer().removeChild(this.GetContainer()),this.FContainer=null,this.SetParent(null),this.FControlCreated=!1),rtl.free(this,"FRequiredScripts"),rtl.free(this,"FMargins"),rtl.free(this,"FFont"),pas.System.Assigned(this.FToolTip)&&(FToolTip.dispose(),this.FToolTip=null),pas.Classes.TComponent.Destroy.call(this)},this.Assign=function(t){},this.DragDrop=function(t,e,i){null!=this.FOnDragDrop&&this.FOnDragDrop(this,t,e,i)},this.Resize=function(){null!=this.FOnResize&&this.FOnResize(this)},this.ReleaseCapture=function(){var t=null;this.FCaptureDown=!1,this.FCaptured&&null!=this.FLayer&&((t=this.FLayer).removeEventListener("mouseenter",this.FLayerMouseEnterPtr),t.removeEventListener("mouseleave",this.FLayerMouseLeavePtr),t.removeEventListener("mousedown",this.FMouseDownPtr),t.removeEventListener("mouseup",this.FMouseUpPtr),t.removeEventListener("mousemove",this.FMouseMovePtr),t.removeEventListener("touchstart",this.FTouchStartPtr),t.removeEventListener("touchmove",this.FTouchMovePtr),t.removeEventListener("touchend",this.FTouchEndPtr),t.removeEventListener("touchcancel",this.FTouchEndPtr),document.body.removeChild(t),this.FCaptured=!1,this.FLayer=null,this.UpdateElement())},this.PreventDefault=function(){null!=this.GetElementEvent()&&this.GetElementEvent().preventDefault()},this.StopPropagation=function(){null==this.GetElementEvent()||this.FEnablePropagation||this.GetElementEvent().stopPropagation()},this.BeginDrag=function(){this.EnableDrag()},this.BeginUpdate=function(){this.FUpdateCount+=1},this.EndUpdate=function(){this.FUpdateCount>0&&(this.FUpdateCount-=1,0===this.FUpdateCount&&this.UpdateElement())},this.Invalidate=function(){},this.SetParentComponent=function(e){this.FParent!==e&&t.TControl.isPrototypeOf(e)&&this.SetParent(e)},this.XYToClient=function(t,e,i,s){var n=null,r=null,o=null,l=0,a=0,h=!1,u=!1,d=pas.Types.TRect.$new(),c=null,F=0,p=0,C=0,m=0;if(h=!0,u=!1,C=0,m=0,0!==this.FElementPosition)return h=!1,l=t-(r=this.GetElementHandle().getBoundingClientRect()).left,a=e-r.top,i.set(l),void s.set(a);for(C=document.body.scrollLeft+document.documentElement.scrollLeft,m=document.body.scrollTop+document.documentElement.scrollTop,l=t-this.GetLeft(),a=e-this.GetTop(),i.set(l),s.set(a),n=this.FParent,pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this)&&null==n&&null!=this.GetContainer()&&(r=this.GetContainer().getBoundingClientRect(),i.set(i.get()-r.left),s.set(s.get()-r.top));null!=n;){if(n.GetIsLinked())r=pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(n)?n.GetContainer().getBoundingClientRect():n.GetElementHandle().getBoundingClientRect(),i.set(i.get()-r.left),s.set(s.get()-r.top),C=0,m=0;else if(pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(n))""!==rtl.as(n,pas["WEBLib.Forms"].TCustomForm).FFormContainer&&null!=(o=document.getElementById(rtl.as(n,pas["WEBLib.Forms"].TCustomForm).FFormContainer))&&(u=!0,r=o.getBoundingClientRect(),i.set(i.get()-r.left),s.set(s.get()-r.top)),null!=rtl.as(n,pas["WEBLib.Forms"].TCustomForm).GetContainer()&&""===rtl.as(n,pas["WEBLib.Forms"].TCustomForm).FFormContainer&&rtl.as(n,pas["WEBLib.Forms"].TCustomForm).FPopup&&(r=rtl.as(n,pas["WEBLib.Forms"].TCustomForm).GetContainer().getBoundingClientRect(),i.set(i.get()-r.left),s.set(s.get()-r.top),d.$assign(rtl.as(n,pas["WEBLib.Forms"].TCustomForm).GetClientRect()),s.set(s.get()+d.Top),C=0,m=0);else if(n.FElementPosition in rtl.createSet(1,2)){if(null!=n.GetElementHandle()){r=n.GetElementHandle().getBoundingClientRect(),i.set(l-r.left),s.set(a-r.top),C=0,m=0,h&&(c=window.getComputedStyle(document.documentElement),F=parseInt(c.marginLeft,10),p=parseInt(c.marginTop,10),i.set(i.get()+F),s.set(s.get()+p)),h=!1;break}}else 0===n.FElementPosition&&h&&(i.set(i.get()-n.GetLeft()),s.set(s.get()-n.GetTop()),null!=n.GetElementHandle()&&(i.set(i.get()+n.GetElementHandle().scrollLeft),s.set(s.get()+n.GetElementHandle().scrollTop)),l=i.get(),a=s.get());n=n.FParent}0!==this.FElementPosition||u||(i.set(i.get()+C),s.set(s.get()+m))},this.Captured=function(){return this.FCaptured&&null!=this.FLayer},this.CanFocus=function(){return!0,!0},this.HasHorzScrollBar=function(){var t=!1;return t=!1,null!=this.GetElementHandle()&&(t=this.GetElementHandle().clientWidth<this.GetElementHandle().scrollWidth),t},this.HasVertScrollBar=function(){var t=!1;return t=!1,null!=this.GetElementHandle()&&(t=this.GetElementHandle().clientHeight<this.GetElementHandle().scrollHeight),t}})),rtl.createClass(this,"TWinControl",this.TControl,(function(){var e=this.$rtti;e.addProperty("Cursor",2,t.$rtti.TCursor,"FCursor","SetControlCursor",{Default:0}),e.addProperty("ElementClassName",2,t.$rtti.TElementClassName,"FElementClassName","SetElementClassName"),e.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),e.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight"),e.addProperty("Hint",2,rtl.string,"FHint","SetHint"),e.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft"),e.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",{Default:!1}),e.addProperty("Tag",0,rtl.longint,"FTag$1","FTag$1",{Default:0}),e.addProperty("Top",3,rtl.longint,"GetTop","SetTop"),e.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),e.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth"),e.addProperty("OnMouseDown",0,t.$rtti.TMouseEvent,"FOnMouseDown","FOnMouseDown"),e.addProperty("OnMouseUp",0,t.$rtti.TMouseEvent,"FOnMouseUp","FOnMouseUp"),e.addProperty("OnMouseMove",0,t.$rtti.TMouseMoveEvent,"FOnMouseMove","FOnMouseMove"),e.addProperty("OnMouseEnter",0,t.$rtti.TNotifyEvent,"FOnMouseEnter","FOnMouseEnter"),e.addProperty("OnMouseLeave",0,t.$rtti.TNotifyEvent,"FOnMouseLeave","FOnMouseLeave"),e.addProperty("OnKeyUp",0,t.$rtti.TKeyEvent,"FOnKeyUp","FOnKeyUp"),e.addProperty("OnKeyDown",0,t.$rtti.TKeyEvent,"FOnKeyDown","FOnKeyDown"),e.addProperty("OnKeyPress",0,t.$rtti.TKeyPressEvent,"FOnKeyPress","FOnKeyPress"),e.addProperty("OnEnter",0,t.$rtti.TNotifyEvent,"FOnEnter","FOnEnter"),e.addProperty("OnExit",0,t.$rtti.TNotifyEvent,"FOnExit","FOnExit")})),rtl.createClass(this,"TCustomControl",this.TWinControl,(function(){this.$init=function(){t.TWinControl.$init.call(this),this.FCaption="",this.FPixelRatio=0,this.FPainting=!1,this.FCanvas=null,this.FElementCanvas=null,this.FBorderStyle=0,this.FBorderColor=0,this.FCustomBorder=!1},this.$final=function(){this.FCanvas=void 0,this.FElementCanvas=void 0,t.TWinControl.$final.call(this)},this.GetPixelRatio=function(){var t=document.createElement("canvas").getContext("2d");return(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)},this.RecreateCanvas=function(){var t=0,e=null,i=0,s=0;null!=this.FElementCanvas&&(this.FPainting||(null!=(e=this.GetIsLinked()?this.GetElementHandle():document.getElementById(this.GetID()+"_Canvas"))&&(this.FElementCanvas=e,rtl.free(this,"FCanvas"),this.FCanvas=null),t=this.GetPixelRatio(),i=this.GetHeight()-this.GetCanvasHeightOffset(),s=this.GetWidth()-this.GetCanvasWidthOffset(),1===this.FElementPosition?this.FElementCanvas.style.setProperty("position","relative"):this.FElementCanvas.style.setProperty("position","absolute"),this.FElementCanvas.style.setProperty("height",pas.SysUtils.IntToStr(i)+"px"),this.FElementCanvas.style.setProperty("width",pas.SysUtils.IntToStr(s)+"px"),this.FElementCanvas.height=Math.round(i*t),this.FElementCanvas.width=Math.round(s*t)),null==this.FCanvas&&(this.FCanvas=pas["WEBLib.Graphics"].TCanvas.$create("Create$1",[this.FElementCanvas])),this.FCanvas.FApplyPixelRatio=!0,this.FCanvas.SetTransform(1,0,0,1,0,0))},this.SetBorderStyle=function(t){this.FBorderStyle!==t&&(this.FBorderStyle=t,this.UpdateElement())},this.SetBorderColor=function(t){this.FBorderColor!==t&&(this.FBorderColor=t,this.UpdateElement())},this.SetName=function(e){var i={},s="";if(s="",null!=pas["WEBLib.Forms"].VSIDE&&4 in this.FComponentState||pas["WEBLib.Forms"].TFrame.isPrototypeOf(this)&&(s="F"+t.FindUniqueName(this.FName)+"_"),pas.Classes.TComponent.SetName.call(this,s+e),1 in this.FControlStyle&&4 in this.FComponentState&&!(0 in this.FComponentState)){if(null!=this.FOwner&&0 in this.FOwner.FComponentState)return;i=rtl.refSet(this.FControlStyle),this.SetCaption(e),this.FControlStyle=rtl.refSet(i)}},this.SetCaption=function(t){this.FCaption=t,this.FControlStyle=rtl.diffSet(this.FControlStyle,rtl.createSet(1))},this.CreateControl=function(){t.TControl.CreateControl.call(this),this.RecreateCanvas()},this.Loaded=function(){t.TControl.Loaded.call(this),this.Invalidate()},this.UpdateElementVisual=function(){t.TControl.UpdateElementVisual.call(this),null!=this.GetElementHandle()&&(this.GetIsLinked()||""!==this.FElementClassName||(1===this.FBorderStyle?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))):this.GetElementStyle().setProperty("border-style",""):this.GetElementStyle().setProperty("border-style","none")),""!==this.FElementClassName&&(this.GetElementStyle().removeProperty("border-style"),this.GetElementStyle().removeProperty("border-width"),this.GetElementStyle().removeProperty("border-color")))},this.CreateElement=function(){var t=null;return this.FElementCanvas=document.createElement("CANVAS"),0 in this.FControlStyle?((t=document.createElement("SPAN")).appendChild(this.FElementCanvas),""!==this.GetID()&&this.FElementCanvas.setAttribute("id",this.GetID()+"_Canvas"),this.FElementCanvas.setAttribute("zindex","-1")):t=this.FElementCanvas,t},this.GetCanvasHeightOffset=function(){return 0,0},this.GetCanvasWidthOffset=function(){return 0,0},this.BindElement=function(){"CANVAS"===this.GetContainer().tagName||this.FControlCreated||(this.FElementCanvas=document.createElement("CANVAS"),this.GetContainer().appendChild(this.FElementCanvas))},this.BindEvents=function(){t.TControl.BindEvents.call(this)},this.Paint=function(){},this.CreateInitialize=function(){t.TControl.CreateInitialize.call(this),this.FControlStyle=rtl.unionSet(this.FControlStyle,rtl.createSet(1)),this.FBorderStyle=1,this.FBorderColor=12632256,this.FPainting=!1,this.FWidth=100,this.FHeight=25,this.FWidthPercent=100,this.FHeightPercent=100,this.FCustomBorder=!1},this.Destroy=function(){null!=this.FCanvas&&rtl.free(this,"FCanvas"),t.TControl.Destroy.call(this)},this.Resize=function(){t.TControl.Resize.call(this),this.Invalidate()},this.Invalidate=function(){var e=null;t.TControl.Invalidate.call(this),null===this.FParent||3 in this.FComponentState||this.FVisible&&(this.FUpdateCount>0||null!=(e=pas["WEBLib.Forms"].GetParentForm(this))&&e.IsUpdating()||(this.GetPixelRatio()!==this.FPixelRatio&&this.RecreateCanvas(),this.FPixelRatio=this.GetPixelRatio(),this.FPainting=!0,null!=this.FCanvas&&this.FCanvas.Clear(),this.Paint(),this.FPainting=!1))},this.SetFocus=function(){t.TControl.SetFocus.call(this)},this.Focused=function(){return t.TControl.Focused.call(this)},this.EndUpdate=function(){t.TControl.EndUpdate.call(this),0===this.FUpdateCount&&this.Invalidate()}})),rtl.createClass(this,"TCustomHTMLDiv",this.TCustomControl,(function(){this.CreateElement=function(){return document.createElement("DIV")}})),rtl.createClass(this,"TControlManager",pas.Classes.TComponent,(function(){this.$init=function(){pas.Classes.TComponent.$init.call(this),this.FInstanceCount=0},this.Create$1=function(t){return pas.Classes.TComponent.Create$1.apply(this,arguments),this.FInstanceCount=0,this},this.GetInstanceNumber=function(){return this.FInstanceCount+=1,this.FInstanceCount}})),this.FindUniqueName=function(t){return t+pas.SysUtils.IntToStr(e.ControlManager.GetInstanceNumber())},this.GetScrollBarHeight=function(){var t=0;if(0===(t=e.ScrollBH)){var i=document.createElement("div");i.style.visibility="hidden",i.style.height="100px",i.style.msOverflowStyle="scrollbar",document.body.appendChild(i);var s=i.offsetHeight;i.style.overflow="scroll";var n=document.createElement("div");n.style.height="100%",i.appendChild(n);var r=n.offsetHeight;i.parentNode.removeChild(i),t=s-r,t=0,e.ScrollBH=t}return t},this.GetScrollBarWidth=function(){var t=0;if(0===(t=e.ScrollBW)){var i=document.createElement("div");i.style.visibility="hidden",i.style.width="100px",i.style.msOverflowStyle="scrollbar",document.body.appendChild(i);var s=i.offsetWidth;i.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",i.appendChild(n);var r=n.offsetWidth;i.parentNode.removeChild(i),t=s-r,e.ScrollBW=t}return t},this.SetHTMLElementFont=function(t,e,i){var s="";i?(t.style.removeProperty("font-family"),t.style.removeProperty("font-style"),t.style.removeProperty("font-weight"),t.style.removeProperty("font-size"),t.style.removeProperty("text-decoration")):(t.style.setProperty("font-family",e.FName),t.style.setProperty("font-style","normal"),0 in e.FStyle?t.style.setProperty("font-weight","bold"):t.style.setProperty("font-weight",""),1 in e.FStyle&&t.style.setProperty("font-style","italic"),s="",3 in e.FStyle&&(s="underline"),2 in e.FStyle&&(""!==s&&(s+=" "),s+="line-through"),""!==s?t.style.setProperty("text-decoration",s):t.style.removeProperty("text-decoration"),t.style.setProperty("font-size",pas.SysUtils.IntToStr(e.FSize)+"pt"))},this.SetHTMLElementColor=function(t,i,s){s||-1===i||16711422===i?t.style.removeProperty(e.cStyleBkgColor):t.style.setProperty(e.cStyleBkgColor,pas["WEBLib.Graphics"].ColorToHTML(i))},this.GetHTMLCursorName=function(t){var e="";e="default";return 0===t?e="default":2===t?e="auto":1===t?e="none":3===t?e="crosshair":4===t?e="text":6===t?e="nesw-resize":7===t?e="ns-resize":8===t?e="nwse-resize":9===t?e="ew-resize":10===t?e="n-resize":11===t?e="wait":12===t?e="copy":13===t?e="no-drop":14===t?e="col-resize":15===t?e="row-resize":16===t?e="copy":17===t?e="progress":18===t?e="not-allowed":19===t?e="progress":20===t?e="help":21===t?e="pointer":22!==t&&5!==t||(e="move"),e},this.GetHTMLElementAbsoluteRect=function(t){var e=pas.Types.TRect.$new(),i="";function s(t){var e=0,i=0;return t=pas.SysUtils.StringReplace(t,"px","",rtl.createSet(0)),pas.System.val$6(t,{get:function(){return e},set:function(t){e=t}},{get:function(){return i},set:function(t){i=t}}),e}return i=t.style.getPropertyValue("left"),e.Left=s(i),i=t.style.getPropertyValue("top"),e.Top=s(i),i=t.style.getPropertyValue("width"),e.Right=e.Left+s(i),i=t.style.getPropertyValue("height"),e.Bottom=e.Top+s(i),e},this.IsAndroid=function(){var t;return t=navigator.userAgent,pas.System.Pos("Android",t)>0},this.GetMaterialClass=function(t){var e="";e="material-icons";return 1===t?e="material-icons-outlined":2===t?e="material-icons-two-tone":3===t?e="material-icons-round":4===t&&(e="material-icons-sharp"),e},t.$implcode=function(){e.ControlManager=null,e.FMouseX=0,e.FMouseY=0,e.FCursorX=0,e.FCursorY=0,e.ScrollBW=0,e.ScrollBH=0,e.DragObject=null,e.cStyleBkgColor="background-color"},t.$init=function(){e.ScrollBW=0,e.ScrollBH=0,e.DragObject=null,e.ControlManager=t.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 t=this;this.cBodyTag="body",this.cHTMLExt=".html",this.DoubleToHTML=function(t){return pas.SysUtils.Format$1("%g",pas.System.VarRecs(3,t),pas.SysUtils.TFormatSettings.Invariant())},this.MessageBeep=function(t){new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRwlVJ3/6jYDAmxaiDG3/6xjQQCCKkRb/6kg/wW+kSJ5//rLobkLSiKmqP/0ikJuDaSaSf/6JiLYLEYnW/+kXg1WRVJL/9EmQ1YZIsv/6Qzwy5qk7/+tEU0nkls3/zIUMPKNX/6yZLf+kFgAfgGyLFAUwY//uQZAUABcd5UiNPVXAAAApAAAAAE0VZQKw9ISAAACgAAAAAVQIygIElVrFkBS+Jhi+EAuu+lKAkYUEIsmEAEoMeDmCETMvfSHTGkF5RWH7kz/ESHWPAq/kcCRhqBtMdokPdM7vil7RG98A2sc7zO6ZvTdM7pmOUAZTnJW+NXxqmd41dqJ6mLTXxrPpnV8avaIf5SvL7pndPvPpndJR9Kuu8fePvuiuhorgWjp7Mf/PRjxcFCPDkW31srioCExivv9lcwKEaHsf/7ow2Fl1T/9RkXgEhYElAoCLFtMArxwivDJJ+bR1HTKJdlEoTELCIqgEwVGSQ+hIm0NbK8WXcTEI0UPoa2NbG4y2K00JEWbZavJXkYaqo9CRHS55FcZTjKEk3NKoCYUnSQ0rWxrZbFKbKIhOKPZe1cJKzZSaQrIyULHDZmV5K4xySsDRKWOruanGtjLJXFEmwaIbDLX0hIPBUQPVFVkQkDoUNfSoDgQGKPekoxeGzA4DUvnn4bxzcZrtJyipKfPNy5w+9lnXwgqsiyHNeSVpemw4bWb9psYeq//uQZBoABQt4yMVxYAIAAAkQoAAAHvYpL5m6AAgAACXDAAAAD59jblTirQe9upFsmZbpMudy7Lz1X1DYsxOOSWpfPqNX2WqktK0DMvuGwlbNj44TleLPQ+Gsfb+GOWOKJoIrWb3cIMeeON6lz2umTqMXV8Mj30yWPpjoSa9ujK8SyeJP5y5mOW1D6hvLepeveEAEDo0mgCRClOEgANv3B9a6fikgUSu/DmAMATrGx7nng5p5iimPNZsfQLYB2sDLIkzRKZOHGAaUyDcpFBSLG9MCQALgAIgQs2YunOszLSAyQYPVC2YdGGeHD2dTdJk1pAHGAWDjnkcLKFymS3RQZTInzySoBwMG0QueC3gMsCEYxUqlrcxK6k1LQQcsmyYeQPdC2YfuGPASCBkcVMQQqpVJshui1tkXQJQV0OXGAZMXSOEEBRirXbVRQW7ugq7IM7rPWSZyDlM3IuNEkxzCOJ0ny2ThNkyRai1b6ev//3dzNGzNb//4uAvHT5sURcZCFcuKLhOFs8mLAAEAt4UWAAIABAAAAAB4qbHo0tIjVkUU//uQZAwABfSFz3ZqQAAAAAngwAAAE1HjMp2qAAAAACZDgAAAD5UkTE1UgZEUExqYynN1qZvqIOREEFmBcJQkwdxiFtw0qEOkGYfRDifBui9MQg4QAHAqWtAWHoCxu1Yf4VfWLPIM2mHDFsbQEVGwyqQoQcwnfHeIkNt9YnkiaS1oizycqJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l//8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kGeFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZB4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=").play()},this.GetLocaleShortDateFormat=function(t){return pas.SysUtils.TFormatSettings.Create$1(t).ShortDateFormat},this.GetLocaleLongDayName=function(t,e){var i=new Date(2017,0,1);i.setDate(i.getDate()+t-1);var s="";return s=""==e?navigator.language:e,i.toLocaleDateString(s,{weekday:"long"})},this.GetLocaleShortDayName=function(t,e){var i=new Date(2017,0,1);i.setDate(i.getDate()+t-1);var s="";return s=""==e?navigator.language:e,i.toLocaleDateString(s,{weekday:"short"})},this.GetLocaleLongMonthName=function(t,e){var i=new Date(2017,t-1,1),s="";return s=""==e?navigator.language:e,i.toLocaleDateString(s,{month:"long"})},this.GetLocaleShortMonthName=function(t,e){var i=new Date(2017,t-1,1),s="";return s=""==e?navigator.language:e,i.toLocaleDateString(s,{month:"short"})},this.GetLocaleDecimalSeparator=function(t){var e=1.1,i="";return i=""==t?navigator.language:t,e=e.toLocaleString(i).substring(1,2)},this.GetBrowserLocale=function(){return navigator.language},this.ProcessAccelerator=function(t,e){var i,s=0,n="";for(i=t.length,e.set(""),n="",s=1;s<=i;)"&"===t.charAt(s-1)?(s+1<=i&&"&"!==t.charAt(s+1-1)?(n=n+"<u>"+t.charAt(s+1-1)+"</u>",e.set(t.charAt(s+1-1))):s+1<=i&&"&"===t.charAt(s+1-1)&&(n+="&"),s+=2):(n+=t.charAt(s-1),s+=1);return n},this.HexImageDecode=function(t){var e,i=0,s=0,n=null,r=0,o=0,l=0;e=rtl.trunc(t.length/2),s=0,(r=t.charCodeAt(0)-48)>=10&&(r-=7),(o=t.charCodeAt(1)-48)>=10&&(o-=7),l=1+(o+(r<<4)),(i=pas.System.Pos("4A5045474",t))>1&&i<10&&(l+=4),(i=pas.System.Pos("4269746D6",t))>1&&i<10&&(l+=4),n=new Uint8Array(e-l);for(var a=l+1,h=e;a<=h;a++)i=a,(r=t.charCodeAt(2*i-1-1)-48)>=10&&(r-=7),(o=t.charCodeAt(2*i-1)-48)>=10&&(o-=7),o+=r<<4,n[s]=o,s+=1;return n},this.HexImageDecodeAsBase64=function(e){var i;return i=t.HexImageDecode(e),e=btoa(new Uint8Array(i).reduce((function(t,e){return t+String.fromCharCode(e)}),""))},this.NumAttribute=function(t){var e;return e=pas.SysUtils.TDoubleHelper.ToString$3.call({get:function(){return t},set:function(e){t=e}}),pas.SysUtils.StringReplace(e,",",".",rtl.createSet(0))},this.HTMLToString=function(t){return t=pas.SysUtils.StringReplace(t,"<","<",rtl.createSet(0)),pas.SysUtils.StringReplace(t,">",">",rtl.createSet(0))},this.ElementVisible=function(e){var i=!1,s=null;for(i=!1,s=e;null!=s;)pas.SysUtils.LowerCase(s.tagName)===t.cBodyTag&&(i=!0),s=s.parentElement;if(!i)return i;for(;null!=e;){if("none"===e.style.getPropertyValue("display"))return i=!1;if(s=e.parentElement,!rtl.isExt(s,HTMLElement))return i;e=s}return i}}),["SysUtils","WEBLib.Utils"]),rtl.module("contnrs",["System","SysUtils","Classes"],(function(){"use strict";rtl.createClass(this,"TObjectList",pas.Classes.TList,(function(){this.$init=function(){pas.Classes.TList.$init.call(this),this.FFreeObjects=!1},this.Notify=function(t,e){var i=null;this.FFreeObjects&&2===e&&(i=rtl.getObject(t),i=rtl.freeLoc(i)),pas.Classes.TList.Notify.call(this,t,e)},this.Create$2=function(){return pas.Classes.TList.Create$1.call(this),this.FFreeObjects=!0,this}}))}),["JS"]),rtl.module("WEBLib.Graphics",["System","Classes","Types","Web","JS"],(function(){"use strict";var t=this,e=t.$impl;this.WEBDEFAULTFONT="Arial",this.clNone=-1,this.clBlack=0,this.clGray=8421504,this.clSilver=12632256,this.clWhite=16777215,this.clMedGray=10526880,this.clBtnFace=15790320,this.clWindowText=65793,this.clWindow=16711422,this.clHighlight=14120960,this.clHighlightText=197379,this.DEFAULT_CHARSET=1,this.$rtti.$inherited("TColor",rtl.nativeint,{}),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.$rtti.$inherited("TBinaryString",rtl.string,{}),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(t){this.FColor=t},this.Create$1=function(){return this.FColor=0,this.FWidth=1,this.FStyle=0,this.FMode=4,this},this.Assign=function(e){t.TPen.isPrototypeOf(e)?(this.FColor=rtl.as(e,t.TPen).FColor,this.FStyle=rtl.as(e,t.TPen).FStyle,this.FWidth=rtl.as(e,t.TPen).FWidth):pas.Classes.TPersistent.Assign.apply(this,arguments)};var e=this.$rtti;e.addProperty("Color",2,t.$rtti.TColor,"FColor","SetColor"),e.addProperty("Mode",0,t.$rtti.TPenMode,"FMode","FMode",{Default:t.TPenMode.pmCopy}),e.addProperty("Width",0,rtl.longint,"FWidth","FWidth",{Default:1}),e.addProperty("Style",0,t.$rtti.TPenStyle,"FStyle","FStyle",{Default:t.TPenStyle.psSolid})})),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=void 0,pas.Classes.TPersistent.$final.call(this)},this.Create$1=function(){return this.FColor=16777215,this.FStyle=0,this.FGradient=0,this.FGradientColors=pas.Classes.TList.$create("Create$1"),this},this.Destroy=function(){rtl.free(this,"FGradientColors"),pas.System.TObject.Destroy.call(this)},this.Assign=function(e){t.TBrush.isPrototypeOf(e)?(this.FColor=rtl.as(e,t.TBrush).FColor,this.FStyle=rtl.as(e,t.TBrush).FStyle):pas.Classes.TPersistent.Assign.apply(this,arguments)};var e=this.$rtti;e.addProperty("Gradient",0,t.$rtti.TBrushGradient,"FGradient","FGradient"),e.addProperty("Color",0,t.$rtti.TColor,"FColor","FColor"),e.addProperty("Style",0,t.$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.$final=function(){this.FStyle=void 0,this.FOnChange=void 0,pas.Classes.TPersistent.$final.call(this)},this.SetHeight=function(t){var e;e=72*-t/96,this.FSize=Math.round(e),this.FHeight!==t&&(this.FHeight=t,this.DoChange())},this.SetName=function(t){this.FName!==t&&(this.FName=t,this.DoChange())},this.SetSize=function(t){this.FSize!==t&&(this.FSize=t,this.DoChange())},this.SetColor=function(t){this.FColor!==t&&(this.FColor=t,this.DoChange())},this.SetStyle=function(t){rtl.neSet(this.FStyle,t)&&(this.FStyle=rtl.refSet(t),this.DoChange())},this.DoChange=function(){null!=this.FOnChange&&this.FOnChange(this)},this.Assign=function(e){t.TFont.isPrototypeOf(e)?(this.FName=rtl.as(e,t.TFont).FName,this.FColor=rtl.as(e,t.TFont).FColor,this.FSize=rtl.as(e,t.TFont).FSize,this.FStyle=rtl.refSet(rtl.as(e,t.TFont).FStyle),this.DoChange()):pas.Classes.TPersistent.Assign.apply(this,arguments)},this.Create$1=function(){return pas.System.TObject.Create.call(this),this.FName=t.WEBDEFAULTFONT,this.FSize=8,this.FHeight=-11,this.FStyle={},this.FColor=0,this};var e=this.$rtti;e.addProperty("Charset",0,t.$rtti.TFontCharset,"FCharset","FCharset"),e.addProperty("Name",2,rtl.string,"FName","SetName"),e.addProperty("Height",2,rtl.longint,"FHeight","SetHeight"),e.addProperty("Style",2,t.$rtti.TFontStyles,"FStyle","SetStyle"),e.addProperty("Color",2,t.$rtti.TColor,"FColor","SetColor"),e.addProperty("Size",2,rtl.longint,"FSize","SetSize")})),rtl.recNewT(this,"TMatrix",(function(){this.m11=0,this.m12=0,this.m13=0,this.m21=0,this.m22=0,this.m23=0,this.m31=0,this.m32=0,this.m33=0,this.$eq=function(t){return this.m11===t.m11&&this.m12===t.m12&&this.m13===t.m13&&this.m21===t.m21&&this.m22===t.m22&&this.m23===t.m23&&this.m31===t.m31&&this.m32===t.m32&&this.m33===t.m33},this.$assign=function(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}})),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=!1,this.FApplyPixelRatio=!1},this.$final=function(){this.FElementCanvas=void 0,this.FContext=void 0,this.FPen=void 0,this.FBrush=void 0,this.FFont=void 0,pas.System.TObject.$final.call(this)},this.Create$1=function(e){return this.FElementCanvas=e,this.FContext=e.getContext("2d"),this.FPen=t.TPen.$create("Create$1"),this.FBrush=t.TBrush.$create("Create$1"),this.FPathOpen=!1,this.FFont=t.TFont.$create("Create$1"),this.FApplyPixelRatio=!1,this},this.Destroy=function(){pas.System.TObject.Destroy.call(this)},this.SetTransform=function(i,s,n,r,o,l){var a=t.TMatrix.$new(),h=0;null!=this.FContext&&(a.$assign(e.MatrixIdentity()),a.m11=i,a.m12=s,a.m21=n,a.m22=r,a.m31=o,a.m32=l,this.FApplyPixelRatio&&(h=e.GetPixelRatio(this),a.$assign(e.MatrixMultiply(a,e.MatrixCreateScaling(h,h)))),this.FContext.setTransform(a.m11,a.m12,a.m21,a.m22,a.m31,a.m32))},this.Clear=function(){null!=this.FContext&&null!=this.FElementCanvas&&this.FContext.clearRect(0,0,this.FElementCanvas.width,this.FElementCanvas.height)}})),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.$final=function(){this.FOnChange=void 0,this.FOnDataChange=void 0,pas.Classes.TPersistent.$final.call(this)},this.SetData=function(t){this.FData!==t&&(this.FData=t,this.DataChanged())},this.GetData=function(){return this.FData},this.Changed=function(){null!=this.FOnChange&&this.FOnChange(this)},this.DataChanged=function(){null!=this.FOnDataChange&&this.FOnDataChange(this)},this.LoadFromFile=function(t){this.FFilename=t,this.Changed()},this.Assign=function(e){t.TURLPicture.isPrototypeOf(e)?(this.FFilename=rtl.as(e,t.TURLPicture).FFilename,this.Changed()):pas.Classes.TPersistent.Assign.apply(this,arguments)};var e=this.$rtti;e.addProperty("OnChange",0,pas.Classes.$rtti.TNotifyEvent,"FOnChange","FOnChange"),e.addProperty("Data",3,t.$rtti.TBinaryString,"GetData","SetData")})),this.ColorToRGB=function(t){return t},this.ColorToHex=function(t){var e="";for(e=t.toString(16);e.length<6;)e="0"+e;return pas.System.Copy(e,5,2)+pas.System.Copy(e,3,2)+pas.System.Copy(e,1,2)},this.ColorToHTML=function(e){return 0!=(4278190080&e)?"#"+t.ColorToHex(16777215&e)+pas.SysUtils.IntToHex(255&Math.floor((4278190080&e)/16777216),2):"#"+t.ColorToHex(e)},this.RGB=function(t,e,i){return t|e<<8|i<<16},this.CSSFont=function(t){var e="",i="";return e="font-family:"+t.FName+";",e+="font-style: normal;",0 in t.FStyle&&(e+="font-weight: bold;"),1 in t.FStyle&&(e+="font-style: italic;"),i="",3 in t.FStyle&&(i+=" underline"),2 in t.FStyle&&(i+=" line-through"),""!==i&&(e=e+"text-decoration:"+i+";"),e=e+"font-size:"+pas.SysUtils.IntToStr(t.FSize)+"pt;"},t.$implcode=function(){rtl.createClass(e,"TGraphicCacheList",pas.contnrs.TObjectList,(function(){})),e.FCache=null,e.FQueue=null,e.MatrixIdentity=function(){var e=t.TMatrix.$new();return e.m11=1,e.m12=0,e.m13=0,e.m21=0,e.m22=1,e.m23=0,e.m31=0,e.m32=0,e.m33=1,e},e.GetPixelRatio=function(t){var e=t.FContext;return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},e.MatrixCreateScaling=function(i,s){var n=t.TMatrix.$new();return n.$assign(e.MatrixIdentity()),n.m11=i,n.m22=s,n},e.MatrixMultiply=function(e,i){var s=t.TMatrix.$new();return s.m11=e.m11*i.m11+e.m12*i.m21+e.m13*i.m31,s.m12=e.m11*i.m12+e.m12*i.m22+e.m13*i.m32,s.m13=e.m11*i.m13+e.m12*i.m23+e.m13*i.m33,s.m21=e.m21*i.m11+e.m22*i.m21+e.m23*i.m31,s.m22=e.m21*i.m12+e.m22*i.m22+e.m23*i.m32,s.m23=e.m21*i.m13+e.m22*i.m23+e.m23*i.m33,s.m31=e.m31*i.m11+e.m32*i.m21+e.m33*i.m31,s.m32=e.m31*i.m12+e.m32*i.m22+e.m33*i.m32,s.m33=e.m31*i.m13+e.m32*i.m23+e.m33*i.m33,s}},t.$init=function(){e.FCache=e.TGraphicCacheList.$create("Create$2"),e.FQueue=pas.Classes.TStringList.$create("Create$1")}}),["WEBLib.Forms","WEBLib.WebTools","Math","SysUtils","contnrs"]),rtl.module("WEBLib.Lang",["System"],(function(){"use strict";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.GetLanguageISO639_1Code=function(t){var e="";return 0===t?e="":1===t?e="aa":2===t?e="ab":3===t?e="ae":4===t?e="af":5===t?e="ak":6===t?e="am":7===t?e="an":8===t?e="ar":9===t?e="as":10===t?e="av":11===t?e="ay":12===t?e="az":13===t?e="ba":14===t?e="be":15===t?e="bg":16===t?e="bh":17===t?e="bi":18===t?e="bm":19===t?e="bn":20===t?e="bo":21===t?e="br":22===t?e="bd":23===t?e="ca":24===t?e="ce":25===t?e="ch":26===t?e="co":27===t?e="cr":28===t?e="cs":29===t?e="cu":30===t?e="cv":31===t?e="cy":32===t?e="da":33===t?e="de":34===t?e="dv":35===t?e="dz":36===t?e="ee":37===t?e="en":38===t?e="eo":39===t?e="es":40===t?e="et":41===t?e="eu":42===t?e="fa":43===t?e="ff":44===t?e="fi":45===t?e="fj":46===t?e="fo":47===t?e="fr":48===t?e="fy":49===t?e="ga":50===t?e="gd":51===t?e="gl":52===t?e="gn":53===t?e="gu":54===t?e="gv":55===t?e="ha":56===t?e="he":57===t?e="hi":58===t?e="ho":59===t?e="hr":60===t?e="ht":61===t?e="hu":62===t?e="hy":63===t?e="hz":64===t?e="ia":65===t?e="id":66===t?e="ie":67===t?e="ig":68===t?e="ii":69===t?e="ik":70===t?e="id":71===t?e="is":72===t?e="it":73===t?e="iu":74===t?e="ja":75===t?e="jv":76===t?e="ka":77===t?e="kg":78===t?e="ki":79===t?e="kj":80===t?e="kk":81===t?e="kl":82===t?e="km":83===t?e="kn":84===t?e="ko":85===t?e="kr":86===t?e="ks":87===t?e="ku":88===t?e="kv":89===t?e="kw":90===t?e="ky":91===t?e="la":92===t?e="lb":93===t?e="lg":94===t?e="li":95===t?e="ln":96===t?e="lo":97===t?e="lt":98===t?e="lu":99===t?e="lv":100===t?e="mg":101===t?e="mh":102===t?e="mi":103===t?e="mk":104===t?e="ml":105===t?e="mn":106===t?e="mr":107===t?e="ms":108===t?e="mt":109===t?e="my":110===t?e="na":111===t?e="nb":112===t?e="nd":113===t?e="ng":114===t?e="nl":115===t?e="no":116===t?e="nv":117===t?e="ny":118===t?e="oc":119===t?e="oj":120===t?e="om":121===t?e="or":122===t?e="os":123===t?e="pa":124===t?e="pi":125===t?e="pl":126===t?e="ps":127===t?e="pt":128===t?e="qu":129===t?e="rm":130===t?e="rn":131===t?e="ro":132===t?e="ru":133===t?e="rw":134===t?e="sa":135===t?e="sc":136===t?e="sd":137===t?e="se":138===t?e="sg":139===t?e="si":140===t?e="sk":141===t?e="sl":142===t?e="sm":143===t?e="sn":144===t?e="so":145===t?e="sq":146===t?e="sr":147===t?e="ss":148===t?e="st":149===t?e="su":150===t?e="sv":151===t?e="sw":152===t?e="ta":153===t?e="te":154===t?e="tg":155===t?e="th":156===t?e="ti":157===t?e="tk":158===t?e="tl":159===t?e="tn":160===t?e="to":161===t?e="tr":162===t?e="ts":163===t?e="tt":164===t?e="tw":165===t?e="ty":166===t?e="ug":167===t?e="uk":168===t?e="ur":169===t?e="uz":170===t?e="ve":171===t?e="vi":172===t?e="wa":173===t?e="wo":174===t?e="xh":175===t?e="yi":176===t?e="yo":177===t?e="za":178===t?e="zh":179===t&&(e="zu"),e}})),rtl.module("WEBLib.Menus",["System","Classes","SysUtils","WEBLib.Controls","WEBLib.Graphics","Web"],(function(){"use strict";var t=this,e=t.$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(t){return rtl.getObject(this.Get(t))}})),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.FOnClick=null,this.FChecked=!1,this.FEnabled=!1,this.FDefault=!1,this.FAutoCheck=!1,this.FHint="",this.FAutoHotkeys=0,this.FRadioItem=!1,this.FGroupIndex=0,this.FVisible=!1,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=void 0,this.FItems=void 0,this.FParentItem=void 0,this.FOnClick=void 0,this.FParentMenu=void 0,pas.Classes.TComponent.$final.call(this)},this.SetChecked=function(e){var i=null,s=null,n=null,r=null,o=0;if(this.FChecked!==e){if(this.FChecked=e,null!=(r=this.FParentMenu)){if(t.TMenuItem.isPrototypeOf(r)&&e)for(var l=0,a=(s=r).FItems.GetCount()-1;l<=a;l++)o=l,(n=s.FItems.GetItem(o)).FRadioItem&&n!==this&&n.SetChecked(!1);for(;!t.TCustomMainMenu.isPrototypeOf(r)&&null!=r;)r=r.FOwner}null!=(i=this.GetParentMenu())&&i.UpdateElement()}},this.SetCaption=function(t){var e=null;this.FCaption=t,null!=(e=this.GetParentMenu())&&e.UpdateElement()},this.SetImageIndex=function(t){var e=null;this.FImageIndex=t,null!=(e=this.GetParentMenu())&&e.UpdateElement()},this.SetEnabled=function(t){this.FEnabled!==t&&(this.FEnabled=t,this.GetParentMenu().UpdateElement())},this.GetCount=function(){return null===this.FItems?0:this.FItems.GetCount()},this.Create$1=function(e){return this.FParentMenu=null,t.TMainMenu.isPrototypeOf(e)&&(this.FParentMenu=e),pas.Classes.TComponent.Create$1.call(this,e),this.FAutoHotkeys=2,this.FAutoLineReduction=2,this.FImageIndex=-1,this.FHint="",this.FCaption="MenuItem",this.FChecked=!1,this.FEnabled=!0,this.FDefault=!1,this.FRadioItem=!1,this.FVisible=!0,this.FOwner$1=e,this},this.Destroy=function(){var t=0,e=null,i=null;if(e=this.GetParentMenu(),null!=this.FParentItem&&null!=e){e.BeginUpdate();for(var s=this.FParentItem.FItems.GetCount()-1;s>=0;s--)t=s,this.FParentItem.FItems.GetItem(t)===this&&this.FParentItem.FItems.Delete(t);e.EndUpdate()}if(null!=this.FItems)for(var n=this.FItems.GetCount()-1;n>=0;n--)t=n,(i=this.FItems.GetItem(t)).FParentItem=null,i=rtl.freeLoc(i),this.FItems.Delete(t);pas.Classes.TComponent.Destroy.call(this)},this.Assign=function(e){var i=0,s=null,n=null,r=null;if(t.TMenuItem.isPrototypeOf(e)&&(s=rtl.as(e,t.TMenuItem),this.FAutoCheck=s.FAutoCheck,this.FAutoHotkeys=s.FAutoHotkeys,this.FAutoLineReduction=s.FAutoLineReduction,this.FBreak=s.FBreak,this.FCaption=s.FCaption,this.FChecked=s.FChecked,this.FDefault=s.FDefault,this.FEnabled=s.FEnabled,this.FGroupIndex=s.FGroupIndex,this.FHelpContext=s.FHelpContext,this.FHint=s.FHint,this.FImageIndex=s.FImageIndex,this.FRadioItem=s.FRadioItem,this.FShortCut=s.FShortCut,this.FVisible=s.FVisible,this.FElementClassName=s.FElementClassName,r=this.GetParentMenu(),null!=this.FParentItem&&this.SetName(r.GetUniqueName(s.FCaption)),null!=s.FItems)){if(null!=this.FItems){for(var o=this.FItems.GetCount()-1;o>=0;o--)i=o,this.RemoveItem(this.GetParentMenu().FParent,this.FItems.GetItem(i));this.FItems.Clear()}else this.FItems=t.TMenuItemList.$create("Create$1");for(var l=0,a=s.FItems.GetCount()-1;l<=a;l++)i=l,(n=t.TMenuItem.$create("Create$1",[r.FOwner])).FParentMenu=r,n.FParentItem=this,n.Assign(s.FItems.GetItem(i)),this.FItems.Add(n)}},this.SetParentComponent=function(e){pas.Classes.TComponent.SetParentComponent.apply(this,arguments),this.FParentMenu=e,null!==e&&(t.TCustomMainMenu.isPrototypeOf(e)?e.FItems.IsChild(this)||e.FItems.Add(this):t.TMenuItem.isPrototypeOf(e)&&(e.IsChild(this)||e.Add(this)))},this.Add=function(t){this.Insert$1(this.GetCount(),t)},this.Insert$1=function(e,i){null===this.FItems&&(this.FItems=t.TMenuItemList.$create("Create$1")),this.FItems.Insert(e,i),i.FParentItem=this,null!=i.GetParentMenu()&&i.GetParentMenu().UpdateElement()},this.IsChild=function(t){var e=!1,i=0;if(e=!1,null==this.FItems)return e;for(var s=0,n=this.FItems.GetCount()-1;s<=n;s++)i=s,this.FItems.GetItem(i)===t&&(e=!0);return e},this.GetOwner=function(){return this.FOwner$1},this.GetParentMenu=function(){var e=null,i=null;for(e=null,i=this.FParentMenu;null!=i&&t.TMenuItem.isPrototypeOf(i);)i=i.FParentMenu;return null!=i&&(e=i),e},this.RemoveItem=function(t,e){var i=0;if(null!=e.FItems)for(var s=e.FItems.GetCount()-1;s>=0;s--)i=s,this.RemoveItem(t,e.FItems.GetItem(i));t.RemoveComponent(e)},this.Click=function(){null!=this.FOnClick&&this.FOnClick(this)};var e=this.$rtti;e.addProperty("AutoCheck",0,rtl.boolean,"FAutoCheck","FAutoCheck",{Default:!1}),e.addProperty("AutoHotkeys",0,t.$rtti.TMenuItemAutoFlag,"FAutoHotkeys","FAutoHotkeys",{Default:t.TMenuItemAutoFlag.maParent}),e.addProperty("AutoLineReduction",0,t.$rtti.TMenuItemAutoFlag,"FAutoLineReduction","FAutoLineReduction",{Default:t.TMenuItemAutoFlag.maParent}),e.addProperty("Break",0,t.$rtti.TMenuBreak,"FBreak","FBreak",{Default:t.TMenuBreak.mbNone}),e.addProperty("Caption",2,rtl.string,"FCaption","SetCaption"),e.addProperty("Checked",2,rtl.boolean,"FChecked","SetChecked",{Default:!1}),e.addProperty("Default",0,rtl.boolean,"FDefault","FDefault",{Default:!1}),e.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),e.addProperty("GroupIndex",0,rtl.byte,"FGroupIndex","FGroupIndex",{Default:0}),e.addProperty("HelpContext",0,t.$rtti.THelpContext,"FHelpContext","FHelpContext",{Default:0}),e.addProperty("Hint",0,rtl.string,"FHint","FHint"),e.addProperty("ImageIndex",2,rtl.longint,"FImageIndex","SetImageIndex",{Default:-1}),e.addProperty("RadioItem",0,rtl.boolean,"FRadioItem","FRadioItem",{Default:!1}),e.addProperty("ShortCut",0,t.$rtti.TShortCut,"FShortCut","FShortCut",{Default:0}),e.addProperty("Visible",0,rtl.boolean,"FVisible","FVisible",{Default:!0}),e.addProperty("ElementClassName",0,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","FElementClassName"),e.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=void 0,pas.Classes.TPersistent.$final.call(this)},this.SetVisible=function(t){this.FVisible!==t&&(this.FVisible=t,this.FOwner.FOwner.UpdateElement())},this.SetBackgroundColor=function(t){this.FBackgroundColor!==t&&(this.FBackgroundColor=t,this.FOwner.FOwner.UpdateElement())},this.SetCaption=function(t){this.FCaption!==t&&(this.FCaption=t,this.FOwner.FOwner.UpdateElement())},this.SetCaptionColor=function(t){this.FCaptionColor!==t&&(this.FCaptionColor=t,this.FOwner.FOwner.UpdateElement())},this.SetResponsiveMaxWidth=function(t){this.FResponsiveMaxWidth!==t&&(this.FResponsiveMaxWidth=t,this.FOwner.FOwner.UpdateElement())},this.Create$1=function(t){return this.FBackgroundColor=12632256,this.FCaption="Menu",this.FCaptionColor=16777215,this.FVisible=2,this.FResponsiveMaxWidth=768,this.FOwner=t,this},this.Destroy=function(){pas.System.TObject.Destroy.call(this)},this.Assign=function(e){pas.Classes.TPersistent.Assign.apply(this,arguments),t.THamburgerMenu.isPrototypeOf(e)&&(this.FBackgroundColor=rtl.as(e,t.THamburgerMenu).FBackgroundColor,this.FCaption=rtl.as(e,t.THamburgerMenu).FCaption,this.FCaptionColor=rtl.as(e,t.THamburgerMenu).FCaptionColor,this.FVisible=rtl.as(e,t.THamburgerMenu).FVisible,this.FResponsiveMaxWidth=rtl.as(e,t.THamburgerMenu).FResponsiveMaxWidth)},this.GetOwner=function(){return this.FOwner};var e=this.$rtti;e.addProperty("Caption",2,rtl.string,"FCaption","SetCaption"),e.addProperty("CaptionColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FCaptionColor","SetCaptionColor",{Default:16777215}),e.addProperty("BackgroundColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FBackgroundColor","SetBackgroundColor",{Default:12632256}),e.addProperty("Visible",2,t.$rtti.TMainMenuHamburgerMenuVisible,"FVisible","SetVisible",{Default:t.TMainMenuHamburgerMenuVisible.hmResponsive}),e.addProperty("ResponsiveMaxWidth",2,rtl.longint,"FResponsiveMaxWidth","SetResponsiveMaxWidth",{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=void 0,this.FImageURLs=void 0,this.FHamburgerMenu=void 0,pas.Classes.TPersistent.$final.call(this)},this.SetBackgroundColor=function(t){this.FBackgroundColor!==t&&(this.FBackgroundColor=t,this.FOwner.UpdateElement())},this.SetHoverColor=function(t){this.FHoverColor!==t&&(this.FHoverColor=t,this.FOwner.UpdateElement())},this.SetHoverFontColor=function(t){this.FHoverFontColor!==t&&(this.FHoverFontColor=t,this.FOwner.UpdateElement())},this.SetImageURLs=function(t){this.FImageURLs.Assign(t)},this.SetImageSize=function(t){this.FImageSize!==t&&(this.FImageSize=t,this.FOwner.UpdateElement())},this.SetSubmenuIndicator=function(t){this.FSubmenuIndicator!==t&&(this.FSubmenuIndicator=t,this.FOwner.UpdateElement())},this.HandleImageURLsChanged=function(t){this.FOwner.UpdateElement()},this.Create$1=function(e){return this.FBackgroundColor=15790320,this.FHoverColor=14120960,this.FHoverFontColor=197379,this.FHamburgerMenu=t.THamburgerMenu.$create("Create$1",[this]),this.FImageURLs=pas.Classes.TStringList.$create("Create$1"),this.FImageURLs.SetSkipLastLineBreak(!0),this.FImageURLs.FOnChange=rtl.createCallback(this,"HandleImageURLsChanged"),this.FImageSize=16,this.FSubmenuIndicator="►",this.FOwner=e,this},this.Destroy=function(){rtl.free(this,"FHamburgerMenu"),rtl.free(this,"FImageURLs"),pas.System.TObject.Destroy.call(this)},this.Assign=function(e){pas.Classes.TPersistent.Assign.apply(this,arguments),t.TMainMenu.isPrototypeOf(e)&&(this.FBackgroundColor=rtl.as(e,t.TMainMenuAppearance).FBackgroundColor,this.FHoverColor=rtl.as(e,t.TMainMenuAppearance).FHoverColor,this.FHoverFontColor=rtl.as(e,t.TMainMenuAppearance).FHoverFontColor,this.FHamburgerMenu.Assign(rtl.as(e,t.TMainMenuAppearance).FHamburgerMenu),this.FImageURLs.Assign(rtl.as(e,t.TMainMenuAppearance).FImageURLs),this.FImageSize=rtl.as(e,t.TMainMenuAppearance).FImageSize,this.FSubmenuIndicator=rtl.as(e,t.TMainMenuAppearance).FSubmenuIndicator)},this.GetOwner=function(){return this.FOwner};var e=this.$rtti;e.addProperty("BackgroundColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FBackgroundColor","SetBackgroundColor",{Default:15790320}),e.addProperty("HamburgerMenu",0,t.$rtti.THamburgerMenu,"FHamburgerMenu","FHamburgerMenu"),e.addProperty("HoverColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FHoverColor","SetHoverColor",{Default:14120960}),e.addProperty("HoverFontColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FHoverFontColor","SetHoverFontColor",{Default:197379}),e.addProperty("ImageURLs",2,pas.Classes.$rtti.TStringList,"FImageURLs","SetImageURLs"),e.addProperty("ImageSize",2,rtl.longint,"FImageSize","SetImageSize",{Default:16}),e.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=void 0,this.FOnChange=void 0,pas["WEBLib.Controls"].TCustomControl.$final.call(this)},this.Loaded=function(){pas["WEBLib.Controls"].TCustomControl.Loaded.call(this),this.IsUpdating()||null!=this.GetElementHandle()&&this.UpdateElement()},this.UpdateElement=function(){pas["WEBLib.Controls"].TControl.UpdateElement.call(this),this.IsUpdating()},this.GetUniqueName=function(t){var i="",s=0,n=0,r=!1;n=1,""===t&&(t=this.FName+"item"),t=e.MakeValidName(t);do{i=t+pas.SysUtils.IntToStr(n),r=!0;for(var o=0,l=this.FOwner.GetComponentCount()-1;o<=l;o++)if(s=o,this.FOwner.GetComponent(s).FName===i){r=!1,n+=1;break}}while(!r);return i},this.SetName=function(t){pas["WEBLib.Controls"].TCustomControl.SetName.apply(this,arguments),this.IsUpdating()||0 in this.FComponentState||this.UpdateElement()},this.CreateInitialize=function(){pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this),this.FItems=t.TMenuItem.$create("Create$1",[this]),this.FItems.FParentMenu=this,this.SetWidthStyle(2),this.SetHeight(30)},this.Destroy=function(){rtl.free(this,"FItems"),pas["WEBLib.Controls"].TCustomControl.Destroy.call(this)};var i=this.$rtti;i.addProperty("Items",0,t.$rtti.TMenuItem,"FItems",""),i.addProperty("OnChange",0,t.$rtti.TMainMenuChangeEvent,"FOnChange","FOnChange")})),rtl.createClass(this,"TMainMenu",this.TCustomMainMenu,(function(){this.$init=function(){t.TCustomMainMenu.$init.call(this),this.FMenu=null,this.FMainMenu=!1,this.FMenuIndex=0,this.FAppearance=null,this.FContainer$1=null,this.FIsPopupMenu=!1,this.FShowPopup=!1,this.FElementItemClassName=""},this.$final=function(){this.FMenu=void 0,this.FAppearance=void 0,this.FContainer$1=void 0,t.TCustomMainMenu.$final.call(this)},this.HandleChange=function(t){var e=null,i=null;return!0,this.FIsPopupMenu&&(this.FShowPopup=!1,this.UpdateElement()),(e=t.target).hasAttribute("id")||(e=e.parentElement),null!=(i=this.GetItemByName(this.FItems,e.id))&&(i.FAutoCheck&&i.SetChecked(!i.FChecked),null!=this.FOnChange&&this.FOnChange(this,i,!1),i.Click()),!0},this.Loaded=function(){t.TCustomMainMenu.Loaded.call(this),this.IsUpdating()||(null==this.FContainer$1&&pas["WEBLib.Forms"].TCustomForm.isPrototypeOf(this.FParent)&&rtl.as(this.FParent,pas["WEBLib.Forms"].TCustomForm).FMenu===this&&(this.FContainer$1=this.FParent),null!=this.GetElementHandle()&&this.UpdateElement())},this.UpdateElement=function(){var e,i="",s="",n="",r="",o="",l=null,a=null,h=null,u=null,d=null,c=null,F=null;t.TCustomMainMenu.UpdateElement.call(this),this.IsUpdating()||null==this.GetElementHandle()&&null==this.FContainer$1||(null!=this.FContainer$1?(l=this.FContainer$1.GetElementHandle(),this.SetVisible(!1)):((l=this.GetElementHandle()).style.setProperty("top",pas.SysUtils.IntToStr(this.GetTop())+"px"),l.style.setProperty("left",pas.SysUtils.IntToStr(this.GetLeft())+"px"),4 in this.FComponentState&&null==this.FContainer$1&&this.GetElementHandle().style.setProperty("background-color","silver")),this.FMenu=l.firstChild,null!=this.FMenu&&this.FMenu.parentElement.removeChild(this.FMenu),3 in this.FComponentState||(this.FMenu=document.createElement("NAV"),this.FMenu.setAttribute("id",this.GetID()+"menu"),this.FMenu.innerHTML="",null!=this.FContainer$1&&(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","999997")),null==this.FContainer$1&&(l.innerHTML="",l.style.setProperty("overflow","visible")),0!==this.FAppearance.FHamburgerMenu.FVisible&&(o=this.FShowPopup?"block":"none",n=" #"+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: "+o+";\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',2===this.FAppearance.FHamburgerMenu.FVisible&&(n="@media only screen and (min-width: "+pas.SysUtils.IntToStr(this.FAppearance.FHamburgerMenu.FResponsiveMaxWidth)+"px) {\r"+n+"}")),this.FAppearance.FImageSize>0&&(r=" width: "+pas.SysUtils.IntToStr(this.FAppearance.FImageSize)+"px;\r height: "+pas.SysUtils.IntToStr(this.FAppearance.FImageSize)+"px;\r"),i="#"+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"+r+" margin-right: 10px;\r pointer-events: none;\r}\r#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",s="",""===this.FElementClassName&&(s="#"+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"),i=i+s+n,this.FMainMenu=!0,this.FMenuIndex=0,(c=document.createElement("STYLE")).innerHTML=i,(F=document.createElement("SCRIPT")).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); }}',(a=document.createElement("LABEL")).setAttribute("for","tm"),a.setAttribute("id","toggle-menu"),a.innerHTML=this.FAppearance.FHamburgerMenu.FCaption,h=document.createElement("SPAN"),""!==this.FElementItemClassName?h.setAttribute("class",this.FElementItemClassName):h.setAttribute("class","drop-label"),a.appendChild(h),(u=document.createElement("SPAN")).setAttribute("class","hamburger-icon"),u.innerHTML="☰",h.appendChild(u),(d=document.createElement("INPUT")).setAttribute("type","checkbox"),d.setAttribute("id","tm"),this.FMenu.appendChild(c),this.FMenu.appendChild(F),this.FMenu.appendChild(a),this.FMenu.appendChild(d),null!==(e=this.GetMenuSource(this.FItems))&&this.FMenu.appendChild(e),l.appendChild(this.FMenu)))},this.GetMenuSource=function(t){var i=null,s=0,n=null,r="",o=null,l=null,a=null,h=null,u=0,d="";if(i=null,null!=t.FItems&&t.FItems.GetCount()>0){i=document.createElement("UL"),this.FMainMenu?(this.FMainMenu=!1,r=this.FIsPopupMenu?"popup-menu":"main-menu"):r="sub-menu",this.FMenuIndex=this.FMenuIndex+1,i.setAttribute("class",r);for(var c=0,F=t.FItems.GetCount()-1;c<=F;c++)s=c,u+=1,""===(n=t.FItems.GetItem(s)).FName&&(d=pas.SysUtils.StringReplace(n.FCaption," ","",rtl.createSet(0)),""===(d=e.MakeValidName(d))&&(d="MenuItem"+pas.SysUtils.IntToStr(u)),n.SetName(d+pas.SysUtils.IntToStr(u))),n.FVisible&&(o=document.createElement("LI"),"-"!==n.FCaption?(l=document.createElement("LABEL"),""!==this.FElementItemClassName?l.setAttribute("class",this.FElementItemClassName):l.setAttribute("class","drop-label"),l.setAttribute("title",n.FHint),n.FImageIndex>=0&&this.FAppearance.FImageURLs.GetCount()>n.FImageIndex?l.innerHTML='<img class="icon" src="'+this.FAppearance.FImageURLs.Get(n.FImageIndex)+'">':n.FChecked&&(n.FRadioItem?l.innerHTML='<span class="checked">●</span>':l.innerHTML='<span class="checked">✔</span>'),l.innerHTML=l.innerHTML+n.FCaption):((l=document.createElement("SPAN")).setAttribute("class","menu-separator"),l.innerHTML=""),null!=n.FItems&&n.FItems.GetCount()>0?((h=document.createElement("SPAN")).setAttribute("class","drop-icon"),h.innerHTML=this.FAppearance.FSubmenuIndicator,l.setAttribute("for","sm"+pas.SysUtils.IntToStr(this.FMenuIndex)),l.appendChild(h),n.FEnabled||l.style.setProperty("color","gray"),(a=document.createElement("INPUT")).setAttribute("type","checkbox"),a.setAttribute("id","sm"+pas.SysUtils.IntToStr(this.FMenuIndex)),o.appendChild(l),o.appendChild(a),n.FEnabled&&o.appendChild(this.GetMenuSource(n))):(l.setAttribute("for","tm"),l.setAttribute("id",n.FName),n.FEnabled?("sub-menu"===r&&n.FEnabled&&l.setAttribute("onMouseUp",this.GetID()+"MenuClick(this);"),l.addEventListener("click",rtl.createSafeCallback(this,"HandleChange"))):l.style.setProperty("color","gray"),o.appendChild(l)),i.appendChild(o))}return i},this.GetItemByName=function(t,e){var i=null,s=0,n=null;if(i=null,null!=t.FItems)for(var r=0,o=t.FItems.GetCount()-1;r<=o;r++){if(s=r,(n=t.FItems.GetItem(s)).FName===e)return i=n,null!=n.FOnClick&&(i.FOnClick=n.FOnClick),i;null==i&&(i=this.GetItemByName(n,e))}return i},this.CreateInitialize=function(){t.TCustomMainMenu.CreateInitialize.call(this),this.FAppearance=t.TMainMenuAppearance.$create("Create$1",[this]),this.FContainer$1=null,this.FMainMenu=!0,this.FMenuIndex=0,this.FIsPopupMenu=!1,this.FShowPopup=!1,this.SetTop(0),this.SetLeft(0),this.SetWidth(100),4 in this.FComponentState&&(this.SetElementPosition(1),this.SetWidthPercent(100),this.SetWidthStyle(0))},this.CreateElement=function(){var t=null,e=null;return 4 in this.FComponentState?(t=document.createElement("DIV"),(e=document.createElement("DIV")).innerHTML="TWebMainMenu",this.SetBorderStyle(1),e.setAttribute("align","center"),e.style.setProperty("border","1px solid gray"),e.style.setProperty("vertical-align","middle"),e.style.setProperty("display","table-cell"),t.appendChild(e)):(t=document.createElement("DIV"),this.FIsPopupMenu&&t.setAttribute("onMouseLeave",this.GetID()+"MenuOut(this);")),t},this.Destroy=function(){rtl.free(this,"FAppearance"),t.TCustomMainMenu.Destroy.call(this)};var i=this.$rtti;i.addProperty("Appearance",0,t.$rtti.TMainMenuAppearance,"FAppearance","FAppearance"),i.addProperty("Container",0,pas["WEBLib.Controls"].$rtti.TControl,"FContainer$1","FContainer$1"),i.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),i.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),i.addProperty("ElementItemClassName",0,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementItemClassName","FElementItemClassName"),i.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),i.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0})})),rtl.createClass(this,"TPopupMenu",this.TMainMenu,(function(){this.$init=function(){t.TMainMenu.$init.call(this),this.FOnPopup=null},this.$final=function(){this.FOnPopup=void 0,t.TMainMenu.$final.call(this)},this.Create$1=function(t){return pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments),pas["WEBLib.Controls"].TControl.isPrototypeOf(t)&&this.SetParent(t),this},this.CreateInitialize=function(){t.TMainMenu.CreateInitialize.call(this),this.FAppearance.FHamburgerMenu.SetVisible(1),this.FIsPopupMenu=!0},this.Popup=function(t,e){null!=this.FOnPopup&&this.FOnPopup(this),this.SetTop(e),this.SetLeft(t),this.FShowPopup=!0,this.UpdateElement(),this.FShowPopup=!1},this.$rtti.addProperty("OnPopup",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnPopup","FOnPopup")})),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=void 0,pas["WEBLib.Controls"].TCustomControl.$final.call(this)},this.HandleDoContextMenu=function(t){var e=!1,i=pas.Types.TPoint.$new(),s=null,n=null;return pas["WEBLib.Controls"].TControl.HandleDoContextMenu.apply(this,arguments),null!=this.FPopupMenu&&(t.stopPropagation(),t.preventDefault(),i.$assign(pas.Types.Point(Math.round(t.clientX),Math.round(t.clientY))),null!=(s=pas["WEBLib.Forms"].GetParentForm(this))&&null!=s.GetContainer()&&(n=s.GetContainer().getBoundingClientRect(),i.x=i.x-Math.round(n.left),i.y=i.y-Math.round(n.top)),this.FPopupMenu.Popup(i.x,i.y),e=!0),e},this.Notification=function(t,e){pas.Classes.TComponent.Notification.apply(this,arguments),1===e&&t===this.FPopupMenu&&(this.FPopupMenu=null)}})),t.$implcode=function(){var t=rtl.createSet(null,65,90,null,97,122,95),i=rtl.unionSet(t,rtl.createSet(null,48,57));e.MakeValidName=function(t){var e="",s=0;e="";for(var n=1,r=t.length;n<=r;n++)s=n,t.charCodeAt(s-1)in i&&(e+=t.charAt(s-1));return e}}}),["Types","WEBLib.Forms"]),rtl.module("Rtl.BrowserLoadHelper",["System","Classes","SysUtils","JS","Web"],(function(){"use strict";var t=this;rtl.createClass(this,"TBrowserLoadHelper",pas.Classes.TLoadHelper,(function(){})),t.$init=function(){pas.Classes.SetLoadHelperClass(t.TBrowserLoadHelper)}})),rtl.module("WEBLib.JSON",["System","Classes","Web","JS","SysUtils"],(function(){"use strict";var t=this;rtl.createClass(this,"TJSONAncestor",pas.System.TObject,(function(){this.GetStrValue=function(){return"",""},this.SetStrValue=function(t){}})),rtl.createClass(this,"TJSONValue",this.TJSONAncestor,(function(){this.$init=function(){t.TJSONAncestor.$init.call(this),this.fjv=void 0,this.fjo=void 0},this.GetStrValue=function(){return""+this.fjv},this.JSONValueFromJS=function(e){var i=null,s=0;return i=null,rtl.isArray(e)?(i=t.TJSONArray.$create("Create"),rtl.as(i,t.TJSONArray).fja=e):rtl.isObject(e)?(i=t.TJSONObject.$create("Create$2"),rtl.as(i,t.TJSONObject).fjo$1=e):rtl.isString(e)?(i=t.TJSONString.$create("Create"),rtl.as(i,t.TJSONString).SetStrValue(""+e)):rtl.isNumber(e)?(i=t.TJSONNumber.$create("Create"),rtl.as(i,t.TJSONNumber).SetStrValue(""+e),s=rtl.getNumber(e),rtl.as(i,t.TJSONNumber).FDouble=s,0===pas.System.Frac(s)&&(rtl.as(i,t.TJSONNumber).FInt=rtl.trunc(e))):pas.JS.isNull(e)?i=t.TJSONNull.$create("Create"):pas.JS.isBoolean(e)&&(i=pas.JS.toBoolean(e)?t.TJSONTrue.$create("Create"):t.TJSONFalse.$create("Create")),null==i&&(i=t.TJSONNull.$create("Create")),i.fjv=e,i},this.ToString=function(){return JSON.stringify(this.fjv)}})),rtl.createClass(this,"TJSONPair",pas.System.TObject,(function(){this.$init=function(){pas.System.TObject.$init.call(this),this.fjo=void 0,this.fjv=null,this.fjs=null},this.$final=function(){this.fjv=void 0,this.fjs=void 0,pas.System.TObject.$final.call(this)},this.Create$1=function(){return pas.System.TObject.Create.call(this),this.fjs=t.TJSONString.$create("Create"),this},this.Destroy=function(){rtl.free(this,"fjs"),pas.System.TObject.Destroy.call(this)},this.ToString=function(){return t.TJSONObject.isPrototypeOf(this.fjv)?'"'+this.fjs.GetStrValue()+'":'+rtl.as(this.fjv,t.TJSONObject).ToJSON():null!==this.fjs&&null!==this.fjv?'"'+this.fjs.GetStrValue()+'":'+this.fjv.ToString():""}})),rtl.createClass(this,"TJSONPairList",pas.Classes.TList,(function(){})),rtl.createClass(this,"TJSONObject",this.TJSONValue,(function(){this.$init=function(){t.TJSONValue.$init.call(this),this.fjo$1=null,this.FMembers=null},this.$final=function(){this.fjo$1=void 0,this.FMembers=void 0,t.TJSONValue.$final.call(this)},this.GetCount=function(){return null!=this.fjo$1?rtl.length(Object.keys(this.fjo$1)):null!=this.FMembers?this.FMembers.GetCount():0},this.Create$2=function(){return pas.System.TObject.Create.call(this),this.FMembers=t.TJSONPairList.$create("Create$1"),this.fjo$1=null,this},this.Destroy=function(){rtl.free(this,"FMembers"),pas.System.TObject.Destroy.call(this)},this.ParseJSONValue=function(t){var e;return e=JSON.parse(t),this.JSONValueFromJS(e)},this.Get=function(e){var i=null,s=void 0,n=null,r=0,o=null;if(i=null,null!=this.fjo$1)null==(s=this.fjo$1[e])&&null!==s||(i=t.TJSONPair.$create("Create$1"),n=this.$class.JSONValueFromJS(s),i.fjo=this.fjo$1,i.fjs.SetStrValue(e),i.fjv=n);else for(var l=0,a=this.FMembers.GetCount()-1;l<=a;l++)r=l,(o=rtl.getObject(this.FMembers.Get(r))).fjs.ToString()==='"'+e+'"'&&(i=o);return i},this.Get$1=function(t){return this.Get(Object.keys(this.fjo$1)[t])},this.GetValue$1=function(t){var e,i=null;return i=null,null!=(e=this.Get(t))&&((i=e.fjv).fjo=e.fjo),i},this.ToJSON=function(){var t="",e=0,i=0,s=null;t="{",(e=null!=this.fjo$1?this.GetCount():this.FMembers.GetCount())>0&&(null!=this.fjo$1?null!=(s=this.Get$1(0))?t+=s.ToString():t=t+'"'+Object.keys(this.fjo$1)[0]+'":null':t+=rtl.getObject(this.FMembers.Get(0)).ToString());for(var n=1,r=e-1;n<=r;n++)i=n,t=null!=this.fjo$1?null!=(s=this.Get$1(i))?t+","+s.ToString():t+',"'+Object.keys(this.fjo$1)[i]+'":null':t+","+rtl.getObject(this.FMembers.Get(i)).ToString();return t+="}"},this.ToString=function(){return this.ToJSON()}})),rtl.createClass(this,"TJSONString",this.TJSONValue,(function(){this.$init=function(){t.TJSONValue.$init.call(this),this.FValue=""},this.GetStrValue=function(){return this.FValue},this.SetStrValue=function(t){if(this.FValue=t,this.fjv=t,pas.System.Assigned(this.fjo)){var e=Object.keys(this.fjo)[0];this.fjo[e]=t}}})),rtl.createClass(this,"TJSONNumber",this.TJSONString,(function(){this.$init=function(){t.TJSONString.$init.call(this),this.FInt=0,this.FDouble=0},this.GetStrValue=function(){return pas.SysUtils.FloatToStr$1(this.FDouble,pas.SysUtils.TFormatSettings.Invariant())},this.SetStrValue=function(t){this.FDouble=pas.SysUtils.StrToFloat$1(t,pas.SysUtils.TFormatSettings.Invariant()),0===pas.System.Frac(this.FDouble)?(pas.SysUtils.TryStrToInt$1(t,{p:this,get:function(){return this.p.FInt},set:function(t){this.p.FInt=t}},pas.SysUtils.TFormatSettings.Invariant())||(this.FInt=0),this.fjv=this.FInt):this.fjv=this.FDouble}})),rtl.createClass(this,"TJSONBool",this.TJSONValue,(function(){this.$init=function(){t.TJSONValue.$init.call(this),this.FBool=!1},this.SetStrValue=function(t){var e;e=pas.SysUtils.UpperCase(t),this.FBool="TRUE"===e}})),rtl.createClass(this,"TJSONTrue",this.TJSONBool,(function(){this.GetStrValue=function(){return"true","true"},this.ToString=function(){return this.GetStrValue()}})),rtl.createClass(this,"TJSONFalse",this.TJSONBool,(function(){this.GetStrValue=function(){return"false","false"},this.ToString=function(){return this.GetStrValue()}})),rtl.createClass(this,"TJSONNull",this.TJSONValue,(function(){this.GetStrValue=function(){return"null","null"},this.ToString=function(){return this.GetStrValue()}})),rtl.createClass(this,"TJSONArray",this.TJSONValue,(function(){this.$init=function(){t.TJSONValue.$init.call(this),this.fja=null},this.$final=function(){this.fja=void 0,t.TJSONValue.$final.call(this)},this.GetItem=function(e){var i;return i=this.GetJA()[e],rtl.isExt(i,t.TJSONObject,1)||rtl.isExt(i,t.TJSONArray,1)?rtl.getObject(i):this.$class.JSONValueFromJS(i)},this.GetCount=function(){return this.GetJA().length},this.GetJA=function(){return null==this.fja&&(this.fja=new Array),this.fja},this.ToString=function(){var e="",i=0,s=null,n="";e="[",n="";for(var r=0,o=this.GetCount()-1;r<=o;r++)i=r,null!=(s=this.GetItem(i))&&(e=t.TJSONObject.isPrototypeOf(s)?e+n+rtl.as(s,t.TJSONObject).ToString():e+n+s.ToString(),n=",");return e+="]"}}))})),rtl.module("WEBLib.Forms",["System","Classes","Types","SysUtils","WEBLib.Graphics","WEBLib.Controls","WEBLib.Lang","WEBLib.Menus","Web","JS","Rtl.BrowserLoadHelper"],(function(){"use strict";var t=this,e=t.$impl;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.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.mrContinue=11,this.mrAll=12,this.mrNoToAll=13,this.mrYesToAll=14,this.rgiFirst=-1024,this.igiLast=511,this.clTMSBlue=14917120,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.$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},rtl.recNewT(this,"TSmallPoint",(function(){this.x=0,this.y=0,this.$eq=function(t){return this.x===t.x&&this.y===t.y},this.$assign=function(t){return this.x=t.x,this.y=t.y,this};var e=t.$rtti.$Record("TSmallPoint",{});e.addField("x",rtl.smallint),e.addField("y",rtl.smallint)})),rtl.recNewT(this,"TAlignInfo",(function(){this.AlignList=null,this.ControlIndex=0,this.Align=0,this.Scratch=0,this.$eq=function(t){return this.AlignList===t.AlignList&&this.ControlIndex===t.ControlIndex&&this.Align===t.Align&&this.Scratch===t.Scratch},this.$assign=function(t){return this.AlignList=t.AlignList,this.ControlIndex=t.ControlIndex,this.Align=t.Align,this.Scratch=t.Scratch,this};var e=t.$rtti.$Record("TAlignInfo",{});e.addField("AlignList",pas.Classes.$rtti.TList),e.addField("ControlIndex",rtl.longint),e.addField("Align",pas["WEBLib.Controls"].$rtti.TAlign),e.addField("Scratch",rtl.longint)})),rtl.recNewT(this,"TGestureEventInfo",(function(){this.GestureID=0,this.Angle=0,this.Distance=0,this.$new=function(){var e=Object.create(this);return e.Location=pas.Types.TPoint.$new(),e.Flags={},e.InertiaVector=t.TSmallPoint.$new(),e.TapLocation=t.TSmallPoint.$new(),e},this.$eq=function(t){return this.GestureID===t.GestureID&&this.Location.$eq(t.Location)&&rtl.eqSet(this.Flags,t.Flags)&&this.Angle===t.Angle&&this.InertiaVector.$eq(t.InertiaVector)&&this.Distance===t.Distance&&this.TapLocation.$eq(t.TapLocation)},this.$assign=function(t){return this.GestureID=t.GestureID,this.Location.$assign(t.Location),this.Flags=rtl.refSet(t.Flags),this.Angle=t.Angle,this.InertiaVector.$assign(t.InertiaVector),this.Distance=t.Distance,this.TapLocation.$assign(t.TapLocation),this};var e=t.$rtti.$Record("TGestureEventInfo",{});e.addField("GestureID",t.$rtti.TGestureID),e.addField("Location",pas.Types.$rtti.TPoint),e.addField("Flags",t.$rtti.TInteractiveGestureFlags),e.addField("Angle",rtl.double),e.addField("InertiaVector",t.$rtti.TSmallPoint),e.addField("Distance",rtl.longint),e.addField("TapLocation",t.$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.TPopupMode={0:"pmNone",pmNone:0,1:"pmAuto",pmAuto:1,2:"pmExplicit",pmExplicit:2},this.TPopupClose={0:"pcOnDeactivate",pcOnDeactivate:0,1:"pcNever",pcNever:1},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.TApplicationErrorType={0:"aeSilent",aeSilent:0,1:"aeDialog",aeDialog:1,2:"aeAlert",aeAlert:2,3:"aeFooter",aeFooter:3},this.TFormBorderStyle={0:"fbNone",fbNone:0,1:"fbSingle",fbSingle:1,2:"fbSizeable",fbSizeable:2,3:"fbDialog",fbDialog:3,4:"fbDialogSizeable",fbDialogSizeable:4},this.TCSSLibrary={0:"cssNone",cssNone:0,1:"cssBootstrap",cssBootstrap:1},this.$rtti.$Enum("TCSSLibrary",{minvalue:0,maxvalue:1,ordtype:1,enumtype:this.TCSSLibrary}),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=void 0,this.FOnChange=void 0,pas.Classes.TPersistent.$final.call(this)},this.SetConstraints=function(t,e){var i=t;0===i?e!==this.FMaxHeight&&(this.FMaxHeight=e,e>0&&e<this.FMinHeight&&(this.FMinHeight=e),this.Change()):1===i?e!==this.FMaxWidth&&(this.FMaxWidth=e,e>0&&e<this.FMinWidth&&(this.FMinWidth=e),this.Change()):2===i?e!==this.FMinHeight&&(this.FMinHeight=e,this.FMaxHeight>0&&e>this.FMaxHeight&&(this.FMaxHeight=e),this.Change()):3===i&&e!==this.FMinWidth&&(this.FMinWidth=e,this.FMaxWidth>0&&e>this.FMaxWidth&&(this.FMaxWidth=e),this.Change())},this.Change=function(){null!=this.FOnChange&&this.FOnChange(this)},this.AssignTo=function(e){t.TCustomSizeConstraints.isPrototypeOf(e)?(e.FMinHeight=this.FMinHeight,e.FMaxHeight=this.FMaxHeight,e.FMinWidth=this.FMinWidth,e.FMaxWidth=this.FMaxWidth,e.Change()):pas.Classes.TPersistent.AssignTo.call(this,e)},this.Create$1=function(t){return pas.System.TObject.Create.call(this),this.FControl=t,this}})),rtl.createClass(this,"TSizeConstraints",this.TCustomSizeConstraints,(function(){var e=this.$rtti;e.addProperty("MaxHeight",18,t.$rtti.TConstraintSize,"FMaxHeight","SetConstraints",{index:0,Default:0}),e.addProperty("MaxWidth",18,t.$rtti.TConstraintSize,"FMaxWidth","SetConstraints",{index:1,Default:0}),e.addProperty("MinHeight",18,t.$rtti.TConstraintSize,"FMinHeight","SetConstraints",{index:2,Default:0}),e.addProperty("MinWidth",18,t.$rtti.TConstraintSize,"FMinWidth","SetConstraints",{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.$final=function(){this.FBrush=void 0,pas.System.TObject.$final.call(this)},this.Destroy=function(){rtl.free(this,"FBrush"),pas.System.TObject.Destroy.call(this)}})),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=!1,this.FPopupElement=null,this.FFormFileName="",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.FCaption="",this.FIsResizing$1=!1,this.FOnScroll=null,this.FOnUnload=null,this.FOnBeforeUnload=null,this.FPopupMode=0,this.FPopupClose=0,this.FPosition=0,this.FMdx=0,this.FMdy=0,this.FDlgX=0,this.FDlgY=0,this.FCaptured$1=!1,this.FDown=!1,this.FHasCaption=!1,this.FMoveSpan=null,this.FCaptionElement=null,this.FCaptionCloseElement=null,this.FBorder=0,this.FShadow=!1,this.FTimerID=0,this.FOldWidth=0,this.FOldHeight=0,this.FOnDestroy=null,this.FPopupOpacity=0,this.FCreating=!1,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.FDoClickPtr=null,this.FKeyDownPtr$1=null,this.FOrientationChangePtr=null,this.FHashChangePtr=null,this.FCSSLibrary=0,this.FNoHTML=!1,this.FPrevActiveForm=null,this.FElementCaptionClassName="",this.FMenu=null,this.FResizeObserver=null,this.FOnOrientationChange=null,this.FOnDOMContentLoaded=null,this.FShowClose=!1,this.FOnHashChange=null},this.$final=function(){this.FDesignContainer=void 0,this.FLayer$1=void 0,this.FPopupElement=void 0,this.FOnCreate=void 0,this.FOnShow=void 0,this.FOnPaint=void 0,this.FOnDeactivate=void 0,this.FOnCloseQuery=void 0,this.FOnClose=void 0,this.FModalProc=void 0,this.FOnScroll=void 0,this.FOnUnload=void 0,this.FOnBeforeUnload=void 0,this.FMoveSpan=void 0,this.FCaptionElement=void 0,this.FCaptionCloseElement=void 0,this.FOnDestroy=void 0,this.FPrevActiveForm=void 0,this.FMenu=void 0,this.FResizeObserver=void 0,this.FOnOrientationChange=void 0,this.FOnDOMContentLoaded=void 0,this.FOnHashChange=void 0,pas["WEBLib.Controls"].TWinControl.$final.call(this)},this.GetFormStyle=function(){return this.FFormStyle},this.SetFormStyle=function(t){this.FFormStyle=t},this.SetCaption=function(t){this.FCaption!==t&&(this.FCaption=t,this.UpdateElement())},this.SetShadow=function(t){this.FShadow!==t&&(this.FShadow=t,this.UpdateElement())},this.SetFormContainer=function(t){var e,i=null,s=0;if(e=this.GetContainer(),4 in this.FComponentState?this.FFormContainer=t:"BODY"===pas.SysUtils.UpperCase(t)?this.FFormContainer="":this.FFormContainer=t,(!(0 in this.FComponentState)||4 in this.FComponentState)&&(null!=this.FLayer$1?i=this.FLayer$1:(""===t||null==(i=document.getElementById(t)))&&(i=document.body),null!=i&&(this.FContainer=i,null!=e)))for(var n=0,r=this.GetControlsCount()-1;n<=r;n++)s=n,this.GetControls(s).FParentElement===e&&(this.GetControls(s).FParentElement=i),null!=this.GetControls(s).GetElementHandle()&&this.GetControls(s).GetElementHandle().parentElement===e&&i.appendChild(this.GetControls(s).GetElementHandle())},this.SetWidth=function(t){var e=null;0 in this.FComponentState&&""!==this.FFormContainer||!this.FPopup&&null==this.GetElementHandle()?this.SetWidthInt(t):(pas["WEBLib.Controls"].TControl.SetWidth.apply(this,arguments),this.FPopup&&null!=(e=this.FPopupElement)&&e.style.setProperty("width",pas.SysUtils.IntToStr(t)+"px"))},this.SetHeight=function(t){var e=null;0 in this.FComponentState&&""!==this.FFormContainer||!this.FPopup&&null==this.GetElementHandle()?this.SetHeightInt(t):(pas["WEBLib.Controls"].TControl.SetHeight.apply(this,arguments),this.FPopup&&null!=(e=this.FPopupElement)&&e.style.setProperty("height",pas.SysUtils.IntToStr(t)+"px"))},this.HandleHashChange=function(t){var e,i;return e=t.oldURL,i=t.newURL,null!=this.FOnHashChange&&this.FOnHashChange(this,e,i),!0,!0},this.HandleLoaded=function(t){return this.Resize$1(),this.InitAnchoring(),!0,!0},this.HandleDOMContentLoaded=function(t){return null!=this.FOnDOMContentLoaded&&this.FOnDOMContentLoaded(this),!0,!0},this.HandleScroll=function(t){return null!=this.FOnScroll&&this.FOnScroll(this),!0,!0},this.HandleUnload=function(t){return null!=this.FOnUnload&&this.FOnUnload(this),!0,!0},this.HandleBeforeUnload=function(t){var e="";return e="",null!=this.FOnBeforeUnload&&this.FOnBeforeUnload(this,{get:function(){return e},set:function(t){e=t}}),""!==e?(t.returnValue=e,e):(!0,!0)},this.HandleObserver=function(){return this.Resize$1(),!0,!0},this.HandleResize=function(t){return this.FVisible&&!(3 in this.FComponentState)&&(null==this.GetContainer()&&this.CreateControl(),this.Resize$1(),this.GetElementHandle()===document.body&&window.setTimeout(rtl.createSafeCallback(this,"Resize$1"),25)),!0,!0},this.HandleDocMouseMove=function(t){var e=0,i=0,s=null,n=0,r=0;return this.FDown&&null!=this.GetContainer()&&(e=t.screenX-this.FMdx,i=t.screenY-this.FMdy,(s=this.FHasCaption&&""!==this.FFormFileName?this.GetContainer().parentNode:this.GetContainer()).style.setProperty("transform",""),s.style.setProperty("position","absolute"),n=Math.round(this.FDlgX+e),r=Math.round(this.FDlgY+i),s.style.setProperty("left",pas.SysUtils.IntToStr(n)+"px"),s.style.setProperty("top",pas.SysUtils.IntToStr(r)+"px"),this.FLeft=n,this.FTop=r),!0,!0},this.HandleDocMouseUp=function(t){return this.FDown&&(this.FCaptured$1=!1,this.FDown=!1,document.body.removeEventListener("mousemove",this.FDocMouseMovePtr),document.body.removeEventListener("mouseup",this.FDocMouseUpPtr),null!=this.FMoveSpan&&document.body.removeChild(this.FMoveSpan),this.FEventStopPropagation=rtl.unionSet(this.FEventStopPropagation,rtl.createSet(3,2)),this.FMoveSpan=null),!0,!0},this.HandleTitleDown=function(t){var e=null;return t.stopPropagation(),t.preventDefault(),this.FPopupClose=1,this.FMdx=Math.round(t.screenX),this.FMdy=Math.round(t.screenY),e=this.FHasCaption&&""!==this.FFormFileName?this.GetContainer().parentNode.getBoundingClientRect():this.GetContainer().getBoundingClientRect(),this.FDlgX=Math.round(pas.System.Int(e.left)),this.FDlgY=Math.round(pas.System.Int(e.top)),this.FDown=!0,this.FCaptured$1||(this.FCaptured$1=!0,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(3,2)),document.body.addEventListener("mousemove",this.FDocMouseMovePtr),document.body.addEventListener("mouseup",this.FDocMouseUpPtr)),!0,!0},this.HandleCloseClick=function(t){var e=!1;return e=!0,null!=this.FOnCloseQuery&&this.FOnCloseQuery(this,{get:function(){return e},set:function(t){e=t}}),e&&this.Close(),!0,!0},this.SetLeft=function(t){var e=null;pas["WEBLib.Controls"].TControl.SetLeft.apply(this,arguments),this.FPopup&&null!=(e=this.FPopupElement)&&e.style.setProperty("left",pas.SysUtils.IntToStr(t)+"px")},this.SetTop=function(t){var e=null;pas["WEBLib.Controls"].TControl.SetTop.apply(this,arguments),this.FPopup&&null!=(e=this.FPopupElement)&&e.style.setProperty("top",pas.SysUtils.IntToStr(t)+"px")},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.FDoClickPtr=null,this.FKeyDownPtr$1=null,this.FOrientationChangePtr=null,this.FHashChangePtr=null},this.GetMethodPointers=function(){pas["WEBLib.Controls"].TControl.GetMethodPointers.call(this),null===this.FLoadedPtr&&(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.VisibleChanged=function(){pas["WEBLib.Controls"].TControl.VisibleChanged.call(this),null!=this.FLayer$1?this.FVisible?this.FLayer$1.style.setProperty("display",""):this.FLayer$1.style.setProperty("display","none"):null!=this.GetContainer()&&""!==this.FFormContainer&&(this.FVisible?this.GetContainer().style.setProperty("display",""):this.GetContainer().style.setProperty("display","none"))},this.Resize$1=function(){var t=0,e=0,i=0,s=0,n=null;if(!(3 in this.FComponentState)&&(this.FIsResizing$1=!0,this.FPopup&&null!=this.FPopupElement?(n=this.FPopupElement.getBoundingClientRect(),i=Math.round(n.right-n.left-2),this.FBorder in rtl.createSet(3,4)?(e=this.GetCaptionHeight(),s=Math.round(n.bottom-n.top-e-2)):s=Math.round(n.bottom-n.top-2)):(i=window.innerWidth,s=window.innerHeight),this.UpdateControlSize(i,s),pas["WEBLib.Controls"].IsAndroid()&&"INPUT"===document.activeElement.tagName||this.AlignControl(this),this.DoResize(),this.FIsResizing$1=!1,!this.IsUpdating())){-1===this.FOrigRect.Left&&-1===this.FOrigRect.Top&&this.InitAnchoring();for(var r=0,o=this.GetControlsCount()-1;r<=o;r++)t=r,this.GetControls(t).UpdateAnchoring()}},this.CreateControl=function(){(this.FVisible||this.FPopup)&&(pas["WEBLib.Controls"].TControl.CreateControl.call(this),this.UpdateSize())},this.DoClose=function(t){null!=this.FModalProc&&0!==t.get()&&(this.FModalProc(this.FModalResult),this.FModalProc=null)},this.BindEvents=function(){pas["WEBLib.Controls"].TControl.BindEvents.call(this),"loading"!==document.readyState&&null!=this.FOnDOMContentLoaded&&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)},this.UnbindEvents=function(){pas["WEBLib.Controls"].TControl.UnbindEvents.call(this),null!=this.FLayer$1&&0===this.FPopupClose&&this.FLayer$1.removeEventListener("click",this.FDoClickPtr),null!=this.FResizeObserver&&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(),null!=this.FOnCreate&&this.FOnCreate(this),this.FCreating=!1,this.EndUpdate(),this.UpdateChildren(this),this.Realign(),this.DoResize()},this.Realign=function(){var t=null,e=null,i=pas.Types.TRect.$new();""!==this.FFormContainer&&0!==this.FAlign&&null!=(t=document.getElementById(this.FFormContainer))&&(0===(e=t.getBoundingClientRect()).width&&0===e.height&&"absolute"===t.style.getPropertyValue("position")?i.$assign(pas["WEBLib.Controls"].GetHTMLElementAbsoluteRect(t)):i.$assign(pas.Types.Rect(Math.round(e.left),Math.round(e.top),Math.round(e.right),Math.round(e.bottom))),this.SetBoundsInt(i.Left,i.Top,i.Right-i.Left,i.Bottom-i.Top)),pas["WEBLib.Controls"].TControl.Realign.call(this)},this.DoResize=function(){var t,e;t=this.GetWidth(),e=this.GetHeight(),t===this.FOldWidth&&e===this.FOldHeight||(this.FOldWidth=t,this.FOldHeight=e,null!=this.FOnResize&&this.FOnResize(this))},this.DoShow=function(){null!=this.FOnShow&&this.FOnShow(this)},this.HandleDoClick$1=function(t){return t.stopPropagation(),0===this.FPopupClose&&this.Close(),!0,!0},this.HandleKeyDown=function(t){var e,i=!1;return e=this.GetKeyCode(t.key,!0),pas.System.Assigned(e)?(27===e&&!(4 in this.FComponentState)&&this.FPopup&&this.Close(),i=!0):i},this.HandleOrientationChange=function(t){var e=0;(this.Resize$1(),this.Realign(),!0,null!=this.FOnOrientationChange)&&(e=window.matchMedia("(orientation: portrait)").matches?1:0,this.FOnOrientationChange(this,e));return null!=this.FOnResize&&this.FOnResize(this),!0},this.GetWidth=function(){var t=0,e=null,i=null;return""!==this.FFormElement&&null!=(i=document.getElementById(this.FFormElement))?(e=i.getBoundingClientRect(),t=Math.round(e.right-e.left)):(this.GetElementHandle()===document.body?(t=window.innerWidth,e=document.documentElement.getBoundingClientRect(),(t=Math.round(e.width))>window.innerWidth&&(t=window.innerWidth)):this.FPopup?t=pas["WEBLib.Controls"].TControl.GetWidth.call(this):0===(t=Math.round(this.GetElementHandle().offsetWidth))&&(t=""!==this.FFormContainer?pas["WEBLib.Controls"].TControl.GetWidth.call(this):window.innerWidth),t)},this.GetHeight=function(){var t=0,e=0,i="",s=null,n=null;return""!==this.FFormElement&&null!=(s=document.getElementById(this.FFormElement))?(n=s.getBoundingClientRect(),t=Math.round(n.bottom-n.top)):(this.GetElementHandle()===document.body?(i=window.getComputedStyle(this.GetElementHandle()).getPropertyValue("margin-top"),i=pas.System.Copy(i,1,i.length-2),e=Math.round(pas.SysUtils.StrToFloat$1(i,pas.SysUtils.TFormatSettings.Invariant())-2),n=document.documentElement.getBoundingClientRect(),(t=Math.round(n.height))>window.innerHeight&&(t=window.innerHeight-Math.max(0,e))):this.FPopup?t=pas["WEBLib.Controls"].TControl.GetHeight.call(this):0===(t=Math.round(this.GetElementHandle().offsetHeight))&&(t=""!==this.FFormContainer?pas["WEBLib.Controls"].TControl.GetHeight.call(this):window.innerHeight),t)},this.GetLeft=function(){var t=0,e=null,i=null;return this.FPopup?t=pas["WEBLib.Controls"].TControl.GetLeft.call(this):""!==this.FFormElement?null!=(e=document.getElementById(this.FFormElement))&&(i=e.getBoundingClientRect(),t=Math.round(i.left)):(e=null,""!==this.FFormContainer&&(e=document.getElementById(this.FFormContainer)),null==e&&(e=this.GetElementHandle()),t=Math.round(e.offsetLeft)),t},this.GetTop=function(){var t=0,e=null,i=null;return this.FPopup?t=pas["WEBLib.Controls"].TControl.GetTop.call(this):""!==this.FFormElement?null!=(e=document.getElementById(this.FFormElement))&&(i=e.getBoundingClientRect(),t=Math.round(i.top)):(e=null,""!==this.FFormContainer&&(e=document.getElementById(this.FFormContainer)),null==e&&(e=this.GetElementHandle()),t=Math.round(e.offsetTop)),t},this.GetClientRect=function(){var t=pas.Types.TRect.$new();return t.$assign(pas["WEBLib.Controls"].TControl.GetClientRect.call(this)),t},this.CreateElement=function(){var e=null,i=null,s=null;return this.FPopup||null==this.FormContainerElement()?(e=document.createElement("DIV"),this.FLayer$1=this.CreateLayer(),document.body.appendChild(this.FLayer$1),i=this.FLayer$1,0===this.FPopupClose&&(this.GetMethodPointers(),i.addEventListener("click",this.FDoClickPtr)),i.style.setProperty(pas["WEBLib.Controls"].CSSZIndex,t.Application.MaxZIndexStr()),2===this.FBorder&&(e.style.setProperty("resize","both"),e.style.setProperty("overflow","auto")),this.FHasCaption=!1,this.FBorder in rtl.createSet(2,3,4)&&(s=this.CreateCaption(),e.appendChild(s)),e):e=this.FormContainerElement()},this.UpdateElement=function(){var t="",e=null;this.FCreating||(pas["WEBLib.Controls"].TControl.UpdateElement.call(this),this.IsUpdating()||(null==this.GetElementHandle()&&null==this.GetContainer()||""!==this.FCaption&&(this.FPopup?null!=this.FCaptionElement&&(null!=(e=this.FCaptionElement.childNodes.item(0))&&(e.nodeValue=this.FCaption),this.FShowClose&&null==this.FCaptionCloseElement&&(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="✖",this.FCaptionElement.appendChild(this.FCaptionCloseElement),this.FCaptionCloseElement.addEventListener("click",rtl.createSafeCallback(this,"HandleCloseClick"))),pas["WEBLib.Controls"].SetHTMLElementFont(this.FCaptionElement,this.FFont,!(""===this.FElementCaptionClassName&&0===this.FElementFont))):window.document.title=this.FCaption),null!=this.GetContainer()&&(t=pas["WEBLib.Graphics"].ColorToHTML(this.FColor),null!=this.GetContainer()&&(-1===this.FColor||16777215===this.FColor||this.FPopup||""!==this.FElementClassName||this.GetContainer().style.setProperty(pas["WEBLib.Controls"].CSSBackground,t),(""!==this.FElementClassName||-1===this.FColor||16777215===this.FColor&&!this.FPopup)&&this.GetContainer().style.removeProperty(pas["WEBLib.Controls"].CSSBackground),""!==this.FElementClassName||this.FPopup||document.documentElement.style.setProperty("height","100%"),pas["WEBLib.Controls"].SetHTMLElementFont(this.GetContainer(),this.FFont,!(""===this.FElementClassName&&0===this.FElementFont))),this.FPopup?(null==this.FPopupElement&&(this.FPopupElement=this.GetContainer()),this.FShadow?this.FPopupElement.style.setProperty("box-shadow","3px 3px 3px silver"):this.FPopupElement.style.removeProperty("box-shadow"),this.FPopupElement.style.setProperty("border","1px solid gray")):this.GetContainer().style.removeProperty("box-shadow"))))},this.ContainerElement=function(){return this.FormContainerElement()},this.FormContainerElement=function(){var t=null;return 4 in this.FComponentState&&null!=this.FDesignContainer&&(t=this.FDesignContainer),""!==this.FFormContainer?null==(t=document.getElementById(this.FFormContainer))&&(t=document.body):t=document.body,t},this.GetElementBindHandle=function(){return 4 in this.FComponentState||""!==this.FFormContainer?window:this.FPopup?pas["WEBLib.Controls"].TControl.GetElementBindHandle.call(this):window},this.GetElementHandle=function(){return this.FPopup?pas["WEBLib.Controls"].TControl.GetElementHandle.call(this):this.FormContainerElement()},this.SetElementClassName=function(t){pas["WEBLib.Controls"].TControl.SetElementClassName.apply(this,arguments),this.FPopup&&null!=this.FPopupElement&&this.FPopupElement.setAttribute("class",t)},this.CloseQuery=function(){var t=!1;return t=!0,null!=this.FOnCloseQuery&&this.FOnCloseQuery(this,{get:function(){return t},set:function(e){t=e}}),t},this.LoadDFMValues=function(){},this.Init=function(){},this.CreateLayer=function(){var e=null;return(e=document.createElement("SPAN")).style.setProperty("top","0"),e.style.setProperty("left","0"),e.style.setProperty("right","0"),e.style.setProperty("bottom","0"),e.style.setProperty("webkit-user-select","none"),e.style.setProperty("moz-user-select","none"),e.style.setProperty("khtml-user-select","none"),e.style.setProperty("ms-user-select","none"),e.style.setProperty("user-select","none"),e.style.setProperty("position","absolute"),e.style.setProperty("z-index",t.Application.MaxZIndexStr()),e},this.CreateCaption=function(){var e;return e=pas.SysUtils.IntToStr(t.Application.FFormCaptionHeight),this.FCaptionElement=document.createElement("DIV"),this.FCaptionElement.innerHTML=this.FCaption,this.FCaptionElement.style.setProperty(pas["WEBLib.Controls"].CSSBackground,pas["WEBLib.Graphics"].ColorToHTML(t.Application.FThemeColor)),this.FCaptionElement.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(t.Application.FThemeTextColor)),this.FCaptionElement.style.setProperty("cursor","move"),this.FCaptionElement.style.setProperty("height",e+"px"),this.FCaptionElement.style.setProperty("line-height",e+"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"),""!==this.FElementCaptionClassName&&this.FCaptionElement.setAttribute("class",this.FElementCaptionClassName),pas["WEBLib.Controls"].SetHTMLElementFont(this.FCaptionElement,this.FFont,!(""===this.FElementCaptionClassName&&0===this.FElementFont)),null==this.FTitleDownPtr&&this.GetMethodPointers(),this.FCaptionElement.innerHTML=this.FCaption,this.FCaptionElement.addEventListener("mousedown",this.FTitleDownPtr),this.FHasCaption=!0,this.FCaptionElement},this.GetCaptionHeight=function(){var t=0,e=null;return t=0,null!=this.FCaptionElement&&this.FBorder in rtl.createSet(3,4)&&(e=this.FCaptionElement.getBoundingClientRect(),t=Math.round(e.bottom-e.top)),t},this.SetColorScheme=function(e){var i="";if(t.Application.FThemed){var s=e;2===s?(i="label,option,td,table,ul,li {background-color: #202124; color: #BEC1C6;}\r\nbody,input,textarea,select,fieldset {background-color: #202124; color: #BEC1C6; border: 1px solid gray;}\r\ninput:focus, textarea:focus, select:focus, span:focus { border: 1px solid silver; outline: none !important;}",this.AddCSS("appscheme",i)):1===s&&this.RemoveCSS("appscheme")}},this.GetHTMLFileName=function(){return this.$module.$name+t.Application.GetFormExtension()},this.LoadedDone=function(){t.Application.TriggerNotification()},this.Loaded=function(){pas["WEBLib.Controls"].TControl.Loaded.call(this),this.LoadedDone()},this.ColorChanging=function(){pas["WEBLib.Controls"].TControl.ColorChanging.call(this),null!=this.GetContainer()&&this.GetContainer().style.setProperty(pas["WEBLib.Controls"].CSSBackground,pas["WEBLib.Graphics"].ColorToHTML(this.FColor))},this.CreateInitialize=function(){pas["WEBLib.Controls"].TControl.CreateInitialize.call(this),this.FAllowTouch=!0,this.FModalResult=0,this.FFormStyle=0,this.FBorder=2,this.FShadow=!0,this.FShowClose=!0,this.FTimerID=-1,this.FCaptionElement=null,this.FColor=16777215,window.addEventListener("load",this.FLoadedPtr)},this.Create$2=function(t){return this.FNoHTML=!1,this.FCreating=!0,this.FFormContainer=t,""===t?pas["WEBLib.Controls"].TControl.Create$2.call(this,pas["WEBLib.WebTools"].cBodyTag):pas["WEBLib.Controls"].TControl.Create$2.call(this,t),this.FFormElement="",this.FModalResult=0,this.FFormStyle=0,this.DoCreate(),this},this.Create$5=function(t,e){return this.FCreating=!0,this.FFormContainer=t,pas["WEBLib.Controls"].TControl.Create$2.call(this,t),e.set(this),this.FFormElement="",this.FModalResult=0,this.FFormStyle=0,this.DoCreate(),this},this.Create$1=function(t){return this.FNoHTML=!1,this.FCreating=!0,this.FResizeObserver=null,pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments),this.FBorder=1,this.FFormFileName="",this.FPopupMode=0,this.FPopupClose=0,this.FPopup=!0,this.FPosition=4,this.FPopupOpacity=1,this},this.Destroy=function(){this.FVisible&&this.Close(),null!=this.FOnDestroy&&this.FOnDestroy(this),pas["WEBLib.Controls"].TControl.Destroy.call(this),null!=this.FLayer$1&&(this.FormContainerElement()===this.FLayer$1.parentNode&&this.FormContainerElement().removeChild(this.FLayer$1),this.FLayer$1=null)},this.Close=function(){var i=0,s=null;this.CloseQuery()&&(this.UnbindEvents(),i=1,-1!==this.FTimerID&&(window.clearInterval(this.FTimerID),this.FTimerID=-1),null!=this.FOnClose&&this.FOnClose(this,{get:function(){return i},set:function(t){i=t}}),0!==i&&(null!=this.FLayer$1&&(this.GetContainer().parentNode===this.FLayer$1?this.FLayer$1.removeChild(this.GetContainer()):this.GetContainer().parentNode.parentNode===this.FLayer$1&&this.FLayer$1.removeChild(this.GetContainer().parentNode),this.FContainer=null,this.FormContainerElement()===this.FLayer$1.parentNode&&(this.FormContainerElement().removeChild(this.FLayer$1),t.Application.ChangeMaxZIndex(-1)),this.FLayer$1=null),""===this.FFormFileName?""!==this.FFormElement&&null!=this.GetContainer()?(this.GetContainer().innerHTML="",this.FContainer=null):null!=this.GetContainer()&&(this.FormContainerElement()===this.GetContainer().parentNode&&this.FormContainerElement().removeChild(this.GetContainer()),this.FContainer=null):""!==this.FFormElement&&(this.GetContainer().innerHTML="",this.FContainer=null),this.FFormElement!==this.FFormContainer&&""!==this.FFormElement&&null!=(s=document.getElementById(this.FFormElement))&&(s.innerHTML=""),this.DoClose({get:function(){return i},set:function(t){i=t}}),2!==i||3 in this.FComponentState||(e.ReleaseForm(this),t.Application.FMainForm===this&&(t.Application.FMainForm=null)),t.Application.FActiveForm=this.FPrevActiveForm,this.SetVisible(!1)))},this.IsMiletus=function(){var t=!1,e=null;e=this.$class.ClassType(),t=!1;do{if(null!=(e=e.$ancestor)&&"TMiletusForm"===e.$classname){t=!0;break}}while(null!=e&&"TForm"!==e.$classname);return t},this.AddCSS=function(t,e){var i,s,n;i=t,s=e,(n=document.getElementById(i))?n.innerHTML=s:((n=document.createElement("style")).type="text/css",n.id=i,n.innerHTML=s,document.getElementsByTagName("head")[0].appendChild(n))},this.RemoveCSS=function(t){var e;null!=(e=document.getElementById(t))&&document.head.removeChild(e)}})),rtl.createClass(this,"TForm",this.TCustomForm,(function(){var e=this.$rtti;e.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),e.addProperty("Caption",2,rtl.string,"FCaption","SetCaption"),e.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor","SetColor"),e.addProperty("CSSLibrary",0,t.$rtti.TCSSLibrary,"FCSSLibrary","FCSSLibrary",{Default:t.TCSSLibrary.cssNone}),e.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),e.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),e.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),e.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),e.addProperty("FormContainer",2,pas["WEBLib.Controls"].$rtti.TElementID,"FFormContainer","SetFormContainer"),e.addProperty("FormStyle",3,t.$rtti.TFormStyle,"GetFormStyle","SetFormStyle"),e.addProperty("Menu",0,pas["WEBLib.Controls"].$rtti.TCustomControl,"FMenu","FMenu"),e.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),e.addProperty("Shadow",2,rtl.boolean,"FShadow","SetShadow",{Default:!0}),e.addProperty("ShowClose",0,rtl.boolean,"FShowClose","FShowClose",{Default:!0}),e.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder"),e.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",{Default:!0}),e.addProperty("OnBeforeUnload",0,t.$rtti.TBeforeUnloadEvent,"FOnBeforeUnload","FOnBeforeUnload"),e.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),e.addProperty("OnClose",0,t.$rtti.TCloseEvent,"FOnClose","FOnClose"),e.addProperty("OnCloseQuery",0,t.$rtti.TCloseQueryEvent,"FOnCloseQuery","FOnCloseQuery"),e.addProperty("OnCreate",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnCreate","FOnCreate"),e.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),e.addProperty("OnDeactivate",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDeactivate","FOnDeactivate"),e.addProperty("OnDestroy",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDestroy","FOnDestroy"),e.addProperty("OnDOMContentLoaded",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDOMContentLoaded","FOnDOMContentLoaded"),e.addProperty("OnHashChange",0,t.$rtti.THashChangeEvent,"FOnHashChange","FOnHashChange"),e.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnResize","FOnResize"),e.addProperty("OnShow",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnShow","FOnShow"),e.addProperty("OnScroll",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnScroll","FOnScroll"),e.addProperty("OnOrientationChange",0,t.$rtti.TOrientationChangeEvent,"FOnOrientationChange","FOnOrientationChange"),e.addProperty("OnPaint",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnPaint","FOnPaint"),e.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti.TTouchEvent,"FOnTouchStart","FOnTouchStart"),e.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti.TTouchEvent,"FOnTouchMove","FOnTouchMove"),e.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti.TTouchEvent,"FOnTouchEnd","FOnTouchEnd"),e.addProperty("OnUnload",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnUnload","FOnUnload")})),rtl.createClass(this,"TCustomFrame",pas["WEBLib.Controls"].TCustomHTMLDiv,(function(){this.$init=function(){pas["WEBLib.Controls"].TCustomHTMLDiv.$init.call(this),this.FAutoScroll=!1,this.FAutoSize=!1,this.FBiDiMode$1=0,this.FConstraints=null,this.FCtl3D$1=!1,this.FDockSite=!1,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=!1,this.FParentCtl3D$1=!1,this.FPopupMenu=null},this.$final=function(){this.FConstraints=void 0,this.FOnAlignInsertBefore=void 0,this.FOnAlignPosition=void 0,this.FOnCanResize=void 0,this.FOnConstrainedResize=void 0,this.FOnContextPopup=void 0,this.FOnDockDrop=void 0,this.FOnDockOver=void 0,this.FOnEndDock=void 0,this.FOnGesture=void 0,this.FOnGetSiteInfo=void 0,this.FOnMouseActivate=void 0,this.FOnMouseWheelDown$1=void 0,this.FOnMouseWheelUp$1=void 0,this.FOnStartDock=void 0,this.FOnUnDock=void 0,this.FPadding=void 0,this.FPopupMenu=void 0,pas["WEBLib.Controls"].TCustomHTMLDiv.$final.call(this)},this.SetConstraints=function(t){this.FConstraints.Assign(t)},this.SetPopupMenu=function(t){this.FPopupMenu=t},this.UpdateElement=function(){var t;pas["WEBLib.Controls"].TControl.UpdateElement.call(this),t=this.FColor in rtl.createSet(15790320,-1,16777215,16711422),null!=this.GetElementHandle()&&!this.IsUpdating()&&4 in this.FComponentState&&t&&this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(15790320))},this.Create$1=function(e){return pas["WEBLib.Controls"].TControl.Create$1.call(this,e),this.FConstraints=t.TSizeConstraints.$create("Create$1",[this]),this},this.Destroy=function(){rtl.free(this,"FConstraints"),pas["WEBLib.Controls"].TCustomControl.Destroy.call(this)}})),rtl.createClass(this,"TFrame",this.TCustomFrame,(function(){var e=this.$rtti;e.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),e.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),e.addProperty("AutoScroll",0,rtl.boolean,"FAutoScroll","FAutoScroll",{Default:!1}),e.addProperty("AutoSize",0,rtl.boolean,"FAutoSize","FAutoSize",{Default:!1}),e.addProperty("BiDiMode",4,pas["WEBLib.Controls"].$rtti.TBiDiMode,"FBiDiMode$1","FBiDiMode$1"),e.addProperty("Constraints",2,t.$rtti.TSizeConstraints,"FConstraints","SetConstraints"),e.addProperty("DockSite",0,rtl.boolean,"FDockSite","FDockSite",{Default:!1}),e.addProperty("DoubleBuffered",0,rtl.boolean,"FDoubleBuffered","FDoubleBuffered",{Default:!1}),e.addProperty("DragCursor",0,pas["WEBLib.Controls"].$rtti.TCursor,"FDragCursor","FDragCursor",{Default:12}),e.addProperty("DragKind",0,pas["WEBLib.Controls"].$rtti.TDragKind,"FDragKind","FDragKind",{Default:pas["WEBLib.Controls"].TDragKind.dkDrag}),e.addProperty("DragMode",0,pas["WEBLib.Controls"].$rtti.TDragMode,"FDragMode$1","FDragMode$1",{Default:pas["WEBLib.Controls"].TDragMode.dmManual}),e.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),e.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor","SetColor"),e.addProperty("Ctl3D",4,rtl.boolean,"FCtl3D$1","FCtl3D$1"),e.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),e.addProperty("Padding",0,pas["WEBLib.Controls"].$rtti.TPadding,"FPadding","FPadding"),e.addProperty("ParentBackground",0,rtl.boolean,"FParentBackground","FParentBackground",{Default:!0}),e.addProperty("ParentBiDiMode",0,rtl.boolean,"FParentBiDiMode","FParentBiDiMode",{Default:!0}),e.addProperty("ParentColor",2,rtl.boolean,"FParentColor","SetParentColor",{Default:!1}),e.addProperty("ParentCtl3D",0,rtl.boolean,"FParentCtl3D$1","FParentCtl3D$1",{Default:!0}),e.addProperty("ParentDoubleBuffered",0,rtl.boolean,"FParentDoubleBuffered","FParentDoubleBuffered",{Default:!0}),e.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),e.addProperty("ParentShowHint",0,rtl.boolean,"FParentShowHint","FParentShowHint"),e.addProperty("PopupMenu",2,pas["WEBLib.Menus"].$rtti.TPopupMenu,"FPopupMenu","SetPopupMenu"),e.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",{Default:!1}),e.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder"),e.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",{Default:!0}),e.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),e.addProperty("OnAlignInsertBefore",0,t.$rtti.TAlignInsertBeforeEvent,"FOnAlignInsertBefore","FOnAlignInsertBefore"),e.addProperty("OnAlignPosition",0,t.$rtti.TAlignPositionEvent,"FOnAlignPosition","FOnAlignPosition"),e.addProperty("OnCanResize",0,t.$rtti.TCanResizeEvent,"FOnCanResize","FOnCanResize"),e.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),e.addProperty("OnConstrainedResize",0,t.$rtti.TConstrainedResizeEvent,"FOnConstrainedResize","FOnConstrainedResize"),e.addProperty("OnContextPopup",0,t.$rtti.TContextPopupEvent,"FOnContextPopup","FOnContextPopup"),e.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),e.addProperty("OnDockDrop",0,t.$rtti.TDockDropEvent,"FOnDockDrop","FOnDockDrop"),e.addProperty("OnDockOver",0,t.$rtti.TDockOverEvent,"FOnDockOver","FOnDockOver"),e.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti.TDragDropEvent,"FOnDragDrop","FOnDragDrop"),e.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti.TDragOverEvent,"FOnDragOver","FOnDragOver"),e.addProperty("OnEndDock",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FOnEndDock","FOnEndDock"),e.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FonEndDrag","FonEndDrag"),e.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnEnter","FOnEnter"),e.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnExit","FOnExit"),e.addProperty("OnGesture",0,t.$rtti.TGestureEvent,"FOnGesture","FOnGesture"),e.addProperty("OnGetSiteInfo",0,t.$rtti.TGetSiteInfoEvent,"FOnGetSiteInfo","FOnGetSiteInfo"),e.addProperty("OnMouseActivate",0,t.$rtti.TMouseActivateEvent,"FOnMouseActivate","FOnMouseActivate"),e.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseDown","FOnMouseDown"),e.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseEnter","FOnMouseEnter"),e.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseLeave","FOnMouseLeave"),e.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti.TMouseMoveEvent,"FOnMouseMove","FOnMouseMove"),e.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseUp","FOnMouseUp"),e.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti.TMouseWheelEvent,"FOnMouseWheel","FOnMouseWheel"),e.addProperty("OnMouseWheelDown",0,t.$rtti.TMouseWheelUpDownEvent,"FOnMouseWheelDown$1","FOnMouseWheelDown$1"),e.addProperty("OnMouseWheelUp",0,t.$rtti.TMouseWheelUpDownEvent,"FOnMouseWheelUp$1","FOnMouseWheelUp$1"),e.addProperty("OnResize",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnResize","FOnResize"),e.addProperty("OnStartDock",0,t.$rtti.TStartDockEvent,"FOnStartDock","FOnStartDock"),e.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti.TStartDragEvent,"FOnStartDrag","FOnStartDrag"),e.addProperty("OnUnDock",0,t.$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(t){return this.AMessage===t.AMessage&&this.AFile===t.AFile&&this.ALineNumber===t.ALineNumber&&this.AColNumber===t.AColNumber&&this.AStack===t.AStack&&this.AError===t.AError},this.$assign=function(t){return this.AMessage=t.AMessage,this.AFile=t.AFile,this.ALineNumber=t.ALineNumber,this.AColNumber=t.AColNumber,this.AStack=t.AStack,this.AError=t.AError,this}})),this.THintPosition={0:"hpLeft",hpLeft:0,1:"hpTop",hpTop:1,2:"hpRight",hpRight:2,3:"hpBottom",hpBottom:3},this.TOnlineStatus={0:"osOnline",osOnline:0,1:"osOffline",osOffline:1},rtl.createClass(this,"TApplication",pas["WEBLib.Controls"].TControl,(function(){this.$init=function(){pas["WEBLib.Controls"].TControl.$init.call(this),this.FAppContainer="",this.FMainFormOnTaskBar=!1,this.FCanCreateForm=!1,this.FAppInitializing=!1,this.FLastReq=null,this.FFormCaptionHeight=0,this.FActiveForm=null,this.FMainForm=null,this.FInitFormClassName="",this.FFormStack=null,this.FParameters=null,this.FIsRedirect=!1,this.FLanguage=0,this.FOnError=null,this.FOnHashChange=null,this.FAutoFormRoute=!1,this.FErrorType=0,this.FOnOnlineChange=null,this.FOnActivate=null,this.FThemeTextColor=0,this.FThemeColor=0,this.FThemed=!1,this.FThemeButtonClassName="",this.FOnOAuthToken=null,this.FOnOAuthCallBack=null,this.FMaxZIndex=0,this.FHintPause=0,this.FHintHidePause=0,this.FHintPosition=0,this.FHintClassName="",this.FOnExit$1=null,this.FOnException=null},this.$final=function(){this.FLastReq=void 0,this.FActiveForm=void 0,this.FMainForm=void 0,this.FFormStack=void 0,this.FParameters=void 0,this.FOnError=void 0,this.FOnHashChange=void 0,this.FOnOnlineChange=void 0,this.FOnActivate=void 0,this.FOnOAuthToken=void 0,this.FOnOAuthCallBack=void 0,this.FOnExit$1=void 0,this.FOnException=void 0,pas["WEBLib.Controls"].TControl.$final.call(this)},this.DoHandleError=function(e){var i,s=!1,n=t.TApplicationError.$new(),r=null,o=null,l=null,a="",h=!1,u=void 0,d=null;if(h=!0,null==e.message&&(h=!1),"ResizeObserver loop limit exceeded"===e.message)return s;if(!h)return n.AMessage="Undefined JavaScript exception",n.AFile="",n.ALineNumber=0,n.AColNumber=0,n.AError=null,null!=this.FOnError&&this.FOnError(this,t.TApplicationError.$clone(n),{get:function(){return s},set:function(t){s=t}}),s;if(n.AMessage=e.message,n.AFile=e.filename,n.ALineNumber=e.lineno,n.AColNumber=e.colno,n.AError=e.error,n.AStack="",a="",u=null,null!=e.error){e.error.stack&&(n.AStack=e.error.stack),e.error.fMessage&&(n.AMessage=e.error.fMessage),e.error.hasOwnProperty("FJSError")&&(u=e.error.FJSError),a=function(t){var e="";for(var i in t)t.hasOwnProperty(i)&&(e+=i+"::"+t[i]+"\n");return e}(e.error)}pas.System.Assigned(u)&&(d=e.error,null!=this.FOnException&&this.FOnException(this,d)),s=!1,i="ERROR<br>"+n.AMessage+" | "+a+n.AStack+"<BR> at "+n.AFile+" ["+pas.SysUtils.IntToStr(n.ALineNumber)+":"+pas.SysUtils.IntToStr(n.AColNumber)+"]";var c=this.FErrorType;return 3===c?null!=(r=document.getElementById("tmserrormessage"))?rtl.asExt(r.firstChild,HTMLElement).innerHTML=i:((r=document.createElement("DIV")).setAttribute("id","tmserrormessage"),r.style.setProperty("position","absolute"),r.style.setProperty("font-family","Courier"),r.style.setProperty("font-size","8pt"),r.style.setProperty("bottom","0"),r.style.setProperty("width","100%"),r.style.setProperty("height","100px"),r.style.setProperty("background","#ff0000"),r.style.setProperty("color","#ffffff"),document.body.style.setProperty("padding","0"),document.body.style.setProperty("margin","0"),(o=document.createElement("SPAN")).style.setProperty("margin-left","4px"),o.style.setProperty("float","left"),o.style.setProperty("overflow","hidden"),o.style.setProperty("display","block"),o.innerHTML=i,r.appendChild(o),(l=document.createElement("SPAN")).style.setProperty("font-family","Courier"),l.style.setProperty("font-size","8pt"),l.style.setProperty("font-weight","bold"),l.style.setProperty("position","absolute"),l.style.setProperty("width","20px"),l.style.setProperty("vertical-align","top"),l.style.setProperty("cursor","pointer"),l.style.setProperty("text-align","right"),l.style.setProperty("right","4px"),l.style.setProperty("display","block"),l.innerHTML="X",l.onclick=rtl.createSafeCallback(this,"DoErrorClose"),r.appendChild(l),document.body.appendChild(r)):2===c?window.alert(i):1===c&&(this.AddControlLink("googlematerial","https://fonts.googleapis.com/icon?family=Material+Icons"),pas["WEBLib.Dialogs"].MessageDlg(i,1,rtl.createSet(2),null)),null!=this.FOnError&&this.FOnError(this,t.TApplicationError.$clone(n),{get:function(){return s},set:function(t){s=t}}),s},this.DoHandleExit=function(t){return!0,null!=this.FOnExit$1&&this.FOnExit$1(this),!0},this.DoHashChange=function(t){var e="",i=null,s=null,n=null,r=!1;return!0,!this.FAutoFormRoute||(e=location.hash,pas.System.Delete({get:function(){return e},set:function(t){e=t}},1,1),r=!1,null!=this.FOnHashChange&&this.FOnHashChange(this,e,{get:function(){return r},set:function(t){r=t}}),r||(""===e&&(e=this.FInitFormClassName),""!==e&&(""===this.FInitFormClassName&&(this.FInitFormClassName=this.FActiveForm.$classname),null!=(i=pas.Classes.GetClass(e))&&(n=document.body,this.CreateForm$6(i,n,{get:function(){return s},set:function(t){s=t}})))),!0)},this.DoErrorClose=function(t){return document.body.removeChild(t.target.parentElement),!0,!0},this.DoUpdateOnlineStatus=function(t){return!0,null!=this.FOnOnlineChange&&(window.navigator.onLine?this.FOnOnlineChange(this,0):this.FOnOnlineChange(this,1)),!0},this.DoVisibilityChange=function(t){var e;return!0,e="visible"===document.visibilityState,null!=this.FOnActivate&&this.FOnActivate(this,e),!0},this.GetFormExtension=function(){return 0!==this.FLanguage?"_"+pas["WEBLib.Lang"].GetLanguageISO639_1Code(this.FLanguage)+pas["WEBLib.WebTools"].cHTMLExt:pas["WEBLib.WebTools"].cHTMLExt};this.GetAuthorizationPageHTML=function(t){function e(t,e){var i=0,s="";s='<!doctype html>\r\n<html lang="en">\r\n<head>\r\n <title>Authentication Result</title>\r\n <meta name="viewport" content="width=device-width, initial-scale=1">\r\n</head>\r\n<body>\r\n<style>\r\n hr\r\n {\r\n border: none;\r\n height: 1px;\r\n background-color: rgb(171, 171, 171);\r\n }\r\n div.container\r\n {\r\n position: fixed;\r\n font-family: Arial;\r\n font-size: 12pt;\r\n max-width: 100%;\r\n max-height: 100%;\r\n top: 50%;\r\n left: 50%;\r\n transform: translate(-50%, -50%);\r\n }\r\n div.section\r\n {\r\n display: inline-block;\r\n margin: 15px;\r\n padding: 5px;\r\n float: left;\r\n }\r\n div.image img\r\n {\r\n height: 100%;\r\n }\r\n div.text\r\n {\r\n padding-top: 15px;\r\n }\r\n div.text2\r\n {\r\n font-size: 18pt;\r\n color: #PLACEHOLDERCOLOR#;\r\n }\r\n span.title\r\n {\r\n font-size: 26px;\r\n }\r\n</style>\r\n <div class="container">\r\n <div class="section image">\r\n <img src="#PLACEHOLDERIMAGE#">\r\n </div>\r\n <div class="section text">\r\n #PLACEHOLDERTEXT#\r\n </div>\r\n </div>\r\n </body>\r\n</html>';for(var n=0,r=rtl.length(t)-1;n<=r;n++)i=n,s=pas.SysUtils.StringReplace(s,t[i],e[i],rtl.createSet(0));return s}return e(["#PLACEHOLDERIMAGE#","#PLACEHOLDERTEXT#","#PLACEHOLDERCOLOR#"],t?["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAA7DAAAOwwHHb6hkAAACC0lEQVR4nO2Zv3GDMBSHv+QyQEbICM4EOW+Q9BS4o2QTU9LZBQNkg6zgETyCR0iRkOMIAv3Xk0+/zsiI931nI3iCkpKSkpKSkpKSkpJ7SDN0x2bo3nW//xCymNhphu4E1MAN2PdVe9k6524ETODHXIHXvmpva+c9BqwpWhbgAV6Ar61zsxeggB+z+x1XJmsBG/Bj6mboWtVgtvcATfhpPvqq/ZwfzFKABTwoVobsBFjCj7kyWxmyugc4wsPCypCNAA/wY/L7C3iEP/dVe5geEC8gJDwIFxAaHgQLiAEPQgXEggeBAmLCgzABseFBkIAU8CBEQCp4ECAgJTwYChibCzYXWpmv9jCVFTwYCJgVa31BxXwucapFS4CiWOsLS4EHDQEbxRoXIAkeNgRoFqtdiDR4WBFgWOxmQRLhQdEQsSi2bobuqBqUCg8LvwDHYg991Z49zjeNd3iYCfBU7J8E6fAAT7PPOw9znpqhA3hDODz8F7Dnp2vqKmJ1O8ogQeFh+R7wjB8JrgkOD4plUICEKPCw/hyQSkI0eNh+EowtISo86L0LxJIQHR703wZDS0gCD2b9gFASksGDeUfIt4Sk8GDRE/QoITk8WDZFPUgQAQ8OXWEHCWLgwbEtbiFBFDx42BcwkCAOHjxtjGhIEAkPHneGViSIhQfPW2MLEkTDQ4C9wYmEi3T4kpKSkm+5ax+YhPsUTQAAAABJRU5ErkJggg==",'<div class="text2">Application succesfully authorized</div>You can close this browser window',"rgb(104, 164, 144)"]:["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABtElEQVR4nO2bUY7CMAxEhz0NB+EgrDjXCg6yB+E4+9NKCAiN7XHcjf1+ED+Z6ahNHScFiqIoBNwvp+v9crpG+3hG6+sgFQFwXv7ejj+/31JBDyy+ugN4ElkJD8HqqyuAhohYjA3D12YAGyIiMSYsXx8D6BTpFmPB9NUMQCjSJcaA7ettAEqRTTErHr5eAjCKfBSz4OXryzhgizOzWCJd/Fs8HoFHzHeCtxf2JNgt3MMID8zXoMpAtDarEDIbidJklMJUQ6MDty6GNDSNRdxtluWwhReDUfONKADAx2jkZCsOAOAaXn4pY2let6oAAN/qTIG61lAHAOwmBFO1aQoACA/BXGqbAwDCQqCsOCkBAMNDoC23aQEAw0Kg9hqoAQDuIdAbLfQAALcQXFptLgEA9BDc+oxeLbF/Qz0C7AFTT4KpX4OpC6HUpXDqxVDq5fBOLn5lbEMkdUssdVM0dVs89cZI6q2x1JujqbfHUx+Q2MPFj/LidUqsKajB05NXS4y6Zl/GurHGe6QOSpLF5jgqqxSb67C0UGzO4/KdYnN/MLEhluOTmYZY+MWvDPU122dzRVHk5g+X6Lw5aVkK9AAAAABJRU5ErkJggg==",'<div class="text2">Application authorization failed</div><br/>Please try again.',"rgb(216, 99, 68)"])},this.GetColorScheme=function(){var t=0;return t=0,"not all"!==window.matchMedia("(prefers-color-scheme)").media&&(t=window.matchMedia("(prefers-color-scheme: dark)").matches?2:1),t},this.ActivateChildScripts=function(t){!function t(e){if(!0===function(t){return"SCRIPT"===t.tagName}(e))e.parentNode.replaceChild(function(t){var e=document.createElement("script");e.async=!1,e.text=t.innerHTML;for(var i=t.attributes.length-1;i>=0;i--)e.setAttribute(t.attributes[i].name,t.attributes[i].value);return e}(e),e);else for(var i=0,s=e.childNodes;i<s.length;)t(s[i++]);return e}(t)},this.ChangeMaxZIndex=function(t){this.FMaxZIndex=this.FMaxZIndex+t},this.TriggerNotification=function(){},this.LockForm=function(t){for(var e=0,i=0,s=t.GetControlsCount()-1;i<=s;i++)e=i,t.GetControls(e).DisableTab()},this.UnLockForm=function(t){for(var e=0,i=0,s=t.GetControlsCount()-1;i<=s;i++)e=i,t.GetControls(e).EnableTab()},this.Create$1=function(t){return 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=!1,this.FAutoFormRoute=!1,this.FThemed=!1,this.FThemeColor=14917120,this.FThemeTextColor=16777215,this.FFormCaptionHeight=22,this.FMaxZIndex=999998,this.FHintPause=200,this.FHintHidePause=250,this.FHintPosition=1,this.FHintClassName="",window.addEventListener("error",rtl.createCallback(this,"DoHandleError")),window.addEventListener("unhandledrejection",rtl.createCallback(this,"DoHandleError")),window.addEventListener("beforeunload",rtl.createSafeCallback(this,"DoHandleExit")),this.FErrorType=0,this},this.Destroy=function(){rtl.free(this,"FFormStack"),rtl.free(this,"FParameters"),pas["WEBLib.Controls"].TControl.Destroy.call(this)},this.MaxZIndexStr=function(){return pas.SysUtils.IntToStr(this.FMaxZIndex)},this.CreateForm=function(t,e){this.CreateForm$2(t,this.FAppContainer,e,null)},this.CreateForm$2=function(t,e,i,s){this.CreateForm$3(t,e,i,s,!0)},this.CreateForm$3=function(e,i,s,n,r){var o=this,l="";function a(r){var a,h=null,u=null,d="",c=!1;return(a=null!=r)?(d=r.target.responseText,(h=(c=pas.SysUtils.LowerCase(i)===pas["WEBLib.WebTools"].cBodyTag)?document.body:document.getElementById(i)).innerHTML=d):h=document.body,(u=e.$create("Create$5",[i,s])).FFormFileName=l,""===u.FFormContainer&&u.SetFormContainer(i),c||(u.FFormElement=i,u.FContainer=h),u.CreateControl(),u.Init(),u.SetColorScheme(t.Application.GetColorScheme()),u.FPrevActiveForm=o.FActiveForm,o.FActiveForm=u,null===o.FMainForm&&(o.FMainForm=u),null!=n&&n(u),!0,a&&o.ActivateChildScripts(h),o.FActiveForm.DoShow(),o.FActiveForm.Resize$1(),!0}if(!this.FIsRedirect){if(this.FAppInitializing){if(!this.FCanCreateForm)return;this.FCanCreateForm=!1}""!==(l=e.GetHTMLFileName())&&r?(this.FLastReq=new XMLHttpRequest,this.FLastReq.addEventListener("load",rtl.createSafeCallback(null,a)),this.FLastReq.open("GET",l),this.FLastReq.send()):a(null)}},this.CreateForm$6=function(t,e,i){this.CreateForm$2(t,e.id,i,null)},this.HasCSS=function(t){var e=!1,i=null,s=0,n="";e=!1;for(var r=0,o=(i=document.querySelectorAll("head > link")).length-1;r<=o;r++)if(s=r,n=i.item(s).href,0===pas.SysUtils.CompareText(n,t)){e=!0;break}return e},this.Initialize=function(){var t,e,i="",s="";if(this.FCanCreateForm=!0,this.FAppInitializing=!0,this.FParameters.Clear(),i=window.location.href,this.InitFormatSettings(pas["WEBLib.WebTools"].GetBrowserLocale()),this.FParameters.SetDelimiter("&"),this.FParameters.FStrictDelimiter=!0,(t=pas.System.Pos("?",i))>0&&(i=pas.System.Copy(i,t+1,i.length)),this.FParameters.SetDelimitedText(i),e="Authentication"==window.name,null!=this.FOnOAuthCallBack&&(-1!==this.FParameters.IndexOfName("oauthcallback")||e))return this.FOnOAuthCallBack(this,i),this.FIsRedirect=!0,void(document.body.innerHTML=this.GetAuthorizationPageHTML(!0));null!=this.FOnOAuthToken&&-1!==this.FParameters.IndexOfName("code")&&(this.FOnOAuthToken(this,i),this.FIsRedirect=!0,s=this.FParameters.GetValue("code"),window.opener&&window.opener.processAuthData&&(window.opener.processAuthData(s),window.close())),window.addEventListener("hashchange",rtl.createSafeCallback(this,"DoHashChange")),window.addEventListener("online",rtl.createSafeCallback(this,"DoUpdateOnlineStatus")),window.addEventListener("offline",rtl.createSafeCallback(this,"DoUpdateOnlineStatus")),document.addEventListener("visibilitychange",rtl.createSafeCallback(this,"DoVisibilityChange")),null!==window.opener&&-1!==this.FParameters.IndexOfName("access_token")&&(this.FIsRedirect=!0,s=this.FParameters.GetValue("access_token"),window.opener&&window.opener.processAuthData&&(window.opener.processAuthData(s),window.close()))},this.InitFormatSettings=function(t){var e,i,s=0;i=t,pas.SysUtils.FormatSettings.ShortDateFormat=pas["WEBLib.WebTools"].GetLocaleShortDateFormat(i),pas.System.Pos("/",pas.SysUtils.FormatSettings.ShortDateFormat)>0&&(pas.SysUtils.FormatSettings.DateSeparator="/"),pas.System.Pos(".",pas.SysUtils.FormatSettings.ShortDateFormat)>0&&(pas.SysUtils.FormatSettings.DateSeparator="."),pas.System.Pos("-",pas.SysUtils.FormatSettings.ShortDateFormat)>0&&(pas.SysUtils.FormatSettings.DateSeparator="-");var n=new Date("Jan 1, 1980 06:07:08 GMT+00:00"),r="";for(r=""==i?navigator.language:i,e=n.toLocaleTimeString(r),pas.System.Pos(":",e)>0&&(pas.SysUtils.FormatSettings.TimeSeparator=":"),pas.System.Pos(".",e)>0&&(pas.SysUtils.FormatSettings.TimeSeparator="."),pas.System.Pos("-",e)>0&&(pas.SysUtils.FormatSettings.TimeSeparator="-"),s=1;s<=7;s++)pas.SysUtils.FormatSettings.ShortDayNames[s-1]=pas["WEBLib.WebTools"].GetLocaleShortDayName(s,i),pas.SysUtils.FormatSettings.LongDayNames[s-1]=pas["WEBLib.WebTools"].GetLocaleLongDayName(s,i);for(s=1;s<=12;s++)pas.SysUtils.FormatSettings.ShortMonthNames[s-1]=pas["WEBLib.WebTools"].GetLocaleShortMonthName(s,i),pas.SysUtils.FormatSettings.LongMonthNames[s-1]=pas["WEBLib.WebTools"].GetLocaleLongMonthName(s,i);pas.SysUtils.FormatSettings.DecimalSeparator=pas["WEBLib.WebTools"].GetLocaleDecimalSeparator(""),"."===pas.SysUtils.FormatSettings.DecimalSeparator?pas.SysUtils.FormatSettings.ThousandSeparator=",":pas.SysUtils.FormatSettings.ThousandSeparator="."},this.Run=function(){this.FCanCreateForm=!0,this.FAppInitializing=!1}})),this.GetParentForm=function(e){var i=null,s=null;for(i=null,s=e;null!=s&&!t.TCustomForm.isPrototypeOf(s);)s=s===e&&null===s.FOwner?e.FParent:s.FOwner;return null!=s&&t.TCustomForm.isPrototypeOf(s)&&(i=rtl.as(s,t.TCustomForm)),i},this.WinWidth=function(){return null!=t.VSIDE?pas["WEBLib.Forms"].VSIDE.clientWidth():window.innerWidth},this.WinHeight=function(){return null!=t.VSIDE?pas["WEBLib.Forms"].VSIDE.clientHeight():window.innerHeight},this.Application=null,this.HandShakeScript=null,this.VSIDE=null,t.$implcode=function(){e.ReleaseForm=function(t){t=rtl.freeLoc(t),t=null}},t.$init=function(){t.HandShakeScript=document.createElement("script"),t.HandShakeScript.id="HandShakeScript",t.HandShakeScript.type="text/javascript",t.HandShakeScript.innerHTML='var IDE = null;\r\nvar TMSWEBCoreClientIdentifier = "unknown";\r\nvar TMSWEBCoreOAuthCallback = "unknown";\r\nfunction HandShake(cid){\r\n TMSWEBCoreClientIdentifier = cid;\r\n}',document.body.appendChild(t.HandShakeScript),t.Application=t.TApplication.$create("Create$1",[null])}}),["WEBLib.Dialogs","WEBLib.WebTools","WEBLib.JSON","WEBLib.Utils","Math"]),rtl.module("WEBLib.StdCtrls",["System","Classes","WEBLib.Controls","SysUtils","Web","WEBLib.Graphics","Types","WEBLib.WebTools","WEBLib.Forms","WEBLib.Menus"],(function(){"use strict";var t=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.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.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}),rtl.createClass(this,"TCustomLabel",pas["WEBLib.Menus"].TWebCustomControl,(function(){this.$init=function(){pas["WEBLib.Menus"].TWebCustomControl.$init.call(this),this.FContent=null,this.FAutoSize=!1,this.FEllipsisPosition=0,this.FWordWrap=!1,this.FAlignment=0,this.FLayout=0,this.FTransparent=!1,this.FHTMLType=0,this.FFocusControl=null,this.FShowAccelChar=!1,this.FColor$1=0,this.FHasAccel=!1,this.FHasHTML=!1,this.FElementLabelClassName="",this.FOrigWidth=0,this.FOldWidth=0,this.FOldHeight=0,this.FHTML=""},this.$final=function(){this.FContent=void 0,this.FFocusControl=void 0,pas["WEBLib.Menus"].TWebCustomControl.$final.call(this)},this.SetLayout=function(t){this.FLayout!==t&&(this.FLayout=t,this.UpdateElementVisual())},this.SetAlignment=function(t){this.FAlignment!==t&&(this.FAlignment=t,this.UpdateElementVisual())},this.GetContentHandle=function(){return this.FContent},this.SetTransparent=function(t){this.FTransparent!==t&&(this.FTransparent=t,this.UpdateElementVisual())},this.SetHTMLType=function(t){var e=null;this.FHTMLType!==t&&(this.FHTMLType=t,this.FHTMLType in rtl.createSet(null,3,8)&&this.SetElementFont(1),null!=this.GetElementHandle()&&null!=this.FContent&&null!=(e=this.GetElementHandle().firstChild)&&"lbl"===e.getAttribute("data-lbl")&&(this.GetElementHandle().removeChild(this.FContent),this.FContent=this.CreateLabelElement(),this.GetElementHandle().appendChild(this.FContent),this.UpdateElement()))},this.SetColorEx=function(t){this.FColor$1=t,4 in this.FComponentState&&16777215!==this.FColor$1&&this.SetTransparent(!1),this.UpdateElement()},this.SetElementLabelClassName=function(t){this.FElementLabelClassName!==t&&(this.FElementLabelClassName=t,this.UpdateElement())},this.SetHTML=function(t){this.FHTML!==t&&(this.FHTML=t,this.UpdateElementData())},this.SetWidth=function(t){-1!==t&&0 in this.FComponentState&&(this.FOrigWidth=t),pas["WEBLib.Controls"].TControl.SetWidth.apply(this,arguments)},this.CreateElement=function(){var t=null;return t=document.createElement("DIV"),this.FContent=this.CreateLabelElement(),t.appendChild(this.FContent),t},this.CreateLabelElement=function(){var t=null;t=null;var e=this.FHTMLType;return 1===e?t=document.createElement("SPAN"):2===e?t=document.createElement("DIV"):3===e?t=document.createElement("H1"):4===e?t=document.createElement("H2"):5===e?t=document.createElement("H3"):6===e?t=document.createElement("H4"):7===e?t=document.createElement("H5"):8===e?t=document.createElement("H6"):0===e?t=document.createElement("LABEL"):9===e&&(t=document.createElement("P")),t.setAttribute("data-lbl","lbl"),t},this.GetDisplayText=function(){return this.FCaption},this.CanShowFocus=function(){return!1,!1},this.SetParent=function(t){pas["WEBLib.Controls"].TControl.SetParent.apply(this,arguments),this.FAutoSize&&0!==this.FAlignment&&-1!==this.FOrigWidth&&(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),this.FShowAccelChar&&null!=this.FFocusControl&&this.UpdateElementData()},this.UpdateAutoSize=function(){this.FAutoSize&&0===this.FAlign&&(null!=this.GetElementHandle()&&pas["WEBLib.WebTools"].ElementVisible(this.GetElementHandle())&&(this.SetWidth(-1),this.SetHeight(-1)),this.FEllipsisPosition=1)},this.UpdateElementData=function(){var t="",e="",i=null;pas["WEBLib.Controls"].TControl.UpdateElementData.call(this),e="",t=this.FShowAccelChar?pas["WEBLib.WebTools"].ProcessAccelerator(this.GetDisplayText(),{get:function(){return e},set:function(t){e=t}}):this.GetDisplayText(),t=""===this.FHTML?pas["WEBLib.WebTools"].HTMLToString(t):this.FHTML,this.GetIsLinked()&&""===t&&0 in this.FComponentState||(null!=this.GetContentHandle()?this.GetIsLinked()?(i=this.GetContentHandle(),""!==this.GetID()&&(i=document.getElementById(this.GetID())),null!=i&&(pas.System.Assigned(this.GetContentHandle().nodeValue)?i.nodeValue=t:0===i.childElementCount&&(i.innerHTML=t))):this.GetContentHandle().childElementCount>0&&!this.FHasAccel&&!this.FHasHTML?this.GetContentHandle().nodeValue=t:this.GetContentHandle().innerHTML=t:this.GetElementHandle().innerHTML=t,this.FHasHTML=pas.System.Pos("</",t)>0,this.FHasAccel=""!==e,""!==e&&null!=this.FFocusControl&&(this.GetContentHandle().setAttribute("accesskey",e),this.GetContentHandle().setAttribute("for",this.FFocusControl.GetID())))},this.UpdateElementVisual=function(){var t=0,e=0;if(pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this),!this.IsUpdating()&&(null!=this.GetElementHandle()&&(e=Math.round(this.GetElementHandle().offsetHeight),t=Math.round(this.GetElementHandle().offsetWidth),e>0&&(this.FOldHeight=e),t>0&&(this.FOldWidth=t),!this.FVisible||this.FAutoSize&&0===this.FAlign||0===this.FAlignment||this.GetElementHandle().style.setProperty("display","table"),this.GetElementHandle().setAttribute("zindex","1"),this.FAutoSize&&0===this.FAlign&&!(4 in this.FComponentState)?this.GetElementHandle().style.setProperty("overflow",""):this.GetElementHandle().style.setProperty("overflow","hidden")),null!=this.GetContentHandle())){var i=this.FLayout;0===i?this.GetContentHandle().style.setProperty("vertical-align","top"):1===i?this.GetContentHandle().style.setProperty("vertical-align","middle"):2===i&&this.GetContentHandle().style.setProperty("vertical-align","bottom");var s=this.FAlignment;0===s?this.GetContentHandle().style.removeProperty("text-align"):2===s?this.GetContentHandle().style.setProperty("text-align","center"):1===s&&this.GetContentHandle().style.setProperty("text-align","right"),pas["WEBLib.Controls"].SetHTMLElementColor(this.GetElementHandle(),this.FColor$1,this.FTransparent||-1===this.FColor$1||16711422===this.FColor$1),pas["WEBLib.Controls"].SetHTMLElementColor(this.GetContentHandle(),this.FColor$1,this.FTransparent||-1===this.FColor$1||16711422===this.FColor$1),this.GetContentHandle().style.setProperty("display","table-cell"),""===this.FElementClassName?(this.FEnabled&&0===this.FElementFont&&!this.GetIsLinked()?this.GetContentHandle().style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor)):this.GetContentHandle().style.removeProperty("color"),this.SetElementPointer(this.GetContentHandle(),this.FCursor),pas["WEBLib.Controls"].SetHTMLElementFont(this.GetContentHandle(),this.FFont,!(0===this.FElementFont&&!this.GetIsLinked()))):(this.GetContentHandle().style.removeProperty("color"),pas["WEBLib.Controls"].SetHTMLElementFont(this.GetContentHandle(),this.FFont,!0)),""!==this.FElementLabelClassName?this.GetContentHandle().setAttribute("class",this.FElementLabelClassName):this.GetContentHandle().removeAttribute("class"),0===this.FElementPosition||1===this.FWidthStyle?1===this.FEllipsisPosition?this.GetContentHandle().style.setProperty("text-overflow","clip"):this.GetContentHandle().style.setProperty("text-overflow","ellipsis"):this.GetContentHandle().style.removeProperty("text-overflow"),this.FWordWrap?this.GetContentHandle().style.setProperty("white-space","normal"):this.GetContentHandle().style.setProperty("white-space","nowrap"),this.GetElementHandle().style.setProperty("user-select",""),0===this.FCursor&&this.GetElementHandle().style.setProperty("cursor",""),this.FAutoSize&&0===this.FAlign&&!(4 in this.FComponentState)&&(this.GetElementHandle().style.removeProperty("width"),this.GetElementHandle().style.removeProperty("height"))}},this.UpdateElementSize=function(){pas["WEBLib.Controls"].TControl.UpdateElementSize.call(this),this.FAutoSize&&0===this.FAlign&&null!=this.GetElementHandle()&&(4 in this.FComponentState||(this.GetElementHandle().style.removeProperty("width"),this.GetElementHandle().style.removeProperty("height"))),null!=this.GetContentHandle()&&this.FAlign in rtl.createSet(3,4,5)&&!this.FAutoSize&&this.FLayout in rtl.createSet(1,2)&&this.GetContentHandle().style.setProperty("height",pas.SysUtils.TIntegerHelper.ToString$1.call({p:this.GetHeight(),get:function(){return this.p},set:function(t){this.p=t}})+"px")},this.SetAutoSize=function(t){this.FAutoSize!==t&&(this.FAutoSize=t,this.UpdateAutoSize(),this.UpdateElement())},this.SetCaption=function(t){var e=0;this.FCaption!==t&&(e=this.GetWidth(),pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,t),this.UpdateAutoSize(),this.UpdateElement(),e-=this.GetWidth(),this.FAutoSize&&0!==this.FAlignment&&0!==e&&2 in this.FAnchors&&!this.IsUpdating()&&this.SetLeft(this.GetLeft()+e))},this.SetControlCursor=function(t){pas["WEBLib.Controls"].TControl.SetControlCursor.apply(this,arguments),""===this.FElementClassName&&null!=this.GetContentHandle()&&this.SetElementPointer(this.GetContentHandle(),this.FCursor)},this.SetEllipsisPosition=function(t){this.FEllipsisPosition!==t&&(this.FEllipsisPosition=t,1!==this.FEllipsisPosition&&(this.FAutoSize=!1),this.UpdateElement())},this.GetWidth=function(){var t=0;return this.FAutoSize&&null!=this.GetElementHandle()&&null!=this.FParent?(0===(t=Math.round(this.GetElementHandle().offsetWidth))&&(t=pas["WEBLib.Controls"].TControl.GetWidth.call(this)),0===t&&""!==this.FCaption&&4 in this.FComponentState&&(t=this.FOldWidth)):t=pas["WEBLib.Controls"].TControl.GetWidth.call(this),t},this.GetHeight=function(){var t=0;return this.FAutoSize&&null!=this.GetElementHandle()&&null!=this.FParent?(0===(t=Math.round(this.GetElementHandle().offsetHeight))&&(t=pas["WEBLib.Controls"].TControl.GetHeight.call(this)),0===t&&""!==this.FCaption&&4 in this.FComponentState&&(t=this.FOldHeight)):t=pas["WEBLib.Controls"].TControl.GetHeight.call(this),t},this.CreateInitialize=function(){pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this),this.FAutoSize=!0,this.FLayout=0,this.FEllipsisPosition=1,this.FColor$1=16777215,this.FTransparent=!0,this.FAlignment=0,this.SetTabStop(!1),this.FShowAccelChar=!0}})),rtl.createClass(this,"TLabel",this.TCustomLabel,(function(){var e=this.$rtti;e.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),e.addProperty("Alignment",2,pas.Classes.$rtti.TAlignment,"FAlignment","SetAlignment",{Default:pas.Classes.TAlignment.taLeftJustify}),e.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",{Default:!1}),e.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),e.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",{Default:!0}),e.addProperty("Caption",2,rtl.string,"FCaption","SetCaption"),e.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",{Default:0}),e.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor$1","SetColorEx",{Default:16777215}),e.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti.TDragMode,"FDragMode","SetDragMode",{Default:pas["WEBLib.Controls"].TDragMode.dmManual}),e.addProperty("EllipsisPosition",2,t.$rtti.TEllipsisPosition,"FEllipsisPosition","SetEllipsisPosition",{Default:t.TEllipsisPosition.epNone}),e.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),e.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),e.addProperty("ElementLabelClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementLabelClassName","SetElementLabelClassName"),e.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),e.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),e.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),e.addProperty("FocusControl",0,pas["WEBLib.Controls"].$rtti.TWinControl,"FFocusControl","FFocusControl"),e.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),e.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight"),e.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",{Default:100}),e.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FHeightStyle","SetHeightStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),e.addProperty("Hint",2,rtl.string,"FHint","SetHint"),e.addProperty("HTML",2,rtl.string,"FHTML","SetHTML"),e.addProperty("HTMLType",2,t.$rtti.THTMLType,"FHTMLType","SetHTMLType",{Default:t.THTMLType.tLABELTAG}),e.addProperty("Layout",2,t.$rtti.TTextLayout,"FLayout","SetLayout",{Default:t.TTextLayout.tlTop}),e.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft"),e.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti.TMargins,"FMargins","SetMargins"),e.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),e.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti.TPopupMenu,"FPopupMenu","FPopupMenu"),e.addProperty("ShowAccelChar",0,rtl.boolean,"FShowAccelChar","FShowAccelChar",{Default:!0}),e.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",{Default:!1}),e.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti.TTextDirection,"FTextDirection","FTextDirection",{Default:pas["WEBLib.Controls"].TTextDirection.tdDefault}),e.addProperty("Top",3,rtl.longint,"GetTop","SetTop"),e.addProperty("Transparent",2,rtl.boolean,"FTransparent","SetTransparent",{Default:!0}),e.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),e.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth"),e.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",{Default:100}),e.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FWidthStyle","SetWidthStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),e.addProperty("WordWrap",0,rtl.boolean,"FWordWrap","FWordWrap",{Default:!1}),e.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),e.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),e.addProperty("OnTouchStart",0,pas["WEBLib.Controls"].$rtti.TTouchEvent,"FOnTouchStart","FOnTouchStart"),e.addProperty("OnTouchEnd",0,pas["WEBLib.Controls"].$rtti.TTouchEvent,"FOnTouchEnd","FOnTouchEnd"),e.addProperty("OnTouchMove",0,pas["WEBLib.Controls"].$rtti.TTouchEvent,"FOnTouchMove","FOnTouchMove"),e.addProperty("OnTouchCancel",0,pas["WEBLib.Controls"].$rtti.TTouchEvent,"FOnTouchCancel","FOnTouchCancel"),e.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti.TDragOverEvent,"FOnDragOver","FOnDragOver"),e.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti.TDragDropEvent,"FOnDragDrop","FOnDragDrop"),e.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti.TStartDragEvent,"FOnStartDrag","FOnStartDrag"),e.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FonEndDrag","FonEndDrag")})),rtl.createClass(this,"TCustomInput",pas["WEBLib.Menus"].TWebCustomControl,(function(){this.IsInputControl=function(){return!0,!0},this.GetInputType=function(){return"EDIT","EDIT"},this.CreateElement=function(){var t=null;return(t=document.createElement("INPUT")).setAttribute("type",this.GetInputType()),t},this.UpdateElementVisual=function(){pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this),null==this.GetContainer()||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.CreateInitialize=function(){pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this),this.SetShowFocus(!0),this.FNoUserSelect=!1}})),rtl.createClass(this,"TCustomEdit",this.TCustomInput,(function(){this.$init=function(){t.TCustomInput.$init.call(this),this.FCharCase=0,this.FMaxLength=0,this.FReadOnly=!1,this.FText="",this.FTextHint="",this.FSelStart=0,this.FAlignment=0,this.FHideSelection=!1,this.FPasswordChar="",this.FOnChange=null,this.FAutoSize=!1,this.FAutoSelect=!1,this.FSelLength=0,this.FNumeric=!1,this.FAutoCompletion=0,this.FEditType=0,this.FRequired=!1,this.FAutoFocus=!1,this.FPattern="",this.FHandlePastePtr=null,this.FHandleCutPtr=null,this.FHandleChangePtr=null,this.FHandleInvalidPtr=null,this.FSpellCheck=!1,this.FRequiredText=""},this.$final=function(){this.FOnChange=void 0,t.TCustomInput.$final.call(this)},this.SetAlignment=function(t){this.FAlignment=t,this.UpdateElement()},this.SetHideSelection=function(t){this.FHideSelection!==t&&(this.FHideSelection=t,this.UpdateElement())},this.SetAutoSelect=function(t){this.FAutoSelect!==t&&(this.FAutoSelect=t,this.UpdateElement())},this.SetAutoSize=function(t){this.FAutoSize!==t&&(this.FAutoSize=t,this.UpdateElement())},this.SetSelLength=function(t){this.FSelLength=t,this.UpdateElement()},this.SetSelStart=function(t){this.FSelStart=t,this.UpdateElement()},this.SetPasswordChar=function(t){this.FPasswordChar=t,this.UpdateElement()},this.SetAutoCompletion=function(t){this.FAutoCompletion!==t&&(this.FAutoCompletion=t,this.UpdateElement())},this.SetAutoFocus=function(t){this.FAutoFocus!==t&&(this.FAutoFocus=t,this.UpdateElement())},this.SetRequired=function(t){this.FRequired=t,this.UpdateElement()},this.SetPattern=function(t){this.FPattern!==t&&(this.FPattern=t,this.UpdateElement())},this.GetSelLength=function(){var t=0;return t=-1,null!=this.GetElementInputHandle()&&(t=this.GetElementInputHandle().selectionEnd-this.GetElementInputHandle().selectionStart),t},this.GetSelStart=function(){var t=0;return t=-1,null!=this.GetElementInputHandle()&&(t=this.GetElementInputHandle().selectionStart),t},this.SetEditType=function(t){this.FEditType!==t&&(this.FEditType=t,this.UpdateElement())},this.SetSpellCheck=function(t){this.FSpellCheck!==t&&(this.FSpellCheck=t,this.UpdateElement())},this.GetElementInputHandle=function(){return this.GetContainer()},this.DoHandlePaste=function(t){var e;return e=(t.clipboardData||window.clipboardData).getData("Text"),this.CanPaste(e)&&this.Validate(e)||(t.preventDefault(),t.stopPropagation()),!1,!1},this.DoHandleCut=function(t){return this.CanCut()||(t.preventDefault(),t.stopPropagation()),!1,!1},this.DoHandleChange=function(t){return this.Change(),!0,""!==this.FRequiredText&&this.GetElementInputHandle().setCustomValidity(""),!0},this.DoHandleInvalid=function(t){return this.GetElementInputHandle().setCustomValidity(this.FRequiredText),!0,!0},this.IsCustomEditor=function(){return!1,!1},this.KeyPress=function(t){var e=!1;pas["WEBLib.Controls"].TControl.KeyPress.call(this,t),e=!0;var i=this.FEditType;3===i?e=t.get().charCodeAt()in rtl.createSet(null,48,57):5===i?e=t.get().charCodeAt()in rtl.createSet(null,48,57,43,45):1===i?e=t.get().charCodeAt()in rtl.createSet(null,48,57,44,46):4===i?e=t.get().charCodeAt()in rtl.createSet(null,48,57,44,46,43,45):2===i&&(e=t.get().charCodeAt()in rtl.createSet(null,48,57,null,65,70)),e||t.set("\0")},this.GetInputType=function(){return"\0"!==this.FPasswordChar?"PASSWORD":this.FNumeric?"NUMBER":this.FEditType in rtl.createSet(1,3)?"TEL":6===this.FEditType?"SEARCH":"TEXT"},this.GetText=function(){var t="";return t=this.FText,null!=this.GetElementInputHandle()&&(t=this.GetElementInputHandle().value),3===this.FCharCase&&(t=pas.SysUtils.UpperCase(t)),0===this.FCharCase&&(t=pas.SysUtils.LowerCase(t)),t},this.GetDisplayText=function(){return this.FText},this.IsReadOnly=function(){return this.FReadOnly},this.Validate=function(t){var e=!1,i=0,s="",n=!1;e=!0;for(var r=1,o=t.length;r<=o;r++){i=r,s=t.charAt(i-1),n=!0;var l=this.FEditType;if(3===l?n=s.charCodeAt()in rtl.createSet(null,48,57):5===l?n=s.charCodeAt()in rtl.createSet(null,48,57,43,45):1===l?n=s.charCodeAt()in rtl.createSet(null,48,57,44,46):4===l?n=s.charCodeAt()in rtl.createSet(null,48,57,44,46,43,45):2===l&&(n=s.charCodeAt()in rtl.createSet(null,48,57,null,65,70)),!n){e=!1;break}}return e},this.ClearMethodPointers=function(){pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this),this.FHandlePastePtr=null,this.FHandleCutPtr=null,this.FHandleChangePtr=null,this.FHandleInvalidPtr=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.BindEvents=function(){pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this),null!=this.GetElementInputHandle()&&(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.UnbindEvents=function(){pas["WEBLib.Controls"].TControl.UnbindEvents.call(this),null!=this.GetElementInputHandle()&&(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.UpdateElementData=function(){var e=null,i=0,s=0,n=!1,r=!1;if(pas["WEBLib.Controls"].TControl.UpdateElementData.call(this),null!=this.GetElementInputHandle()){if(!this.GetIsLinked()){var o=this.FCharCase;3===o?this.GetElementInputHandle().style.setProperty("text-transform","uppercase"):0===o?this.GetElementInputHandle().style.setProperty("text-transform","lowercase"):2===o?this.GetElementInputHandle().style.setProperty("text-transform","capitalize"):1===o&&this.GetElementInputHandle().style.setProperty("text-transform","initial")}if(this.GetElementInputHandle().readOnly=this.IsReadOnly(),""!==this.FTextHint&&(this.GetElementInputHandle().placeholder=this.FTextHint),r=!0,this.GetIsLinked()&&(r=!this.GetElementInputHandle().hasAttribute("autocomplete")),r&&(52===this.FAutoCompletion?(this.GetElementInputHandle().setAttribute("autocomplete","nope"),this.GetElementInputHandle().removeAttribute("name")):51===this.FAutoCompletion?(this.GetElementInputHandle().setAttribute("autocomplete","off"),this.GetElementInputHandle().removeAttribute("name")):0!==this.FAutoCompletion?(this.GetElementInputHandle().setAttribute("autocomplete","on"),this.GetElementInputHandle().setAttribute("name",t.GetAutoCompletionName(this.FAutoCompletion))):(this.GetElementInputHandle().removeAttribute("autocomplete"),this.GetElementInputHandle().removeAttribute("name"))),!this.GetIsLinked()){this.GetElementInputHandle().setAttribute("type",this.GetInputType()),this.GetElementInputHandle().setAttribute("role","textbox");var l=this.FAlignment;0===l?this.GetElementInputHandle().style.removeProperty("text-align"):2===l?this.GetElementInputHandle().style.setProperty("text-align","center"):1===l&&this.GetElementInputHandle().style.setProperty("text-align","right")}this.FAutoFocus?this.GetElementInputHandle().setAttribute("autofocus",""):this.GetElementInputHandle().removeAttribute("autofocus"),this.FRequired?this.GetElementInputHandle().setAttribute("required",""):this.GetElementInputHandle().removeAttribute("required"),""!==this.FPattern?this.GetElementInputHandle().setAttribute("pattern",this.FPattern):this.GetElementInputHandle().removeAttribute("pattern"),this.FMaxLength<=0?this.GetElementInputHandle().removeAttribute("maxLength"):this.GetElementInputHandle().maxLength=this.FMaxLength,this.GetElementInputHandle().value=this.GetDisplayText(),n="NUMBER"===pas.SysUtils.UpperCase(this.GetInputType()),this.FSpellCheck?this.GetElementInputHandle().removeAttribute("spellcheck"):this.GetElementInputHandle().setAttribute("spellcheck","false"),n||this.GetIsLinked()||this.IsCustomEditor()||(i=this.FSelStart,s=this.FSelStart+this.FSelLength,e=this.GetElementInputHandle(),setTimeout((function(){e.setSelectionRange(i,s)}),1))}},this.SetCharCase=function(t){this.FCharCase!==t&&(this.FCharCase=t,this.UpdateElement())},this.SetMaxLength=function(t){this.FMaxLength!==t&&(this.FMaxLength=t,this.UpdateElementData())},this.SetReadOnly=function(t){this.FReadOnly!==t&&(this.FReadOnly=t,this.UpdateElement())},this.SetText=function(t){this.FText=t,null!=this.GetElementInputHandle()&&(this.GetElementInputHandle().value=this.GetDisplayText(),this.GetElementInputHandle().readOnly=this.IsReadOnly())},this.SetTextHint=function(t){this.FTextHint=t,this.UpdateElement()},this.CanPaste=function(t){return!0,!0},this.CanCut=function(){return!0,!0},this.CreateInitialize=function(){t.TCustomInput.CreateInitialize.call(this),this.FAutoCompletion=0,this.FEditType=0,this.FText="",this.FCharCase=1,this.FMaxLength=0,this.FReadOnly=!1,this.FTextHint="",this.FPasswordChar="\0",this.FSpellCheck=!0,this.SetHeight(25)},this.Change=function(){null!=this.GetElementHandle()&&(this.FText=this.GetElementInputHandle().value),null!=this.FOnChange&&this.FOnChange(this)},this.SetSelection=function(t,e){var i=null;this.FSelStart=t,this.FSelLength=e,null!=(i=this.GetElementInputHandle())&&i.setSelectionRange(t,t+e)}})),rtl.createClass(this,"TEdit",this.TCustomEdit,(function(){var e=this.$rtti;e.addProperty("Alignment",2,pas.Classes.$rtti.TAlignment,"FAlignment","SetAlignment"),e.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),e.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",{Default:!1}),e.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),e.addProperty("AutoCompletion",2,t.$rtti.TAutoCompletion,"FAutoCompletion","SetAutoCompletion",{Default:t.TAutoCompletion.acOff}),e.addProperty("AutoFocus",2,rtl.boolean,"FAutoFocus","SetAutoFocus",{Default:!1}),e.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",{Default:!1}),e.addProperty("AutoSelect",2,rtl.boolean,"FAutoSelect","SetAutoSelect",{Default:!1}),e.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti.TBiDiMode,"FBiDiMode","SetBiDiMode",{Default:pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight}),e.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti.TBorderStyle,"FBorderStyle","SetBorderStyle",{Default:pas["WEBLib.Controls"].TBorderStyle.bsSingle}),e.addProperty("CharCase",2,t.$rtti.TEditCharCase,"FCharCase","SetCharCase",{Default:t.TEditCharCase.wecNormal}),e.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",{Default:0}),e.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor","SetColor"),e.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti.TDragMode,"FDragMode","SetDragMode",{Default:pas["WEBLib.Controls"].TDragMode.dmManual}),e.addProperty("EditType",2,t.$rtti.TEditType,"FEditType","SetEditType",{Default:t.TEditType.weString}),e.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),e.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),e.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),e.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),e.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),e.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),e.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight"),e.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",{Default:100}),e.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FHeightStyle","SetHeightStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),e.addProperty("Hint",2,rtl.string,"FHint","SetHint"),e.addProperty("HideSelection",2,rtl.boolean,"FHideSelection","SetHideSelection"),e.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft"),e.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),e.addProperty("PasswordChar",2,rtl.char,"FPasswordChar","SetPasswordChar",{Default:"\0"}),e.addProperty("Pattern",2,rtl.string,"FPattern","SetPattern"),e.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti.TMargins,"FMargins","SetMargins"),e.addProperty("MaxLength",2,rtl.longint,"FMaxLength","SetMaxLength",{Default:0}),e.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti.TPopupMenu,"FPopupMenu","FPopupMenu"),e.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly",{Default:!1}),e.addProperty("Required",2,rtl.boolean,"FRequired","SetRequired",{Default:!1}),e.addProperty("RequiredText",0,rtl.string,"FRequiredText","FRequiredText"),e.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",{Default:!1}),e.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",{Default:!1}),e.addProperty("SpellCheck",2,rtl.boolean,"FSpellCheck","SetSpellCheck",{Default:!0}),e.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder"),e.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",{Default:!0}),e.addProperty("Text",3,rtl.string,"GetText","SetText"),e.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti.TTextDirection,"FTextDirection","FTextDirection",{Default:pas["WEBLib.Controls"].TTextDirection.tdDefault}),e.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint"),e.addProperty("Top",3,rtl.longint,"GetTop","SetTop"),e.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),e.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth"),e.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",{Default:100}),e.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FWidthStyle","SetWidthStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),e.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnChange","FOnChange"),e.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),e.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),e.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyDown","FOnKeyDown"),e.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti.TKeyPressEvent,"FOnKeyPress","FOnKeyPress"),e.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyUp","FOnKeyUp"),e.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseDown","FOnMouseDown"),e.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseUp","FOnMouseUp"),e.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti.TMouseMoveEvent,"FOnMouseMove","FOnMouseMove"),e.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseLeave","FOnMouseLeave"),e.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseEnter","FOnMouseEnter"),e.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnEnter","FOnEnter"),e.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnExit","FOnExit"),e.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti.TDragDropEvent,"FOnDragDrop","FOnDragDrop"),e.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti.TDragOverEvent,"FOnDragOver","FOnDragOver"),e.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FonEndDrag","FonEndDrag"),e.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti.TStartDragEvent,"FOnStartDrag","FOnStartDrag")})),rtl.createClass(this,"TButton",pas["WEBLib.Menus"].TWebCustomControl,(function(){this.$init=function(){pas["WEBLib.Menus"].TWebCustomControl.$init.call(this),this.FDefault=!1,this.FButtonType=""},this.SetButtonType=function(t){this.FButtonType=t,this.UpdateElementData()},this.SetDefault=function(t){this.FDefault=t,this.FDefault&&this.SetFocus()},this.CreateElement=function(){var t=null;return(t=document.createElement("BUTTON")).setAttribute("type","BUTTON"),t},this.SetCaption=function(t){this.FCaption!==t&&(pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,t),this.UpdateElementData())},this.UpdateElementData=function(){var t="";pas["WEBLib.Controls"].TControl.UpdateElementData.call(this),this.GetIsLinked()&&""===this.FCaption||null!=this.GetElementHandle()&&((0===this.GetElementHandle().childElementCount||pas.System.Pos("</",this.FCaption)>0||!this.GetIsLinked())&&(this.GetElementHandle().innerHTML=pas["WEBLib.WebTools"].ProcessAccelerator(this.FCaption,{get:function(){return t},set:function(e){t=e}})),""!==t&&this.GetElementHandle().setAttribute("accesskey",t),this.GetElementHandle().setAttribute("role","button"),this.GetElementHandle().setAttribute("aria-label",this.FCaption),""!==this.FButtonType?this.GetElementHandle().setAttribute("type",this.FButtonType):this.GetElementHandle().setAttribute("type","BUTTON"))},this.UpdateElementVisual=function(){var t="";pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this),null!=this.GetElementHandle()&&(this.GetElementHandle().style.removeProperty("outline"),this.GetElementHandle().style.removeProperty("user-select"),"BTN"===(t=pas.SysUtils.UpperCase(this.FElementClassName))||pas.System.Pos("BTN ",t))},this.CreateInitialize=function(){pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this),4 in this.FComponentState&&""===this.FCaption&&this.SetCaption(this.FName),this.SetColor(-1)};var t=this.$rtti;t.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),t.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",{Default:!1}),t.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),t.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti.TBiDiMode,"FBiDiMode","SetBiDiMode",{Default:pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight}),t.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti.TBorderStyle,"FBorderStyle","SetBorderStyle",{Default:pas["WEBLib.Controls"].TBorderStyle.bsSingle}),t.addProperty("ButtonType",2,rtl.string,"FButtonType","SetButtonType"),t.addProperty("Caption",2,rtl.string,"FCaption","SetCaption"),t.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",{Default:0}),t.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor","SetColor"),t.addProperty("Default",2,rtl.boolean,"FDefault","SetDefault"),t.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti.TDragMode,"FDragMode","SetDragMode",{Default:pas["WEBLib.Controls"].TDragMode.dmManual}),t.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),t.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),t.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),t.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),t.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),t.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),t.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight"),t.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",{Default:100}),t.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FHeightStyle","SetHeightStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),t.addProperty("Hint",2,rtl.string,"FHint","SetHint"),t.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft"),t.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti.TMargins,"FMargins","SetMargins"),t.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti.TPopupMenu,"FPopupMenu","FPopupMenu"),t.addProperty("Role",3,rtl.string,"GetRole","SetRole"),t.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),t.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",{Default:!1}),t.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder"),t.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",{Default:!0}),t.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti.TTextDirection,"FTextDirection","FTextDirection",{Default:pas["WEBLib.Controls"].TTextDirection.tdDefault}),t.addProperty("Top",3,rtl.longint,"GetTop","SetTop"),t.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),t.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth"),t.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",{Default:100}),t.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FWidthStyle","SetWidthStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),t.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),t.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyDown","FOnKeyDown"),t.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti.TKeyPressEvent,"FOnKeyPress","FOnKeyPress"),t.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyUp","FOnKeyUp"),t.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseDown","FOnMouseDown"),t.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseUp","FOnMouseUp"),t.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti.TMouseMoveEvent,"FOnMouseMove","FOnMouseMove"),t.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseLeave","FOnMouseLeave"),t.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseEnter","FOnMouseEnter"),t.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnEnter","FOnEnter"),t.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnExit","FOnExit"),t.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti.TDragDropEvent,"FOnDragDrop","FOnDragDrop"),t.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti.TDragOverEvent,"FOnDragOver","FOnDragOver"),t.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FonEndDrag","FonEndDrag"),t.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti.TStartDragEvent,"FOnStartDrag","FOnStartDrag")})),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.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.$final=function(){this.FItems=void 0,this.FOnChange=void 0,this.FOnFocusOut=void 0,this.FOnFocusIn=void 0,pas["WEBLib.Menus"].TWebCustomControl.$final.call(this)},this.GetText=function(){var t="";return t="",1===this.FStyle?null!=this.GetElementHandle()&&(t=this.GetElementHandle().value):this.GetItemIndex()>=0&&(t=this.FItems.Get(this.GetItemIndex())),t},this.SetText=function(t){var e=0;if(1===this.FStyle)this.FText=t,this.UpdateElement();else for(var i=0,s=this.FItems.GetCount()-1;i<=s;i++)e=i,t===this.FItems.Get(e)&&this.SetItemIndex(e)},this.SetStyle=function(t){this.FStyle!==t&&(this.FStyle=t,this.GetIsLinked()||this.RecreateElement())},this.GetElementSelectHandle=function(){return this.GetContainer()},this.SetTextHint=function(t){this.FTextHint!==t&&(this.FTextHint=t,this.DoUpdateList())},this.DoHandleChange=function(t){return this.Change(),!0,!0},this.DoHandleInput=function(t){return 1===this.FStyle&&this.Change(),!0,!0},this.DoHandleFocusIn=function(t){return null!=this.FOnFocusIn&&this.FOnFocusIn(this),!0,!0},this.DoHandleFocusOut=function(t){return null!=this.FOnFocusOut&&this.FOnFocusOut(this),!0,!0},this.DoItemsChange=function(t){this.DoUpdateList()},this.ClearMethodPointers=function(){pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this),this.FHandleChangePtr=null,this.FHandleInputPtr=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.AddTextHint=function(){var t=null;""!==this.FTextHint&&0===this.FStyle&&((t=document.createElement("OPTION")).setAttribute("value",""),t.setAttribute("disabled","true"),t.setAttribute("selected","true"),t.setAttribute("hidden","true"),t.innerHTML=this.FTextHint,this.GetContainer().appendChild(t))},this.DoUpdateList=function(){var t=0,e=0,i="",s="",n="",r=null,o=null;if(null!=this.GetContainer()){if("INPUT"===this.GetElementHandle().tagName){this.GetElementHandle().value=this.GetText(),null!=(o=document.getElementById(this.FName+"_LIST"))&&o.parentNode.removeChild(o),""!==this.FTextHint&&(this.GetElementHandle().placeholder=this.FTextHint),(o=document.createElement("DATALIST")).setAttribute("id",this.FListName),document.body.appendChild(o);for(var l=0,a=this.FItems.GetCount()-1;l<=a;l++)t=l,i=this.FItems.Get(t),r=document.createElement("OPTION"),s=i,n=i,(e=pas.System.Pos(this.FItems.GetNameValueSeparator(),i))>0&&(n=pas.System.Copy(i,1,e-1),s=pas.System.Copy(i,e+1,65535)),r.setAttribute("value",s),r.innerHTML=n,o.appendChild(r)}else{if("SELECT"!==this.GetElementHandle().tagName)return;for(var h=this.GetContainer().options.length-1;h>=0;h--)t=h,this.GetContainer().remove(t);this.AddTextHint();for(var u=0,d=this.FItems.GetCount()-1;u<=d;u++)t=u,i=this.FItems.Get(t),r=document.createElement("OPTION"),s=i,n=i,(e=pas.System.Pos(this.FItems.GetNameValueSeparator(),i))>0&&(n=pas.System.Copy(i,1,e-1),s=pas.System.Copy(i,e+1,65535)),r.setAttribute("value",s),r.innerHTML=n,this.GetContainer().appendChild(r)}this.UpdateElement()}},this.GetItemIndex=function(){var t=0;return 1===this.FStyle?t=this.FItems.IndexOf(this.GetText()):(t=this.FItemIndex,null!=this.GetContainer()&&(t=this.GetContainer().selectedIndex,""!==this.FTextHint&&(t-=1))),t},this.CreateElement=function(){var t=null;return 0===this.FStyle?t=document.createElement("SELECT"):(t=document.createElement("INPUT"),this.FListName=this.FName+"_LIST",t.setAttribute("list",this.FListName)),t},this.BindEvents=function(){pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this),null!=this.GetElementHandle()&&(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.UnbindEvents=function(){pas["WEBLib.Controls"].TControl.UnbindEvents.call(this),null!=this.GetElementHandle()&&(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.UpdateElementData=function(){var t=0;pas["WEBLib.Controls"].TControl.UpdateElementData.call(this),1===this.FStyle?null!=this.GetElementHandle()&&(this.GetElementHandle().value=this.FText,this.FListName=this.FName+"_LIST",this.GetElementHandle().setAttribute("list",this.FListName)):null!=this.GetElementSelectHandle()&&(t=0,""!==this.FTextHint&&(t=1),this.GetElementSelectHandle().selectedIndex=this.FItemIndex+t,this.GetElementSelectHandle().setAttribute("role","combobox"))},this.UpdateParent=function(){pas["WEBLib.Controls"].TControl.UpdateParent.call(this),this.DoUpdateList()},this.SetItems=function(t){this.FItems.Assign(t)},this.SetItemIndex=function(t){this.FItemIndex!==t&&(this.FItemIndex=t,t>=0&&this.FStyle in rtl.createSet(1,0)&&t<this.FItems.GetCount()&&(this.FText=this.FItems.Get(t)),this.UpdateElement())},this.Loaded=function(){pas["WEBLib.Controls"].TCustomControl.Loaded.call(this),this.DoUpdateList()},this.Change=function(){this.FItemIndex=this.GetItemIndex(),null!=this.FOnChange&&this.FOnChange(this)},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=0,this.SetShowFocus(!0),this.SetHeight(25)},this.Destroy=function(){rtl.free(this,"FItems"),pas["WEBLib.Controls"].TCustomControl.Destroy.call(this)}})),rtl.createClass(this,"TComboBox",this.TCustomComboBox,(function(){var e=this.$rtti;e.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),e.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",{Default:!1}),e.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),e.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti.TBiDiMode,"FBiDiMode","SetBiDiMode",{Default:pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight}),e.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",{Default:0}),e.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor","SetColor"),e.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti.TDragMode,"FDragMode","SetDragMode",{Default:pas["WEBLib.Controls"].TDragMode.dmManual}),e.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),e.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),e.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),e.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),e.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),e.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),e.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight"),e.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",{Default:100}),e.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FHeightStyle","SetHeightStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),e.addProperty("Hint",2,rtl.string,"FHint","SetHint"),e.addProperty("ItemIndex",3,rtl.longint,"GetItemIndex","SetItemIndex",{Default:-1}),e.addProperty("Items",2,pas.Classes.$rtti.TStrings,"FItems","SetItems"),e.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft"),e.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),e.addProperty("Role",3,rtl.string,"GetRole","SetRole"),e.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",{Default:!1}),e.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",{Default:!1}),e.addProperty("Style",2,t.$rtti.TComboBoxStyle,"FStyle","SetStyle"),e.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder"),e.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",{Default:!0}),e.addProperty("Text",3,rtl.string,"GetText","SetText"),e.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti.TTextDirection,"FTextDirection","FTextDirection",{Default:pas["WEBLib.Controls"].TTextDirection.tdDefault}),e.addProperty("TextHint",2,rtl.string,"FTextHint","SetTextHint"),e.addProperty("Top",3,rtl.longint,"GetTop","SetTop"),e.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),e.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth"),e.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",{Default:100}),e.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FWidthStyle","SetWidthStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),e.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnChange","FOnChange"),e.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),e.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),e.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyDown","FOnKeyDown"),e.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti.TKeyPressEvent,"FOnKeyPress","FOnKeyPress"),e.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyUp","FOnKeyUp"),e.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseDown","FOnMouseDown"),e.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseUp","FOnMouseUp"),e.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti.TMouseMoveEvent,"FOnMouseMove","FOnMouseMove"),e.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseLeave","FOnMouseLeave"),e.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseEnter","FOnMouseEnter"),e.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnEnter","FOnEnter"),e.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnExit","FOnExit"),e.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti.TDragDropEvent,"FOnDragDrop","FOnDragDrop"),e.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti.TDragOverEvent,"FOnDragOver","FOnDragOver"),e.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FonEndDrag","FonEndDrag"),e.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti.TStartDragEvent,"FOnStartDrag","FOnStartDrag")})),rtl.createClass(this,"TWebComboBox",this.TComboBox,(function(){})),rtl.createClass(this,"TCustomMemo",pas["WEBLib.Menus"].TWebCustomControl,(function(){this.$init=function(){pas["WEBLib.Menus"].TWebCustomControl.$init.call(this),this.FWordWrap=!1,this.FBlockChange=!1,this.FLines=null,this.FSelStart=0,this.FSelLength=0,this.FAutoSize=!1,this.FOnChange=null,this.FReadOnly=!1,this.FTextHint="",this.FHandleChangePtr=null,this.FHandlePastePtr=null,this.FHandleCutPtr=null,this.FHandleInputPtr=null,this.FWantTabs=!1,this.FAutoCompletion=0,this.FSpellCheck=!1,this.FModified=!1},this.$final=function(){this.FLines=void 0,this.FOnChange=void 0,pas["WEBLib.Menus"].TWebCustomControl.$final.call(this)},this.GetText=function(){return null!=this.GetElementInputHandle()&&(this.FBlockChange=!0,this.FLines.SetTextStr(this.GetElementInputHandle().value),this.FBlockChange=!1),this.FLines.GetTextStr()},this.SetSelLength=function(t){this.FSelLength!==t&&(this.FSelLength=t,this.UpdateElement())},this.SetSelStart=function(t){this.FSelStart!==t&&(this.FSelStart=t,this.UpdateElement())},this.SetAutoSize=function(t){this.FAutoSize!==t&&(this.FAutoSize=t,this.UpdateElement())},this.GetElementInputHandle=function(){return this.GetContainer()},this.SetReadOnly=function(t){this.FReadOnly!==t&&(this.FReadOnly=t,this.UpdateElement())},this.GetSelLength=function(){var t=0;return t=-1,null!=this.GetElementInputHandle()&&(t=this.GetElementInputHandle().selectionEnd-this.GetElementInputHandle().selectionStart),t},this.GetSelStart=function(){var t=0;return t=-1,null!=this.GetElementInputHandle()&&(t=this.GetElementInputHandle().selectionStart),t},this.SetSpellCheck=function(t){this.FSpellCheck!==t&&(this.FSpellCheck=t,this.UpdateElement())},this.IsInputControl=function(){return!0,!0},this.HandleDoKeyDown=function(t){var e=!1,i=null;if(9===this.GetKeyCode(t.key,!0)&&this.FWantTabs){var s=(i=this.GetElementInputHandle()).selectionStart,n=i.selectionEnd;i.value=i.value.substring(0,s)+"\t"+i.value.substring(n),i.selectionStart=i.selectionEnd=s+1,t.stopPropagation(),t.preventDefault()}else pas["WEBLib.Controls"].TControl.HandleDoKeyDown.apply(this,arguments);return e},this.CreateElement=function(){return document.createElement("TEXTAREA")},this.DoHandlePaste=function(t){var e;return e=(t.clipboardData||window.clipboardData).getData("Text"),this.CanPaste(e)||(t.preventDefault(),t.stopPropagation()),!1,!1},this.DoHandleCut=function(t){return this.CanCut()||(t.preventDefault(),t.stopPropagation()),!1,!1},this.DoHandleInput=function(t){return this.GetText(),this.Change(),!0,!0},this.DoHandleChange=function(t){return this.FModified=!0,this.Change(),!0,!0},this.IsReadOnly=function(){return this.FReadOnly},this.GetDisplayText=function(){return this.FLines.GetTextStr()},this.BindEvents=function(){pas["WEBLib.Controls"].TCustomControl.BindEvents.call(this),null!=this.GetElementInputHandle()&&(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.UnbindEvents=function(){pas["WEBLib.Controls"].TControl.UnbindEvents.call(this),null!=this.GetElementInputHandle()&&(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.UpdateElementData=function(){var e=0,i=0,s=null;pas["WEBLib.Controls"].TControl.UpdateElementData.call(this),null==this.GetElementInputHandle()||this.FBlockChange||(this.GetElementInputHandle().value=this.GetDisplayText(),"TEXTAREA"===this.GetElementInputHandle().tagName&&this.GetElementInputHandle().setSelectionRange(this.GetSelStart(),this.GetSelStart()+this.GetSelLength()),this.GetIsLinked()||this.GetElementInputHandle().style.setProperty("resize","none"),this.GetElementInputHandle().readOnly=this.IsReadOnly(),""!==this.FTextHint&&(this.GetElementInputHandle().placeholder=this.FTextHint),this.GetIsLinked()||(51===this.FAutoCompletion?(this.GetElementInputHandle().setAttribute("autocomplete","none"),this.GetElementInputHandle().removeAttribute("name")):0!==this.FAutoCompletion?(this.GetElementInputHandle().setAttribute("autocomplete","on"),this.GetElementInputHandle().setAttribute("name",t.GetAutoCompletionName(this.FAutoCompletion))):(this.GetElementInputHandle().removeAttribute("autocomplete"),this.GetElementInputHandle().removeAttribute("name")),e=this.FSelStart,i=this.FSelStart+this.FSelLength,s=this.GetElementInputHandle(),setTimeout((function(){s.setSelectionRange(e,i)}),1)))},this.UpdateElementVisual=function(){pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this),null==this.GetElementInputHandle()||this.FBlockChange||this.GetIsLinked()||(this.GetElementInputHandle().style.setProperty("overflow","auto"),this.GetElementInputHandle().style.setProperty("margin","0"),-1!==this.FColor&&16711422!==this.FColor?this.GetElementInputHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor)):this.GetElementInputHandle().style.removeProperty("background-color"),this.FSpellCheck?this.GetElementInputHandle().hasAttribute("spellcheck")&&this.GetElementInputHandle().removeAttribute("spellcheck"):this.GetElementInputHandle().setAttribute("spellcheck","false"),this.FWordWrap?this.GetElementInputHandle().hasAttribute("wrap")&&this.GetElementInputHandle().removeAttribute("wrap"):this.GetElementInputHandle().setAttribute("wrap","off"))},this.SetLines=function(t){this.FLines.Assign(t)},this.ClearMethodPointers=function(){pas["WEBLib.Controls"].TControl.ClearMethodPointers.call(this),this.FHandleChangePtr=null,this.FHandleInputPtr=null,this.FHandlePastePtr=null,this.FHandleCutPtr=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.DoLinesChange=function(t){null==this.GetElementInputHandle()||this.FBlockChange||(this.GetElementInputHandle().value=this.GetDisplayText(),this.GetElementInputHandle().readOnly=this.IsReadOnly())},this.CanPaste=function(t){return!0,!0},this.CanCut=function(){return!0,!0},this.Change=function(){null!=this.FOnChange&&this.FOnChange(this)},this.CreateInitialize=function(){pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this),this.FSpellCheck=!0,this.FLines=pas.Classes.TStringList.$create("Create$1"),this.FLines.SetSkipLastLineBreak(!0),this.FLines.FOnChange=rtl.createCallback(this,"DoLinesChange"),4 in this.FComponentState&&(this.SetWidth(400),this.SetHeight(300)),this.SetShowFocus(!0),this.SetClipChildren(!1),this.FWantTabs=!1,this.FAutoCompletion=0,this.FWordWrap=!0,this.FNoUserSelect=!1},this.Destroy=function(){rtl.free(this,"FLines"),pas["WEBLib.Controls"].TCustomControl.Destroy.call(this)}})),rtl.createClass(this,"TMemo",this.TCustomMemo,(function(){var t=this.$rtti;t.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),t.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",{Default:!1}),t.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),t.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize"),t.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti.TBiDiMode,"FBiDiMode","SetBiDiMode",{Default:pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight}),t.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti.TBorderStyle,"FBorderStyle","SetBorderStyle",{Default:pas["WEBLib.Controls"].TBorderStyle.bsSingle}),t.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",{Default:0}),t.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor","SetColor"),t.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti.TDragMode,"FDragMode","SetDragMode",{Default:pas["WEBLib.Controls"].TDragMode.dmManual}),t.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),t.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),t.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),t.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),t.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),t.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),t.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight"),t.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",{Default:100}),t.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FHeightStyle","SetHeightStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),t.addProperty("Hint",2,rtl.string,"FHint","SetHint"),t.addProperty("Left",3,rtl.longint,"GetLeft","SetLeft"),t.addProperty("Lines",2,pas.Classes.$rtti.TStrings,"FLines","SetLines"),t.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti.TMargins,"FMargins","SetMargins"),t.addProperty("ParentColor",2,rtl.boolean,"FParentColor","SetParentColor",{Default:!1}),t.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),t.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti.TPopupMenu,"FPopupMenu","FPopupMenu"),t.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly"),t.addProperty("Role",3,rtl.string,"GetRole","SetRole"),t.addProperty("SelStart",3,rtl.longint,"GetSelStart","SetSelStart"),t.addProperty("SelLength",3,rtl.longint,"GetSelLength","SetSelLength"),t.addProperty("ShowFocus",2,rtl.boolean,"FShowFocus","SetShowFocus",{Default:!1}),t.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",{Default:!1}),t.addProperty("Spellcheck",2,rtl.boolean,"FSpellCheck","SetSpellCheck",{Default:!0}),t.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder"),t.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",{Default:!0}),t.addProperty("TextDirection",0,pas["WEBLib.Controls"].$rtti.TTextDirection,"FTextDirection","FTextDirection",{Default:pas["WEBLib.Controls"].TTextDirection.tdDefault}),t.addProperty("Top",3,rtl.longint,"GetTop","SetTop"),t.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),t.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth"),t.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",{Default:100}),t.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FWidthStyle","SetWidthStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),t.addProperty("OnChange",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnChange","FOnChange"),t.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),t.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),t.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyDown","FOnKeyDown"),t.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti.TKeyPressEvent,"FOnKeyPress","FOnKeyPress"),t.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyUp","FOnKeyUp"),t.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseDown","FOnMouseDown"),t.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseUp","FOnMouseUp"),t.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti.TMouseMoveEvent,"FOnMouseMove","FOnMouseMove"),t.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseLeave","FOnMouseLeave"),t.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseEnter","FOnMouseEnter"),t.addProperty("OnMouseWheel",0,pas["WEBLib.Controls"].$rtti.TMouseWheelEvent,"FOnMouseWheel","FOnMouseWheel"),t.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnEnter","FOnEnter"),t.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnExit","FOnExit"),t.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti.TDragDropEvent,"FOnDragDrop","FOnDragDrop"),t.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti.TDragOverEvent,"FOnDragOver","FOnDragOver"),t.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FonEndDrag","FonEndDrag"),t.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti.TStartDragEvent,"FOnStartDrag","FOnStartDrag")})),rtl.createClass(this,"TWebMemo",this.TMemo,(function(){})),this.GetAutoCompletionName=function(t){var e="";return 0===t?e="":1===t?e="honorific-prefix":2===t?e="given-name":3===t?e="additional-name":4===t?e="family-name":5===t?e="honorific-suffix":6===t?e="nickname":7===t?e="email":8===t?e="username":9===t?e="new-password":10===t?e="current-password":11===t?e="organization-title":12===t?e="organization":13===t?e="street-address":14===t?e="address-line1":15===t?e="address-line2":16===t?e="address-line3":17===t?e="address-level1":18===t?e="address-level2":19===t?e="address-level3":20===t?e="address-level4":21===t?e="country":22===t?e="country-name":23===t?e="postal-code":24===t?e="cc-name":25===t?e="cc-given-name":26===t?e="cc-additional-name":27===t?e="cc-family-name":28===t?e="cc-number":29===t?e="cc-exp":30===t?e="cc-exp-month":31===t?e="cc-exp-year":32===t?e="cc-csc":33===t?e="cc-type":34===t?e="transaction-currency":35===t?e="transaction-amount":36===t?e="language":37===t?e="bday":38===t?e="bday-day":39===t?e="bday-month":40===t?e="bday-year":41===t?e="sex":42===t?e="tel":43===t?e="tel-country-code":44===t?e="tel-national":45===t?e="tel-area-code":46===t?e="tel-local":47===t?e="tel-extension":48===t?e="impp":49===t?e="url":50===t?e="photo":52===t&&(e="nope"),e}})),rtl.module("WEBLib.ExtCtrls",["System","Classes","SysUtils","Types","WEBLib.Controls","WEBLib.StdCtrls","WEBLib.Graphics","Web","JS","WEBLib.WebTools","WEBLib.Menus"],(function(){"use strict";rtl.createClass(this,"TCustomPanel",pas["WEBLib.Menus"].TWebCustomControl,(function(){this.$init=function(){pas["WEBLib.Menus"].TWebCustomControl.$init.call(this),this.FAutoSize=!1,this.FIsSizing=!1,this.FPadding=null,this.FShowCaption=!1,this.FLabel=null,this.FPanelBody=null,this.FElementBodyClassName="",this.FAlignment=0},this.$final=function(){this.FPadding=void 0,this.FLabel=void 0,this.FPanelBody=void 0,pas["WEBLib.Menus"].TWebCustomControl.$final.call(this)},this.SetShowCaption=function(t){this.FShowCaption!==t&&(this.FShowCaption=t,this.UpdateElementVisual())},this.SetPadding=function(t){this.FPadding.Assign(t)},this.SetAlignment=function(t){this.FAlignment!==t&&(this.FAlignment=t,this.UpdateElement())},this.CreateElement=function(){var t=null;return t=document.createElement("SPAN"),this.FPanelBody=document.createElement("DIV"),this.FPanelBody.setAttribute("class","card-body"),t.appendChild(this.FPanelBody),t},this.SetCaption=function(t){pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,t),null!=this.GetElementHandle()&&this.FShowCaption&&(null==this.FLabel?(this.FLabel=document.createElement("SPAN"),this.FLabel.innerHTML=this.FCaption,null!=this.GetChildContainer()?this.GetChildContainer().appendChild(this.FLabel):this.GetElementHandle().appendChild(this.FLabel),this.UpdateElementVisual()):this.FLabel.innerHTML=this.FCaption)},this.SetBorderStyle=function(t){pas["WEBLib.Controls"].TCustomControl.SetBorderStyle.apply(this,arguments),this.UpdateElement()},this.SetAutoSize=function(t){this.FAutoSize=t,this.FAutoSize&&!this.IsUpdating()&&this.DoAutoSize()},this.UpdateElementVisual=function(){if(pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this),null!=this.GetElementHandle()){if(this.GetIsLinked()||(this.FAutoSize?(this.GetElementHandle().style.setProperty("overflow",""),this.GetElementHandle().style.setProperty("white-space","normal"),this.FVisible&&this.GetElementHandle().style.setProperty("display","inline")):(this.GetElementHandle().style.setProperty("overflow","hidden"),this.GetElementHandle().style.setProperty("white-space","nowrap"),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"),""!==this.FElementBodyClassName?this.GetChildContainer().setAttribute("class",this.FElementBodyClassName):this.GetChildContainer().removeAttribute("class")),null!=this.FLabel&&(this.FShowCaption?this.FLabel.innerHTML=this.FCaption:this.FLabel.innerHTML="",this.FVisible)){this.GetElementHandle().style.setProperty("display","flex");var t=this.FAlignment;0===t?this.GetElementHandle().style.setProperty("justify-content","flex-start"):2===t?this.GetElementHandle().style.setProperty("justify-content","center"):1===t&&this.GetElementHandle().style.setProperty("justify-content","flex-end"),this.GetElementHandle().style.setProperty("align-items","center")}this.GetElementHandle().style.setProperty("user-select",""),0===this.FCursor&&this.GetElementHandle().style.setProperty("cursor","")}},this.GetOuterWidth=function(){return pas["WEBLib.Controls"].TControl.GetOuterWidth.call(this)},this.GetOuterHeight=function(){return pas["WEBLib.Controls"].TControl.GetOuterHeight.call(this)},this.GetChildContainer=function(){return null!=this.FPanelBody?this.FPanelBody:pas["WEBLib.Controls"].TControl.GetChildContainer.call(this)},this.RegisterParent=function(t){pas["WEBLib.Controls"].TControl.RegisterParent.apply(this,arguments),this.FAutoSize&&this.DoAutoSize()},this.UnRegisterParent=function(t){pas["WEBLib.Controls"].TControl.UnRegisterParent.apply(this,arguments),this.FAutoSize&&this.DoAutoSize()},this.DoAutoSize=function(){var t=0,e=0,i=0,s=0,n=0,r=null,o=null;if(!this.FIsSizing){if(this.FIsSizing=!0,1===this.FWidthStyle&&1===this.FHeightStyle){s=0,n=0,e=65535,i=65535;for(var l=0,a=this.GetControlsCount()-1;l<=a;l++)t=l,1===this.GetControls(t).FWidthStyle?(this.GetControls(t).GetLeft()+this.GetControls(t).GetWidth()>s&&(s=this.GetControls(t).GetLeft()+this.GetControls(t).GetWidth()),this.GetControls(t).GetLeft()<e&&(e=this.GetControls(t).GetLeft())):null!=(o=this.GetControls(t).GetElementHandle())&&((r=o.getBoundingClientRect()).x-this.GetLeft()+r.width>s&&(s=Math.round(r.x-this.GetLeft()+r.width)),e=0),1===this.GetControls(t).FHeightStyle?(this.GetControls(t).GetTop()+this.GetControls(t).GetHeight()>n&&(n=this.GetControls(t).GetTop()+this.GetControls(t).GetHeight()),this.GetControls(t).GetTop()<i&&(i=this.GetControls(t).GetTop())):null!=(o=this.GetControls(t).GetElementHandle())&&((r=o.getBoundingClientRect()).y-this.GetTop()+r.height>n&&(n=Math.round(r.y-this.GetTop()+r.height)),i=0);if(4 in this.FComponentState&&(0===this.GetControlsCount()||0===s||0===n))return;1===this.FBorderStyle&&(s+=1,n+=1);for(var h=0,u=this.GetControlsCount()-1;h<=u;h++)t=h,this.GetControls(t).SetLeft(this.GetControls(t).GetLeft()-e),this.GetControls(t).SetTop(this.GetControls(t).GetTop()-i);this.SetWidth(s-e),this.SetHeight(n-i)}else this.SetWidth(-1),this.SetHeight(-1);this.UpdateElement(),this.FIsSizing=!1}},this.AlignControl=function(t){pas["WEBLib.Controls"].TControl.AlignControl.apply(this,arguments),this.FAutoSize&&this.DoAutoSize()},this.CreateInitialize=function(){pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this),4 in this.FComponentState&&(this.FEnablePropagation=!0),this.FAutoSize=!1,this.FAlignment=2,this.SetColor(15790320),this.SetTabStop(!1),this.FCustomBorder=!0,this.SetShowCaption(!0),this.FControlStyle=rtl.unionSet(this.FControlStyle,rtl.createSet(0)),this.FLabel=null,this.FPadding=pas["WEBLib.Controls"].TPadding.$create("Create$1"),4 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),this.FAutoSize&&this.SetAutoSize(!0)}})),rtl.createClass(this,"TPanel",this.TCustomPanel,(function(){var t=this.$rtti;t.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),t.addProperty("Alignment",2,pas.Classes.$rtti.TAlignment,"FAlignment","SetAlignment",{Default:pas.Classes.TAlignment.taCenter}),t.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",{Default:!1}),t.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),t.addProperty("AutoSize",2,rtl.boolean,"FAutoSize","SetAutoSize",{Default:!1}),t.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FBorderColor","SetBorderColor",{Default:12632256}),t.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti.TBorderStyle,"FBorderStyle","SetBorderStyle",{Default:pas["WEBLib.Controls"].TBorderStyle.bsSingle}),t.addProperty("Caption",2,rtl.string,"FCaption","SetCaption"),t.addProperty("ChildOrder",2,rtl.longint,"FChildOrder","SetChildOrderEx",{Default:0}),t.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor","SetColor"),t.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti.TDragMode,"FDragMode","SetDragMode",{Default:pas["WEBLib.Controls"].TDragMode.dmManual}),t.addProperty("ElementBodyClassName",0,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementBodyClassName","FElementBodyClassName"),t.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),t.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),t.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),t.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),t.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",{Default:100}),t.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FHeightStyle","SetHeightStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),t.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti.TMargins,"FMargins","SetMargins"),t.addProperty("Padding",2,pas["WEBLib.Controls"].$rtti.TPadding,"FPadding","SetPadding"),t.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),t.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti.TPopupMenu,"FPopupMenu","FPopupMenu"),t.addProperty("Role",3,rtl.string,"GetRole","SetRole"),t.addProperty("ShowCaption",2,rtl.boolean,"FShowCaption","SetShowCaption",{Default:!0}),t.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",{Default:100}),t.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FWidthStyle","SetWidthStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),t.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),t.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),t.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti.TDragDropEvent,"FOnDragDrop","FOnDragDrop"),t.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti.TDragOverEvent,"FOnDragOver","FOnDragOver"),t.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FonEndDrag","FonEndDrag"),t.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti.TStartDragEvent,"FOnStartDrag","FOnStartDrag")}))}),["WEBLib.Utils"]),rtl.module("DBConst",["System"],(function(){"use strict";this.$resourcestrings={SActiveDataset:{org:"Operation cannot be performed on an active dataset"},SDuplicateFieldName:{org:'Duplicate fieldname : "%s"'},SFieldNotFound:{org:'Field not found : "%s"'},SInvalidTypeConversion:{org:"Invalid type conversion to %s in field %s"},SNoDataset:{org:'No dataset asssigned for field : "%s"'},SUniDirectional:{org:"Operation cannot be performed on an unidirectional dataset"},SFieldValueError:{org:"Invalid value for field '%s'"},SDuplicateName:{org:"Duplicate name '%s' in %s"},SNestedDataSetClass:{org:"Nested dataset must inherit from %s"},SCircularDataLink:{org:"Circular datalinks are not allowed"}}})),rtl.module("DB",["System","Classes","SysUtils","JS","Types"],(function(){"use strict";var t=this,e=t.$impl;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.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.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("TField"),this.$rtti.$Class("TDataSet"),this.$rtti.$Class("TDataSource"),rtl.createClass(this,"EDatabaseError",pas.SysUtils.Exception,(function(){})),this.TFieldType={0:"ftUnknown",ftUnknown:0,1:"ftString",ftString:1,2:"ftInteger",ftInteger:2,3:"ftLargeInt",ftLargeInt:3,4:"ftBoolean",ftBoolean:4,5:"ftFloat",ftFloat:5,6:"ftDate",ftDate:6,7:"ftTime",ftTime:7,8:"ftDateTime",ftDateTime:8,9:"ftAutoInc",ftAutoInc:9,10:"ftBlob",ftBlob:10,11:"ftMemo",ftMemo:11,12:"ftFixedChar",ftFixedChar:12,13:"ftVariant",ftVariant:13,14:"ftDataset",ftDataset:14,15:"ftWideString",ftWideString:15,16:"ftWord",ftWord:16},this.$rtti.$Enum("TFieldType",{minvalue:0,maxvalue:16,ordtype:1,enumtype:this.TFieldType}),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.SetDisplayName=function(e){var i=0;this.FName!==e&&(""!==e&&t.TFieldDefs.isPrototypeOf(this.FCollection)&&(i=this.FCollection.IndexOf(e))>=0&&i!==this.GetIndex()&&t.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SDuplicateName"),pas.System.VarRecs(18,e,18,this.FCollection.$classname)),this.FName=e,pas.Classes.TCollectionItem.SetDisplayName.call(this,e))},this.$rtti.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.$final=function(){this.FDataset=void 0,pas.Classes.TOwnedCollection.$final.call(this)},this.SetItemName=function(e){var i=null,s="";""===(i=rtl.as(e,t.TNamedItem)).FName?(s=pas.System.Copy(this.$classname,2,5)+pas.SysUtils.IntToStr(i.FID+1),null!=this.FDataset&&(s=this.FDataset.FName+s),i.SetDisplayName(s)):pas.Classes.TCollection.SetItemName.call(this,e)},this.create$3=function(t,e,i){return pas.Classes.TOwnedCollection.Create$2.call(this,e,i),this.FDataset=t,this},this.IndexOf=function(t){var e=0,i=0;e=-1;for(var s=0,n=this.GetCount()-1;s<=n;s++)if(i=s,pas.SysUtils.AnsiSameText(this.GetItem(i).FName,t)){e=i;break}return e}})),rtl.createClass(this,"TFieldDef",this.TNamedItem,(function(){this.$init=function(){t.TNamedItem.$init.call(this),this.FAttributes={},this.FDataType=0,this.FFieldNo=0,this.FPrecision=0,this.FRequired=!1,this.FSize=0},this.$final=function(){this.FAttributes=void 0,t.TNamedItem.$final.call(this)},this.SetAttributes=function(t){this.FAttributes=rtl.refSet(t),this.Changed(!1)},this.SetDataType=function(t){this.FDataType=t,this.Changed(!1)},this.SetPrecision=function(t){this.FPrecision=t,this.Changed(!1)},this.SetSize=function(t){this.FSize=t,this.Changed(!1)},this.Create$1=function(t){return pas.Classes.TCollectionItem.Create$1.call(this,t),this.FFieldNo=this.GetIndex()+1,this},this.Destroy=function(){pas.Classes.TCollectionItem.Destroy.call(this)},this.Assign=function(e){var i=null;if(i=null,t.TFieldDef.isPrototypeOf(e)&&(i=rtl.as(e,t.TFieldDef)),null!=i){this.FCollection.BeginUpdate();try{this.SetDisplayName(i.FName),this.SetDataType(i.FDataType),this.SetSize(i.FSize),this.SetPrecision(i.FPrecision),this.FRequired=i.FRequired}finally{this.FCollection.EndUpdate()}}else pas.Classes.TPersistent.Assign.call(this,e)};var e=this.$rtti;e.addProperty("Attributes",2,t.$rtti.TFieldAttributes,"FAttributes","SetAttributes",{Default:{}}),e.addProperty("DataType",2,t.$rtti.TFieldType,"FDataType","SetDataType"),e.addProperty("Precision",2,rtl.longint,"FPrecision","SetPrecision",{Default:0}),e.addProperty("Size",2,rtl.longint,"FSize","SetSize",{Default:0})})),rtl.createClass(this,"TFieldDefs",this.TDefCollection,(function(){this.FieldDefClass=function(){return t.TFieldDef},this.Create$4=function(e){return t.TDefCollection.create$3.call(this,e,this.Owner(),this.$class.FieldDefClass()),this}})),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.$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}),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=void 0,pas.System.TObject.$final.call(this)},this.Destroy=function(){this.Clear(),this.FList.$destroy("Destroy"),pas.System.TObject.Destroy.call(this)},this.Clear=function(){this.FList.Clear()}})),rtl.createClass(this,"TField",pas.Classes.TComponent,(function(){this.$init=function(){pas.Classes.TComponent.$init.call(this),this.FAlignment=0,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.FFields=null,this.FHasConstraints=!1,this.FImportedConstraint="",this.FKeyFields="",this.FLookupCache=!1,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=!1,this.FRequired=!1,this.FValidChars=[],this.FValueBuffer=void 0,this.FValidating=!1,this.FVisible=!1,this.FProviderFlags={}},this.$final=function(){this.FDataSet=void 0,this.FFieldDef=void 0,this.FFields=void 0,this.FLookupDataSet=void 0,this.FLookupList=void 0,this.FOnChange=void 0,this.FOnGetText=void 0,this.FOnSetText=void 0,this.FOnValidate=void 0,this.FValidChars=void 0,this.FProviderFlags=void 0,pas.Classes.TComponent.$final.call(this)},this.GetIndex=function(){return null!=this.FDataSet?this.FDataSet.FFieldList.IndexOf(this):-1},this.SetAlignment=function(t){this.FAlignment!==t&&(this.FAlignment=t,this.PropertyChanged(!1))},this.SetIndex=function(t){null!==this.FFields&&this.FFields.SetFieldIndex(this,t)},this.SetDisplayLabel=function(t){this.FDisplayLabel!==t&&(this.FDisplayLabel=t,this.PropertyChanged(!0))},this.SetDisplayWidth=function(t){this.FDisplayWidth!==t&&(this.FDisplayWidth=t,this.PropertyChanged(!0))},this.GetDisplayWidth=function(){return 0===this.FDisplayWidth?this.GetDefaultWidth():this.FDisplayWidth},this.SetReadOnly=function(t){this.FReadOnly!==t&&(this.FReadOnly=t,this.PropertyChanged(!0))},this.SetVisible=function(t){this.FVisible!==t&&(this.FVisible=t,this.PropertyChanged(!0))},this.IsDisplayLabelStored=function(){return this.GetDisplayName()!==this.FFieldName},this.IsDisplayWidthStored=function(){return 0!==this.FDisplayWidth},this.CalcLookupValue=function(){null!=this.FLookupDataSet&&this.FLookupDataSet.GetActive()?this.SetAsJSValue(this.FLookupDataSet.Lookup(this.FLookupKeyfields,this.FDataSet.GetFieldValues(this.FKeyFields),this.FLookupresultField)):this.SetAsJSValue(null)},this.RaiseAccessError=function(t){throw this.AccessError(t)},this.AccessError=function(e){return t.EDatabaseError.$create("CreateFmt",[rtl.getResStr(pas.DBConst,"SInvalidTypeConversion"),pas.System.VarRecs(18,e,18,this.FFieldName)])},this.Change=function(){null!=this.FOnChange&&this.FOnChange(this)},this.GetAsJSValue=function(){return this.GetData()},this.GetDefaultWidth=function(){return 10,10},this.GetDisplayName=function(){return""!==this.FDisplayLabel?this.FDisplayLabel:this.FFieldName},this.Notification=function(t,e){pas.Classes.TComponent.Notification.call(this,t,e),1===e&&t===this.FLookupDataSet&&(this.FLookupDataSet=null)},this.PropertyChanged=function(t){null!==this.FDataSet&&this.FDataSet.GetActive()&&(t?this.FDataSet.DataEvent(4,0):this.FDataSet.DataEvent(2,0))},this.SetAsJSValue=function(e){if(pas.JS.isNull(e))this.Clear();else try{this.SetVarValue(e)}catch(e){if(!pas.SysUtils.EVariantError.isPrototypeOf(e))throw e;t.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SFieldValueError"),pas.System.VarRecs(18,this.GetDisplayName()))}},this.SetDataset=function(t){t!==this.FDataSet&&(null!=this.FDataSet&&(this.FDataSet.CheckInactive(),this.FDataSet.FFieldList.Remove(this)),null!=t&&(t.CheckInactive(),t.FFieldList.Add(this)),this.FDataSet=t)},this.SetDataType=function(t){this.FDataType=t},this.SetVarValue=function(t){this.RaiseAccessError(e.SJSValue)},this.Create$1=function(t){return pas.Classes.TComponent.Create$1.call(this,t),this.FVisible=!0,this.FValidChars=rtl.arraySetLength(this.FValidChars,"",255),this.FProviderFlags=rtl.createSet(0,1),this},this.Destroy=function(){null!=this.FDataSet&&(this.FDataSet.SetActive(!1),null!=this.FFields&&this.FFields.Remove(this)),rtl.free(this,"FLookupList"),pas.Classes.TComponent.Destroy.call(this)},this.SetParentComponent=function(e){this.SetDataset(rtl.as(e,t.TDataSet))},this.Assign=function(e){null===e?this.Clear():t.TField.isPrototypeOf(e)?this.SetAsJSValue(e.GetAsJSValue()):pas.Classes.TPersistent.Assign.call(this,e)},this.Clear=function(){this.SetData(null)},this.GetData=function(){var e=void 0;return null===this.FDataSet&&t.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SNoDataset"),pas.System.VarRecs(18,this.FFieldName)),this.FValidating?e=this.FValueBuffer:(e=this.FDataSet.GetFieldData(this),pas.JS.isUndefined(e)&&(e=null)),e},this.SetData=function(e){null==this.FDataSet&&t.DatabaseErrorFmt(rtl.getResStr(pas.DBConst,"SNoDataset"),pas.System.VarRecs(18,this.FFieldName)),this.FDataSet.SetFieldData(this,e)};var i=this.$rtti;i.addProperty("Alignment",2,pas.Classes.$rtti.TAlignment,"FAlignment","SetAlignment",{Default:pas.Classes.TAlignment.taLeftJustify}),i.addProperty("CustomConstraint",0,rtl.string,"FCustomConstraint","FCustomConstraint"),i.addProperty("ConstraintErrorMessage",0,rtl.string,"FConstraintErrorMessage","FConstraintErrorMessage"),i.addProperty("DefaultExpression",0,rtl.string,"FDefaultExpression","FDefaultExpression"),i.addProperty("DisplayLabel",15,rtl.string,"GetDisplayName","SetDisplayLabel",{stored:"IsDisplayLabelStored"}),i.addProperty("DisplayWidth",15,rtl.longint,"GetDisplayWidth","SetDisplayWidth",{stored:"IsDisplayWidthStored"}),i.addProperty("FieldKind",0,t.$rtti.TFieldKind,"FFieldKind","FFieldKind"),i.addProperty("FieldName",0,rtl.string,"FFieldName","FFieldName"),i.addProperty("HasConstraints",0,rtl.boolean,"FHasConstraints",""),i.addProperty("Index",3,rtl.longint,"GetIndex","SetIndex"),i.addProperty("ImportedConstraint",0,rtl.string,"FImportedConstraint","FImportedConstraint"),i.addProperty("KeyFields",0,rtl.string,"FKeyFields","FKeyFields"),i.addProperty("LookupCache",0,rtl.boolean,"FLookupCache","FLookupCache"),i.addProperty("LookupDataSet",0,t.$rtti.TDataSet,"FLookupDataSet","FLookupDataSet"),i.addProperty("LookupKeyFields",0,rtl.string,"FLookupKeyfields","FLookupKeyfields"),i.addProperty("LookupResultField",0,rtl.string,"FLookupresultField","FLookupresultField"),i.addProperty("Origin",0,rtl.string,"FOrigin","FOrigin"),i.addProperty("ProviderFlags",0,t.$rtti.TProviderFlags,"FProviderFlags","FProviderFlags"),i.addProperty("ReadOnly",2,rtl.boolean,"FReadOnly","SetReadOnly"),i.addProperty("Required",0,rtl.boolean,"FRequired","FRequired"),i.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),i.addProperty("OnChange",0,t.$rtti.TFieldNotifyEvent,"FOnChange","FOnChange"),i.addProperty("OnGetText",0,t.$rtti.TFieldGetTextEvent,"FOnGetText","FOnGetText"),i.addProperty("OnSetText",0,t.$rtti.TFieldSetTextEvent,"FOnSetText","FOnSetText"),i.addProperty("OnValidate",0,t.$rtti.TFieldNotifyEvent,"FOnValidate","FOnValidate")})),rtl.createClass(this,"TDataSetField",this.TField,(function(){this.$init=function(){t.TField.$init.call(this),this.FNestedDataSet=null},this.$final=function(){this.FNestedDataSet=void 0,t.TField.$final.call(this)},this.AssignNestedDataSet=function(t){null!=this.FNestedDataSet&&(this.FNestedDataSet.Close(),this.FNestedDataSet.FDataSetField=null,null!=this.FDataSet&&this.FDataSet.GetNestedDataSets().Remove(this.FNestedDataSet)),null!=t&&this.FDataSet.GetNestedDataSets().Add(t),this.FNestedDataSet=t},this.Create$1=function(e){return t.TField.Create$1.apply(this,arguments),this.SetDataType(14),this},this.Destroy=function(){this.AssignNestedDataSet(null),t.TField.Destroy.call(this)}})),rtl.createClass(this,"TCheckConstraint",pas.Classes.TCollectionItem,(function(){this.$init=function(){pas.Classes.TCollectionItem.$init.call(this),this.FCustomConstraint="",this.FErrorMessage="",this.FFromDictionary=!1,this.FImportedConstraint=""},this.Assign=function(t){};var t=this.$rtti;t.addProperty("CustomConstraint",0,rtl.string,"FCustomConstraint","FCustomConstraint"),t.addProperty("ErrorMessage",0,rtl.string,"FErrorMessage","FErrorMessage"),t.addProperty("FromDictionary",0,rtl.boolean,"FFromDictionary","FFromDictionary"),t.addProperty("ImportedConstraint",0,rtl.string,"FImportedConstraint","FImportedConstraint")})),rtl.createClass(this,"TCheckConstraints",pas.Classes.TCollection,(function(){this.GetOwner=function(){return null,null},this.Create$2=function(e){return pas.Classes.TCollection.Create$1.call(this,t.TCheckConstraint),this}})),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=void 0,this.FFieldList=void 0,this.FOnChange=void 0,this.FValidFieldKinds=void 0,pas.System.TObject.$final.call(this)},this.ClearFieldDefs=function(){for(var t=0,e=0,i=this.GetCount()-1;e<=i;e++)t=e,this.GetField(t).FFieldDef=null},this.Changed=function(){null===this.FDataset||3 in this.FDataset.FComponentState||this.FDataset.DataEvent(9,0),null!=this.FOnChange&&this.FOnChange(this)},this.GetCount=function(){return this.FFieldList.FCount},this.GetField=function(t){return rtl.getObject(this.FFieldList.Get(t))},this.SetFieldIndex=function(t,e){var i;-1!==(i=this.FFieldList.IndexOf(t))&&(e<0&&(e=0),e>=this.GetCount()&&(e=this.GetCount()-1),e!==i&&(this.FFieldList.Delete(i),this.FFieldList.Insert(e,t),t.PropertyChanged(!0),this.Changed()))},this.Create$1=function(t){return this.FDataset=t,this.FFieldList=pas.Classes.TFPList.$create("Create"),this.FValidFieldKinds=rtl.createSet(null,0,3),this},this.Destroy=function(){null!=this.FFieldList&&this.Clear(),pas.SysUtils.FreeAndNil({p:this,get:function(){return this.p.FFieldList},set:function(t){this.p.FFieldList=t}}),pas.System.TObject.Destroy.call(this)},this.Add=function(t){this.CheckFieldName(t.FFieldName),this.FFieldList.Add(t),t.FFields=this,this.Changed()},this.CheckFieldName=function(e){null!==this.FindField(e)&&t.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SDuplicateFieldName"),pas.System.VarRecs(18,e),this.FDataset)},this.Clear=function(){for(var t=null;this.FFieldList.FCount>0;)(t=rtl.getObject(this.FFieldList.Last())).FDataSet=null,t=rtl.freeLoc(t),this.FFieldList.Delete(this.FFieldList.FCount-1);this.Changed()},this.FindField=function(t){var e,i=null,s=0;e=pas.SysUtils.UpperCase(t);for(var n=0,r=this.FFieldList.FCount-1;n<=r;n++)if(s=n,i=rtl.getObject(this.FFieldList.Get(s)),e===pas.SysUtils.UpperCase(i.FFieldName))return i;return i=null},this.IndexOf=function(t){return this.FFieldList.IndexOf(t)},this.Remove=function(t){this.FFieldList.Remove(t),t.FFields=null,this.Changed()}})),this.TBookmarkFlag={0:"bfCurrent",bfCurrent:0,1:"bfBOF",bfBOF:1,2:"bfEOF",bfEOF:2,3:"bfInserted",bfInserted:3},this.TGetMode={0:"gmCurrent",gmCurrent:0,1:"gmNext",gmNext:1,2:"gmPrior",gmPrior:2},this.TGetResult={0:"grOK",grOK:0,1:"grBOF",grBOF:1,2:"grEOF",grEOF:2,3:"grError",grError:3},this.TRecordState={0:"rsNew",rsNew:0,1:"rsClean",rsClean:1,2:"rsUpdate",rsUpdate:2,3:"rsDelete",rsDelete:3},rtl.recNewT(this,"TDataRecord",(function(){this.data=void 0,this.state=0,this.$eq=function(t){return this.data===t.data&&this.state===t.state},this.$assign=function(t){return this.data=t.data,this.state=t.state,this}})),rtl.createClass(this,"TDataSet",pas.Classes.TComponent,(function(){this.$init=function(){pas.Classes.TComponent.$init.call(this),this.FCalcBuffer=t.TDataRecord.$new(),this.FCalcFieldsCount=0,this.FOpenAfterRead=!1,this.FActiveRecord=0,this.FAfterClose=null,this.FAfterOpen=null,this.FAfterScroll=null,this.FAutoCalcFields=!1,this.FBOF=!1,this.FBeforeClose=null,this.FBeforeOpen=null,this.FBuffers=[],this.FBufferCount=0,this.FConstraints=null,this.FDisableControlsCount=0,this.FCurrentRecord=0,this.FDataSources=null,this.FDefaultFields=!1,this.FEOF=!1,this.FEnableControlsEvent=0,this.FFieldList=null,this.FFieldDefs=null,this.FInternalCalcFields=!1,this.FModified=!1,this.FOnCalcFields=null,this.FRecordCount=0,this.FIsUniDirectional=!1,this.FState=0,this.FInternalOpenComplete=!1,this.FDataProxy=null,this.FDataRequestID=0,this.FChangeList=null,this.FDataSetField=null,this.FNestedDataSets=null,this.FNestedDataSetClass=null},this.$final=function(){this.FCalcBuffer=void 0,this.FAfterClose=void 0,this.FAfterOpen=void 0,this.FAfterScroll=void 0,this.FBeforeClose=void 0,this.FBeforeOpen=void 0,this.FBuffers=void 0,this.FConstraints=void 0,this.FDataSources=void 0,this.FFieldList=void 0,this.FFieldDefs=void 0,this.FOnCalcFields=void 0,this.FDataProxy=void 0,this.FChangeList=void 0,this.FDataSetField=void 0,this.FNestedDataSets=void 0,this.FNestedDataSetClass=void 0,pas.Classes.TComponent.$final.call(this)},this.DoInternalOpen=function(){this.InternalOpen(),this.FInternalOpenComplete=!0,this.FRecordCount=0,this.RecalcBufListSize(),this.FBOF=!0,this.FEOF=0===this.FRecordCount,this.InitChangeList()},this.RegisterDataSource=function(t){this.FDataSources.Add(t),this.RecalcBufListSize()},this.ShiftBuffersForward=function(){var e=t.TDataRecord.$new(),i=0;e.$assign(this.FBuffers[this.FBufferCount]);for(var s=this.FBufferCount;s>=1;s--)i=s,this.FBuffers[i].$assign(this.FBuffers[i-1]);this.FBuffers[0].$assign(e)},this.ShiftBuffersBackward=function(){var e=t.TDataRecord.$new(),i=0;e.$assign(this.FBuffers[0]);for(var s=1,n=this.FBufferCount;s<=n;s++)i=s,this.FBuffers[i-1].$assign(this.FBuffers[i]);this.FBuffers[this.FBufferCount].$assign(e)},this.GetActive=function(){return 0!==this.FState&&12!==this.FState},this.UnRegisterDataSource=function(t){this.FDataSources.Remove(t)},this.GetNestedDataSets=function(){return null==this.FNestedDataSets&&(this.FNestedDataSets=pas.Classes.TFPList.$create("Create")),this.FNestedDataSets},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(t){this.p.FChangeList=t}})},this.ClearChangeList=function(){var t=0;if(null!=this.FChangeList)for(var e=0,i=this.FChangeList.FCount-1;e<=i;e++)t=e,rtl.getObject(this.FChangeList.Get(t)).$destroy("Destroy"),this.FChangeList.Put(t,null)},this.RecalcBufListSize=function(){var t=0,e=0,i=0,s=null;if(this.IsCursorOpen()){i=this.FIsUniDirectional?1:10;for(var n=0,r=this.FDataSources.FCount-1;n<=r;n++){t=n;for(var o=0,l=rtl.getObject(this.FDataSources.Get(t)).FDataLinks.GetCount()-1;o<=l;o++)e=o,i<(s=rtl.getObject(rtl.getObject(this.FDataSources.Get(t)).FDataLinks.Get(e))).GetBufferCount()&&(i=s.GetBufferCount())}this.FBufferCount!==i&&(this.SetBufListSize(i),this.GetNextRecords(),this.FRecordCount<this.FBufferCount&&!this.FIsUniDirectional&&(this.FActiveRecord=this.FActiveRecord+this.GetPriorRecords(),this.CursorPosChanged()))}},this.ActivateBuffers=function(){this.FBOF=!1,this.FEOF=!1,this.FActiveRecord=0},this.CalculateFields=function(t){var e=0;if(this.FCalcBuffer.$assign(t),11!==this.FState&&(this.ClearCalcFields(this.FCalcBuffer),!this.FIsUniDirectional))for(var i=0,s=this.FFieldList.GetCount()-1;i<=s;i++)e=i,2===this.FFieldList.GetField(e).FFieldKind&&this.FFieldList.GetField(e).CalcLookupValue();this.DoOnCalcFields()},this.CheckInactive=function(){this.GetActive()&&t.DatabaseError$1(rtl.getResStr(pas.DBConst,"SActiveDataset"),this)},this.CheckBiDirectional=function(){this.FIsUniDirectional&&t.DatabaseError$1(rtl.getResStr(pas.DBConst,"SUniDirectional"),this)},this.Loaded=function(){pas.Classes.TComponent.Loaded.call(this);try{this.FOpenAfterRead&&this.SetActive(!0)}catch(e){if(!pas.SysUtils.Exception.isPrototypeOf(e))throw e;var t=e;4 in this.FComponentState&&this.InternalHandleException(t)}},this.ClearBuffers=function(){this.FRecordCount=0,this.FActiveRecord=0,this.FCurrentRecord=-1,this.FBOF=!0,this.FEOF=!0},this.ClearCalcFields=function(t){},this.CloseCursor=function(){this.ClearBuffers(),this.SetBufListSize(0),this.FFieldList.ClearFieldDefs(),this.InternalClose(),this.FInternalOpenComplete=!1},this.DataEvent=function(t,e){var i=this;var s,n=0,r=t;if(0===r?((s=rtl.getObject(e)).FFieldKind in rtl.createSet(0,3)&&i.SetModified(!0),4!==i.FState&&(0===s.FFieldKind&&(i.FInternalCalcFields?i.RefreshInternalCalcFields(i.FBuffers[i.FActiveRecord]):i.FAutoCalcFields&&0!==i.FCalcFieldsCount&&i.CalculateFields(i.FBuffers[i.FActiveRecord])),s.Change())):2===r||3===r?function(){var t=0,e=null;if(3!==i.FState&&i.UpdateCursorPos(),null!=i.FNestedDataSets)for(var s=0,n=i.GetNestedDataSets().FCount-1;s<=n;s++)t=s,(e=rtl.getObject(i.GetNestedDataSets().Get(t))).GetActive()&&e.DataEvent(11,0)}():4===r&&(this.FEnableControlsEvent=4),!this.ControlsDisabled()&&10!==this.FState)for(var o=0,l=this.FDataSources.FCount-1;o<=l;o++)n=o,rtl.getObject(this.FDataSources.Get(n)).ProcessEvent(t,e)},this.DoAfterClose=function(){null==this.FAfterClose||3 in this.FComponentState||this.FAfterClose(this)},this.DoAfterOpen=function(){null!=this.FAfterOpen&&this.FAfterOpen(this)},this.DoAfterScroll=function(){null!=this.FAfterScroll&&this.FAfterScroll(this)},this.DoBeforeClose=function(){null==this.FBeforeClose||3 in this.FComponentState||this.FBeforeClose(this)},this.DoBeforeOpen=function(){null!=this.FBeforeOpen&&this.FBeforeOpen(this)},this.DoOnCalcFields=function(){null!=this.FOnCalcFields&&this.FOnCalcFields(this)},this.GetfieldCount=function(){return this.FFieldList.GetCount()},this.GetFieldValues=function(t){var e=void 0,i=0,s=null,n=[];s=pas.Classes.TList.$create("Create$1");try{if(this.GetFieldList(s,t),s.GetCount()>1){n=rtl.arraySetLength(n,void 0,s.GetCount());for(var r=0,o=s.GetCount()-1;r<=o;r++)n[i=r]=rtl.getObject(s.Get(i)).GetAsJSValue();e=n}else e=this.FieldByName(t).GetAsJSValue()}finally{s=rtl.freeLoc(s)}return e},this.GetNextRecords=function(){var t=0;for(t=0;this.FRecordCount<this.FBufferCount&&this.GetNextRecord();)t+=1;return t},this.GetNextRecord=function(){var e,i=t.TDataRecord.$new();return this.FRecordCount>0&&this.SetCurrentRecord(this.FRecordCount-1),(e=0===this.GetRecord(this.FBuffers[this.FBufferCount],1,!0))?(0===this.FRecordCount&&this.ActivateBuffers(),this.FRecordCount===this.FBufferCount?this.ShiftBuffersBackward():(this.FRecordCount+=1,this.FCurrentRecord=this.FRecordCount-1,i.$assign(this.FBuffers[this.FCurrentRecord]),this.FBuffers[this.FCurrentRecord].$assign(this.FBuffers[this.FBufferCount]),this.FBuffers[this.FBufferCount].$assign(i))):this.CursorPosChanged(),e},this.GetPriorRecords=function(){var t=0;for(t=0;this.FRecordCount<this.FBufferCount&&this.GetPriorRecord();)t+=1;return t},this.GetPriorRecord=function(){var t;return this.CheckBiDirectional(),this.FRecordCount>0&&this.SetCurrentRecord(0),(t=0===this.GetRecord(this.FBuffers[this.FBufferCount],2,!0))?(0===this.FRecordCount&&this.ActivateBuffers(),this.ShiftBuffersForward(),this.FRecordCount<this.FBufferCount&&(this.FRecordCount+=1)):this.CursorPosChanged(),t},this.OpenCursor=function(t){t?this.InternalInitFieldDefs():12!==this.FState&&this.DoInternalOpen()},this.OpenCursorcomplete=function(){try{12===this.FState&&this.DoInternalOpen()}finally{this.FInternalOpenComplete?(this.SetState(1),this.DoAfterOpen(),this.IsEmpty()||this.DoAfterScroll()):(this.SetState(0),this.CloseCursor())}},this.RefreshInternalCalcFields=function(t){},this.SetActive=function(t){if(t&&0===this.FState){if(0 in this.FComponentState)return void(this.FOpenAfterRead=!0);this.DoBeforeOpen(),this.FEnableControlsEvent=4,this.FInternalCalcFields=!1;try{this.FDefaultFields=0===this.GetfieldCount(),this.OpenCursor(!1)}finally{12!==this.FState&&this.OpenCursorcomplete()}this.FModified=!1}else t||0===this.FState||(this.DoBeforeClose(),this.SetState(0),this.FDataRequestID=0,this.DoneChangeList(),this.CloseCursor(),this.DoAfterClose(),this.FModified=!1)},this.SetBufListSize=function(e){var i=0;if(e<0&&(e=0),e!==this.FBufferCount){if(e>this.FBufferCount){this.FBuffers=rtl.arraySetLength(this.FBuffers,t.TDataRecord,e+1);for(var s=this.FBufferCount,n=e;s<=n;s++)i=s,this.FBuffers[i].$assign(this.AllocRecordBuffer())}else if(e<this.FBufferCount&&e>=0&&this.FActiveRecord>e-1){for(var r=0,o=this.FActiveRecord-e;r<=o;r++)i=r,this.ShiftBuffersBackward();this.FActiveRecord=e-1}this.FBuffers=rtl.arraySetLength(this.FBuffers,t.TDataRecord,e+1),this.FBufferCount=e,this.FRecordCount>this.FBufferCount&&(this.FRecordCount=this.FBufferCount)}},this.SetCurrentRecord=function(e){if(this.FCurrentRecord!==e){if(!this.FIsUniDirectional){var i=this.GetBookmarkFlag(t.TDataRecord.$clone(this.FBuffers[e]));0===i?this.InternalSetToRecord(t.TDataRecord.$clone(this.FBuffers[e])):1===i?this.InternalFirst():2===i&&this.InternalLast()}this.FCurrentRecord=e}},this.SetModified=function(t){this.FModified=t},this.SetName=function(t){var e=this;function i(t){var i="",s=0,n=0;for(i=t,s=0,n=0;s<e.FFieldList.GetCount();)i===e.FFieldList.GetField(s).FFieldName?(n+=1,i=t+pas.SysUtils.IntToStr(n)):s+=1;return i}var s,n=0,r="";if(e.FName!==t&&(s=e.FName,pas.Classes.TComponent.SetName.call(this,t),4 in this.FComponentState))for(var o=0,l=this.FFieldList.GetCount()-1;o<=l;o++)n=o,r=s+this.FFieldList.GetField(n).FFieldName,pas.System.Copy(this.FFieldList.GetField(n).FName,1,r.length)===r&&this.FFieldList.GetField(n).SetName(i(t+this.FFieldList.GetField(n).FFieldName))},this.SetState=function(t){t!==this.FState&&(this.FState=t,1===t&&(this.FModified=!1),this.DataEvent(6,0))},this.AllocRecordBuffer=function(){var e=t.TDataRecord.$new();return e.data=null,e.state=0,e},this.FreeRecordBuffer=function(t){},this.GetBookmarkFlag=function(t){return 0,0},this.GetDataSource=function(){return null,null},this.InternalFirst=function(){},this.InternalHandleException=function(t){pas.SysUtils.ShowException(t,null)},this.InternalLast=function(){},this.InternalSetToRecord=function(t){},this.Notification=function(t,e){pas.Classes.TComponent.Notification.call(this,t,e),1===e&&t===this.FDataProxy&&(this.FDataProxy=null)},this.SetDataSetField=function(e){e!==this.FDataSetField&&(null!==e&&(e.FDataSet===this||null!==e.FDataSet.GetDataSource()&&e.FDataSet.GetDataSource().FDataSet===this)&&t.DatabaseError$1(rtl.getResStr(pas.DBConst,"SCircularDataLink"),this),null==e||this.$class.InheritsFrom(e.FDataSet.FNestedDataSetClass)||t.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SNestedDataSetClass"),pas.System.VarRecs(18,e.FDataSet.FNestedDataSetClass.$classname),this),this.GetActive()&&this.Close(),null!=this.FDataSetField&&this.FDataSetField.AssignNestedDataSet(null),this.FDataSetField=e,null!=e&&(e.AssignNestedDataSet(this),e.FDataSet.GetActive()&&this.Open()))},this.GetFieldData=function(e){return this.GetFieldData$1(e,t.TDataRecord.$clone(this.ActiveBuffer()))},this.SetFieldData=function(t,e){this.SetFieldData$1(t,this.FBuffers[this.FActiveRecord],e)},this.GetFieldData$1=function(t,e){var i=void 0;return i=e.data[t.FFieldName],pas.JS.isUndefined(i)&&(i=null),i},this.SetFieldData$1=function(t,e,i){e.data[t.FFieldName]=i},this.FieldDefsClass=function(){return t.TFieldDefs},this.FieldsClass=function(){return t.TFields},this.Create$1=function(e){return pas.Classes.TComponent.Create$1.call(this,e),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=t.TCheckConstraints.$create("Create$2",[this]),this.FBuffers=rtl.arraySetLength(this.FBuffers,t.TDataRecord,1),this.FActiveRecord=0,this.FEOF=!0,this.FBOF=!0,this.FIsUniDirectional=!1,this.FAutoCalcFields=!0,this.FDataRequestID=0,this.FNestedDataSetClass=this.$class.ClassType(),this},this.Destroy=function(){var e=0;this.SetActive(!1),this.SetDataSetField(null),rtl.free(this,"FFieldDefs"),rtl.free(this,"FFieldList"),rtl.free(this,"FNestedDataSets");for(var i=this.FDataSources;i.FCount>0;)rtl.getObject(i.Get(i.FCount-1)).SetDataSet(null);i.$destroy("Destroy");for(var s=0,n=this.FBufferCount;s<=n;s++)e=s,this.FreeRecordBuffer(this.FBuffers[e]);rtl.free(this,"FConstraints"),this.FBuffers=rtl.arraySetLength(this.FBuffers,t.TDataRecord,1),pas.Classes.TComponent.Destroy.call(this)},this.ActiveBuffer=function(){var e=t.TDataRecord.$new();return-1!==this.FActiveRecord?e.$assign(this.FBuffers[this.FActiveRecord]):e.$assign(t.TDataRecord.$new()),e},this.Close=function(){this.SetActive(!1)},this.ControlsDisabled=function(){return this.FDisableControlsCount>0},this.CursorPosChanged=function(){this.FCurrentRecord=-1},this.FieldByName=function(e){var i;return null===(i=this.FindField(e))&&t.DatabaseErrorFmt$1(rtl.getResStr(pas.DBConst,"SFieldNotFound"),pas.System.VarRecs(18,e),this),i},this.FindField=function(t){return this.FFieldList.FindField(t)},this.GetFieldList=function(e,i){var s=null,n="",r=0;if(""!==i&&null!==e){r=1;do{n=t.ExtractFieldName(i,{get:function(){return r},set:function(t){r=t}}),s=this.FieldByName(n),e.Add(s)}while(!(r>i.length))}},this.IsEmpty=function(){return this.FBOF&&this.FEOF&&!(3===this.FState)},this.Lookup=function(t,e,i){return this.CheckBiDirectional(),null,null},this.Open=function(){this.SetActive(!0)},this.UpdateCursorPos=function(){this.FRecordCount>0&&this.SetCurrentRecord(this.FActiveRecord)}})),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=!1,this.FDataSourceFixed=!1,this.FEditing=!1,this.FReadOnly=!1,this.FUpdatingRecord=!1,this.FVisualControl=!1,this.FDataSource=null},this.$final=function(){this.FDataSource=void 0,pas.Classes.TPersistent.$final.call(this)},this.CalcFirstRecord=function(t){var e=0;return e=this.FDataSource.FDataSet.FActiveRecord>this.FFirstRecord+t+this.FBufferCount-1?this.FDataSource.FDataSet.FActiveRecord-(this.FFirstRecord+t+this.FBufferCount-1):this.FDataSource.FDataSet.FActiveRecord<this.FFirstRecord+t?this.FDataSource.FDataSet.FActiveRecord-(this.FFirstRecord+t):0,this.FFirstRecord+=t+e,e},this.CalcRange=function(){var t=0,e=0;(e=this.GetDataset().FActiveRecord-this.FBufferCount+1)<0&&(e=0),(t=this.GetDataset().FBufferCount-this.FBufferCount)<0&&(t=0),t>this.GetDataset().FActiveRecord&&(t=this.GetDataset().FActiveRecord),this.FFirstRecord<e&&(this.FFirstRecord=e),this.FFirstRecord>t&&(this.FFirstRecord=t),0!==this.FFirstRecord&&this.GetDataset().FActiveRecord-this.FFirstRecord<this.FBufferCount-1&&(this.FFirstRecord-=1)},this.CheckActiveAndEditing=function(){var e=!1;(e=null!=this.FDataSource&&!(this.FDataSource.FState in rtl.createSet(0,12)))!==this.FActive&&(this.FActive=e,this.ActiveChanged()),(e=null!=this.FDataSource&&this.FDataSource.FState in t.dsEditModes&&!this.FReadOnly)!==this.FEditing&&(this.FEditing=e,this.EditingChanged())},this.GetDataset=function(){return null!=this.FDataSource?this.FDataSource.FDataSet:null},this.SetActive=function(t){this.FActive!==t&&(this.FActive=t,this.ActiveChanged())},this.SetDataSource=function(t){this.FDataSource!==t&&(this.FDataSourceFixed||(null!=this.FDataSource&&(this.FDataSource.UnregisterDataLink(this),this.FDataSource=null,this.CheckActiveAndEditing()),this.FDataSource=t,null!=this.FDataSource&&(this.FDataSource.RegisterDataLink(this),this.CheckActiveAndEditing())))},this.ActiveChanged=function(){this.FFirstRecord=0},this.CheckBrowseMode=function(){},this.DataEvent=function(t,e){if(6===t)this.CheckActiveAndEditing();else if(this.FActive){var i=t;0===i||1===i?this.FUpdatingRecord||this.RecordChanged(rtl.getObject(e)):2===i?(this.SetActive(this.FDataSource.FDataSet.GetActive()),this.CalcRange(),this.CalcFirstRecord(rtl.trunc(e)),this.DataSetChanged()):3===i?this.DataSetScrolled(this.CalcFirstRecord(rtl.trunc(e))):4===i?(this.CalcFirstRecord(rtl.trunc(e)),this.LayoutChanged()):5===i?this.UpdateRecord():7===i?this.CheckBrowseMode():10===i&&this.FocusControl(e)}},this.DataSetChanged=function(){this.RecordChanged(null)},this.DataSetScrolled=function(t){this.DataSetChanged()},this.EditingChanged=function(){},this.FocusControl=function(t){},this.GetBufferCount=function(){return this.FBufferCount},this.LayoutChanged=function(){this.DataSetChanged()},this.RecordChanged=function(t){},this.UpdateData=function(){},this.Destroy=function(){this.FActive=!1,this.FEditing=!1,this.FDataSourceFixed=!1,this.SetDataSource(null),pas.System.TObject.Destroy.call(this)},this.UpdateRecord=function(){this.FUpdatingRecord=!0;try{this.UpdateData()}finally{this.FUpdatingRecord=!1}}})),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=!1,this.FAutoEdit=!1,this.FState=0,this.FOnStateChange=null,this.FOnDataChange=null,this.FOnUpdateData=null},this.$final=function(){this.FDataSet=void 0,this.FDataLinks=void 0,this.FOnStateChange=void 0,this.FOnDataChange=void 0,this.FOnUpdateData=void 0,pas.Classes.TComponent.$final.call(this)},this.DistributeEvent=function(t,e){for(var i=0,s=this.FDataLinks,n=0,r=s.GetCount()-1;n<=r;n++){i=n;var o=rtl.getObject(s.Get(i));o.FVisualControl||o.DataEvent(t,e)}for(var l=0,a=s.GetCount()-1;l<=a;l++){i=l;var h=rtl.getObject(s.Get(i));h.FVisualControl&&h.DataEvent(t,e)}},this.RegisterDataLink=function(t){this.FDataLinks.Add(t),null!=this.FDataSet&&this.FDataSet.RecalcBufListSize()};var e=rtl.createSet(1,2,3,4,6);this.ProcessEvent=function(t,i){var s=!1,n=0;if(6===t){if(s=0===this.FState,n=this.FState,null!=this.FDataSet&&this.FEnabled?this.FState=this.FDataSet.FState:this.FState=0,this.FState===n)return}else s=!0;this.DistributeEvent(t,i),3 in this.FComponentState||(6===t&&this.DoStateChange(),t in e&&s&&this.DoDataChange(null),0===t&&this.DoDataChange(i),5===t&&this.DoUpdateData())},this.SetDataSet=function(t){null!==this.FDataSet&&(this.FDataSet.UnRegisterDataSource(this),this.FDataSet=null,this.ProcessEvent(6,0)),null!==t&&(t.RegisterDataSource(this),this.FDataSet=t,this.ProcessEvent(6,0))},this.SetEnabled=function(t){this.FEnabled=t,this.ProcessEvent(6,0)},this.UnregisterDataLink=function(t){this.FDataLinks.Remove(t),null!==this.FDataSet&&this.FDataSet.RecalcBufListSize()},this.DoDataChange=function(t){null!=this.FOnDataChange&&(null!=t?this.FOnDataChange(this,t):this.FOnDataChange(this,null))},this.DoStateChange=function(){null!=this.FOnStateChange&&this.FOnStateChange(this)},this.DoUpdateData=function(){null!=this.FOnUpdateData&&this.FOnUpdateData(this)},this.Create$1=function(t){return pas.Classes.TComponent.Create$1.call(this,t),this.FDataLinks=pas.Classes.TList.$create("Create$1"),this.FEnabled=!0,this.FAutoEdit=!0,this},this.Destroy=function(){this.FOnStateChange=null,this.SetDataSet(null);for(var t=this.FDataLinks;t.GetCount()>0;)rtl.getObject(t.Get(t.GetCount()-1)).SetDataSource(null);rtl.free(this,"FDataLinks"),pas.Classes.TComponent.Destroy.call(this)};var i=this.$rtti;i.addProperty("AutoEdit",0,rtl.boolean,"FAutoEdit","FAutoEdit",{Default:!0}),i.addProperty("DataSet",2,t.$rtti.TDataSet,"FDataSet","SetDataSet"),i.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),i.addProperty("OnStateChange",0,pas.Classes.$rtti.TNotifyEvent,"FOnStateChange","FOnStateChange"),i.addProperty("OnDataChange",0,t.$rtti.TDataChangeEvent,"FOnDataChange","FOnDataChange"),i.addProperty("OnUpdateData",0,pas.Classes.$rtti.TNotifyEvent,"FOnUpdateData","FOnUpdateData")})),rtl.createClass(this,"TDataProxy",pas.Classes.TComponent,(function(){})),this.dsEditModes=rtl.createSet(2,3,4),this.DatabaseError=function(e){throw t.EDatabaseError.$create("Create$1",[e])},this.DatabaseError$1=function(e,i){if(null!=i&&""!==i.FName)throw t.EDatabaseError.$create("CreateFmt",["%s : %s",pas.System.VarRecs(18,i.FName,18,e)]);t.DatabaseError(e)},this.DatabaseErrorFmt=function(e,i){throw t.EDatabaseError.$create("CreateFmt",[e,i])},this.DatabaseErrorFmt$1=function(e,i,s){if(null!=s)throw t.EDatabaseError.$create("CreateFmt",[pas.SysUtils.Format("%s : %s",pas.System.VarRecs(18,s.FName,18,e)),i]);t.DatabaseErrorFmt(e,i)},this.ExtractFieldName=function(t,e){var i,s,n=0;for(n=e.get(),s=t.length;n<=s&&";"!==t.charAt(n-1);)n+=1;return i=pas.SysUtils.Trim(pas.System.Copy(t,e.get(),n-e.get())),n<=s&&";"===t.charAt(n-1)&&(n+=1),e.set(n),i},t.$implcode=function(){e.DefaultBufferCount=10,e.SJSValue="JSValue"}}),["DBConst","TypInfo"]),rtl.module("StrUtils",["System","SysUtils","Types"],(function(){"use strict";var t=this,e=t.$impl;this.Soundex=function(t,i){var s="",n="",r="",o=0,l=0;if(s="",r="\0",t.length>0)for(s=pas.System.upcase(t.charAt(0)),o=2,l=t.length;o<=l&&s.length<i;)(n=e.SScore.charAt(t.charCodeAt(o-1)-1)).charCodeAt()in rtl.createSet(48,105,r.charCodeAt())||(s+=n),"i"!==n&&(r=n),o+=1;return(l=s.length)<i&&(s+=pas.System.StringOfChar("0",i-l)),s},this.SoundexSimilar=function(e,i,s){return t.Soundex(e,s)===t.Soundex(i,s)},this.SoundexSimilar$1=function(e,i){return t.SoundexSimilar(e,i,4)},this.SoundexProc=function(e,i){return t.SoundexSimilar$1(e,i)},this.AnsiResemblesProc=null,this.ResemblesProc=null,t.$implcode=function(){e.SScore="00000000000000000000000000000000000000000000000000000000000000000123012i02245501262301i2i20000000123012i02245501262301i2i20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},t.$init=function(){t.AnsiResemblesProc=t.SoundexProc,t.ResemblesProc=t.SoundexProc}}),["JS"]),rtl.module("WEBLib.Mask",["System","Classes","SysUtils","StrUtils","WEBLib.Controls","WEBLib.StdCtrls","Web"],(function(){"use strict";var t=this,e=t.$impl;this.TMaskedState$a={0:"mStateMasked",mStateMasked:0,1:"mStateReEnter",mStateReEnter:1,2:"mStateDBSetText",mStateDBSetText:2},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="",this.FMaxChars=0,this.FMaskState={},this.FCaretPos=0,this.FEditText=""},this.$final=function(){this.FMaskState=void 0,pas["WEBLib.StdCtrls"].TEdit.$final.call(this)},this.GetEditText=function(){return this.RemoveEditFormat(this.GetText())},this.SetEditText=function(t){this.FEditText=this.AddEditFormat(t,!0),this.SetText(this.FEditText)},this.AddEditFormat=function(t,i){return i?e.FormatMaskedText(this.FEditMask,t,this.FMaskBlank):e.FormatMaskedText(this.FEditMask,t," ")},this.RemoveEditFormat=function(t){var i="",s=0,n=0,r=0,o=0,l=0;r=1,i=t;for(var a=1,h=this.FEditMask.length;a<=h;a++)o=a,(l=e.GetMaskCharType(this.FEditMask,o))in rtl.createSet(1,2)&&(i=pas.System.Copy(i,1,r-1)+pas.System.Copy(i,r+1,i.length-r)),l in rtl.createSet(4,5)&&(r+=1);if(0 in rtl.refSet(e.GetMaskInstructions(this.FEditMask,1))){r=1;for(var u=1,d=i.length;u<=d&&(s=u,i.charAt(s-1)===this.FMaskBlank);u++)r+=1;1!==r&&(i=pas.System.Copy(i,r,i.length-r+1))}else for(var c=1,F=n=i.length;c<=F&&(s=c,i.charAt(n-s+1-1)===this.FMaskBlank);c++)i=rtl.strSetLength(i,i.length-1);if(" "!==this.FMaskBlank)for(var p=1,C=n=i.length;p<=C&&(s=p,i.charAt(s-1)===this.FMaskBlank&&(i=rtl.setCharAt(i,s-1," ")),!(s>n));p++);return i},this.ArrowKeys=function(t,e){var i=0,s=0;2 in e||(this.GetSel({get:function(){return i},set:function(t){i=t}},{get:function(){return s},set:function(t){s=t}}),0 in e?39===t?(this.FCaretPos+=1,s===i+1&&(this.SetSel(i,s),this.FCaretPos+=1),this.FCaretPos>this.FMaxChars&&(this.FCaretPos=this.FMaxChars)):(this.FCaretPos-=1,s===i+2&&this.FCaretPos>i&&(this.SetSel(i+1,i+1),this.FCaretPos-=1),this.FCaretPos<0&&(this.FCaretPos=0)):s-i>1?(s===this.FCaretPos&&(this.FCaretPos-=1),this.SetCursor(this.FCaretPos)):37===t?this.CursorDec(i):s===i?this.SetCursor(i):this.CursorInc(i,1))},this.CursorInc=function(t,i){var s=0;t<this.GetText().length&&(s=t+i,s=this.GetNextEditChar(s),e.IsLiteralChar(this.FEditMask,s)&&(s=t),this.SetCursor(s))},this.CursorDec=function(t){var e=0,i=0;return e=0,t>0&&(i=t,i-=1,i=this.GetPriorEditChar(i),this.SetCursor(i),e=i),e},this.DeleteKeys=function(t){var e,i=0,s=0,n="";this.GetSel({get:function(){return i},set:function(t){i=t}},{get:function(){return s},set:function(t){s=t}}),s-i<1||(n=this.GetText(),e=this.GetText(),this.DeleteSelection({get:function(){return n},set:function(t){n=t}},i,s-i),n=pas.System.Copy(n,i+1,s-i),n=pas.System.Copy(e,1,i)+n+pas.System.Copy(e,s+1,e.length),this.SetText(n),this.SetCursor(i),this.Change())},this.DeleteSelection=function(t,i,s){var n,r,o=0,l=0,a=0;if(!0,0===s)return!0;if(n=(o=i+1)+s,(r=e.OffsetToMaskOffset(this.FEditMask,i))<0)return!0;for(var h=r,u=this.FEditMask.length;h<=u&&(l=h,(a=e.GetMaskCharType(this.FEditMask,l))in rtl.createSet(1,2)?o+=1:a in rtl.createSet(4,5)&&(t.set(rtl.setCharAt(t.get(),o-1,this.FMaskBlank)),o+=1),!(o>=n));h++);return!0},this.HomeEndKeys=function(t,e){var i=0,s=0;this.GetSel({get:function(){return i},set:function(t){i=t}},{get:function(){return s},set:function(t){s=t}}),36===t?(0 in e?(i!==this.FCaretPos&&s!==i+1&&(s=i+1),this.SetSel(0,s),this.CheckCursor()):this.SetCursor(0),this.FCaretPos=0):(0 in e?(s!==this.FCaretPos&&s!==i+1&&(i=s-1),this.SetSel(i,this.FMaxChars),this.CheckCursor()):this.SetCursor(this.FMaxChars-1),this.FCaretPos=this.FMaxChars)},this.CharKeys=function(t){var e,i=0,s=0,n="";return!1,this.GetSel({get:function(){return i},set:function(t){i=t}},{get:function(){return s},set:function(t){s=t}}),s-i>1&&(this.DeleteKeys(46),i=this.GetNextEditChar(i),this.SetCursor(i)),(e=this.InputChar(t,i))&&(n=t.get(),this.SetText(pas.System.Copy(this.GetText(),1,i)+n+pas.System.Copy(this.GetText(),s+1,this.GetText().length)),this.CursorInc(i,1)),e},this.InputChar=function(t,i){var s=!1,n=0,r=0,o="";return s=!0,""!==this.FEditMask&&(s=!1,i<this.FMaxChars&&(n=e.OffsetToMaskOffset(this.FEditMask,i))>=0&&(r=e.GetMaskCharType(this.FEditMask,n),o=t.get(),!(s=this.DoInputChar(t,n))&&r in rtl.createSet(4,5)&&(n=this.FindLiteralChar(n,o))>0))?(n=e.MaskOffsetToOffset(this.FEditMask,n),this.SetCursor(n),s):(s||"\r"===t.get()||""===t.get()?this.Change():pas["WEBLib.WebTools"].MessageBeep(0),s)},this.DoInputChar=function(t,i){var s=!1,n={},r="";if(s=!0,e.GetMaskCharType(this.FEditMask,i)in rtl.createSet(1,2))t.set(e.GetFormatSettingsChar(this.FEditMask.charAt(i-1)));else{n=rtl.refSet(e.GetMaskInstructions(this.FEditMask,i));var o=this.FEditMask.charAt(i-1);o===e.cMaskNumeric||o===e.cMaskNumericOpt?t.get()>="0"&&t.get()<="9"||(s=!1):o===e.cMaskNumSymOpt?t.get()>="0"&&t.get()<="9"||" "===t.get()||"+"===t.get()||"-"===t.get()||(s=!1):o===e.cMaskAscii||o===e.cMaskAsciiOpt?e.IsCharAlpha(t.get())&&(r=" ",r=rtl.setCharAt(r,0,t.get()),1 in n?r=pas.SysUtils.UpperCase(r):2 in n&&(r=pas.SysUtils.LowerCase(r)),t.set(r.charAt(0))):o!==e.cMaskAlpha&&o!==e.cMaskAlphaOpt&&o!==e.cMaskAlphaNum&&o!==e.cMaskAlphaNumOpt||(r=" ",r=rtl.setCharAt(r,0,t.get()),e.IsCharAlpha(t.get())?1 in n?r=pas.SysUtils.UpperCase(r):2 in n&&(r=pas.SysUtils.LowerCase(r)):(s=!1,this.FEditMask.charAt(i-1)!==e.cMaskAlphaNum&&this.FEditMask.charAt(i-1)!==e.cMaskAlphaNumOpt||!e.IsCharAlphaNumeric(t.get())||(s=!0)),t.set(r.charAt(0)))}return s},this.FindLiteralChar=function(t,i){var s=0,n=0,r="";for(s=-1;t<this.FEditMask.length;)if(t+=1,(n=e.GetMaskCharType(this.FEditMask,t))in rtl.createSet(1,2))return r=this.FEditMask.charAt(t-1),2===n&&(r=e.GetFormatSettingsChar(r)),r===i&&(s=t),s;return s},this.SetEditMask=function(t){var e=0,i=0;t!==this.FEditMask&&(4 in this.FComponentState&&""!==t&&!(0 in this.FComponentState)&&this.SetEditText(""),this.HandleAllocated()&&this.GetSel({get:function(){return e},set:function(t){e=t}},{get:function(){return i},set:function(t){i=t}}),this.ReformatText(t),this.FMaskState=rtl.excludeSet(this.FMaskState,0),""!==this.FEditMask&&(this.FMaskState=rtl.includeSet(this.FMaskState,0)),this.SetMaxLength(0),this.GetMasked()&&this.FMaxChars>0&&this.SetMaxLength(this.FMaxChars),this.HandleAllocated()&&this.Focused()&&!(4 in this.FComponentState)&&this.SetCursor(e))},this.GetMasked=function(){return""!==this.FEditMask},this.EditCanModify=function(){return!this.FReadOnly},this.ReformatText=function(t){var i;i=this.RemoveEditFormat(this.GetEditText()),this.FEditMask=t,this.FMaxChars=e.MaskOffsetToOffset(this.FEditMask,t.length),this.FMaskBlank=e.GetMaskBlank(t),this.SetEditText(i)},this.KeyDown=function(t,e){if(pas["WEBLib.Controls"].TControl.KeyDown.call(this,t,rtl.refSet(e)),t.get()in rtl.createSet(37,39,36,35)&&(this.PreventDefault(),this.StopPropagation()),this.GetMasked()&&0!==t.get()&&!(1 in e)){if(t.get()in rtl.createSet(37,39,36,35)||this.GetSelLength()>1&&(this.SetSelStart(0),this.SetSelLength(1)),37===t.get()||39===t.get())return this.ArrowKeys(t.get(),rtl.refSet(e)),void(0 in e||2 in e||t.set(0));if(38===t.get()||40===t.get())return void t.set(0);if(36===t.get()||35===t.get())return this.HomeEndKeys(t.get(),rtl.refSet(e)),void t.set(0);if(46===t.get()&&!(0 in e)||8===t.get())return this.EditCanModify()&&this.DeleteKeys(t.get()),t.set(0),this.PreventDefault(),void this.StopPropagation();this.CheckCursor()}},this.KeyUp=function(t,e){pas["WEBLib.Controls"].TControl.KeyUp.call(this,t,rtl.refSet(e)),this.GetMasked()&&0!==t.get()&&(37!==t.get()&&39!==t.get()||!(2 in e)||this.CheckCursor())},this.KeyPress=function(t){pas["WEBLib.StdCtrls"].TCustomEdit.KeyPress.call(this,t),this.GetMasked()&&"\0"!==t.get()&&!pas.SysUtils.CharInSet(t.get(),["","","","\b"])&&(this.CharKeys(t),t.set("\0"),this.PreventDefault(),this.StopPropagation())},this.MouseUp=function(t,e,i,s){pas["WEBLib.Controls"].TControl.MouseUp.apply(this,arguments)},this.CheckCursor=function(){var t=0,e=0;this.HandleAllocated()&&this.GetMasked()&&(this.GetSel({get:function(){return t},set:function(e){t=e}},{get:function(){return e},set:function(t){e=t}}),t===e&&this.SetCursor(t))},this.Loaded=function(){pas["WEBLib.Controls"].TCustomControl.Loaded.call(this)},this.DoEnter=function(){pas["WEBLib.Controls"].TControl.DoEnter.call(this),this.SetSelStart(0),this.SetSelLength(1)},this.CreateInitialize=function(){pas["WEBLib.StdCtrls"].TCustomEdit.CreateInitialize.call(this),this.SetHeight(25)},this.GetSel=function(t,e){t.set(this.GetSelStart()),e.set(this.GetSelStart()+this.GetSelLength())},this.SetSel=function(t,e){this.SetSelStart(t),this.SetSelLength(Math.max(1,e-t))},this.SetCursor=function(t){this.SetSel(t,t+1)},this.GetNextEditChar=function(t){var i=0;for(i=t;i<this.FMaxChars&&e.IsLiteralChar(this.FEditMask,i);)i+=1;return i},this.GetPriorEditChar=function(t){var i=0;for(i=t;i>=0&&e.IsLiteralChar(this.FEditMask,i);)i-=1;return i<0&&(i=this.GetNextEditChar(i)),i}})),rtl.createClass(this,"TMaskEdit",this.TCustomMaskEdit,(function(){var e=this.$rtti;e.addProperty("EditMask",2,t.$rtti.TEditMask,"FEditMask","SetEditMask"),e.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),e.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),e.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),e.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute})})),rtl.createClass(this,"TWebMaskEdit",this.TMaskEdit,(function(){})),t.$implcode=function(){e.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},e.TMaskInstructions$a={0:"miReverseDir",miReverseDir:0,1:"miUpperCase",miUpperCase:1,2:"miLowerCase",miLowerCase:2,3:"miLiteralChar",miLiteralChar:3},e.dMaskReverse="!",e.dMaskUpperCase=">",e.dMaskLowerCase="<",e.dMaskLiteral="\\",e.cMaskAlpha="L",e.cMaskAlphaOpt="l",e.cMaskAlphaNum="A",e.cMaskAlphaNumOpt="a",e.cMaskAscii="C",e.cMaskAsciiOpt="c",e.cMaskNumeric="0",e.cMaskNumericOpt="9",e.cMaskNumSymOpt="#",e.cMaskTimeSeparator=":",e.cMaskDateSeparator="/",e.mskSeparator=";",e.mskBlank="_",e.IsCharAlpha=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},e.IsCharAlphaNumeric=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"},e.GetMaskCharType=function(t,i){var s=0,n="";return s=1,n="\0",i<=t.length&&(n=t.charAt(i-1)),i>t.length?s=0:i>1&&t.charAt(i-1-1)===e.dMaskLiteral&&!(i>2&&t.charAt(i-2-1)===e.dMaskLiteral)?s=1:n===e.mskSeparator&&t.length>=4&&i>t.length-4?s=6:t.length>=4&&i>t.length-4&&t.charAt(i-1-1)===e.mskSeparator&&!(i>2&&t.charAt(i-2-1)===e.dMaskLiteral)?s=7:n.charCodeAt()in rtl.createSet(e.cMaskTimeSeparator.charCodeAt(),e.cMaskDateSeparator.charCodeAt())?s=2:n.charCodeAt()in rtl.createSet(e.dMaskReverse.charCodeAt(),e.dMaskUpperCase.charCodeAt(),e.dMaskLowerCase.charCodeAt(),e.dMaskLiteral.charCodeAt())?s=3:n.charCodeAt()in rtl.createSet(e.cMaskAlphaOpt.charCodeAt(),e.cMaskAlphaNumOpt.charCodeAt(),e.cMaskAsciiOpt.charCodeAt(),e.cMaskNumSymOpt.charCodeAt(),e.cMaskNumericOpt.charCodeAt())?s=5:n.charCodeAt()in rtl.createSet(e.cMaskAlpha.charCodeAt(),e.cMaskAlphaNum.charCodeAt(),e.cMaskAscii.charCodeAt(),e.cMaskNumeric.charCodeAt())&&(s=4),s},e.GetMaskInstructions=function(t,i){var s={},n=0,r="";s={};for(var o=0,l=t.length-1;o<=l;o++)n=o,(r=t.charAt(n+1-1))===e.dMaskReverse?s=rtl.unionSet(s,rtl.createSet(0)):r===e.dMaskLowerCase&&n<i-1?s=rtl.unionSet(rtl.diffSet(s,rtl.createSet(1)),rtl.createSet(2)):r===e.dMaskUpperCase&&n<i-1&&(s=rtl.diffSet(s,rtl.createSet(2)),n>0&&t.charAt(n-1)===e.dMaskLowerCase||(s=rtl.unionSet(s,rtl.createSet(1))));return 1===e.GetMaskCharType(t,i)&&(s=rtl.unionSet(s,rtl.createSet(3))),s},e.GetFormatSettingsChar=function(t){var i="";i=t;var s=t;return s===e.cMaskTimeSeparator?i=pas.SysUtils.FormatSettings.TimeSeparator:s===e.cMaskDateSeparator&&(i=pas.SysUtils.FormatSettings.DateSeparator),i},e.MaskOffsetToString=function(t,i){var s="",n=0;s="";for(var r=1,o=i;r<=o;r++)n=r,e.GetMaskCharType(t,n)in rtl.createSet(3,7,6)||(s+=t.charAt(n-1));return s},e.MaskOffsetToOffset=function(t,i){return e.MaskOffsetToString(t,i).length},e.OffsetToMaskOffset=function(t,i){var s=0,n=0,r=0;if(i>e.MaskOffsetToOffset(t,t.length))return s=-1;s=0,r=i;for(var o=1,l=t.length;o<=l;o++)if(n=o,s+=1,3!==e.GetMaskCharType(t,n)&&(r-=1)<0)return s;return s},e.FormatMaskedText=function(t,i,s){var n="",r=0,o=0,l=0,a=0;if(n=i,0 in rtl.refSet(e.GetMaskInstructions(t,1))){o=n.length;for(var h=0,u=t.length-1;h<=u;h++)r=h,l=t.length-r,(a=e.GetMaskCharType(t,l))in rtl.createSet(1,2)?n=pas.System.Copy(n,1,o)+e.GetFormatSettingsChar(t.charAt(l-1))+pas.System.Copy(n,o+1,n.length-o):a in rtl.createSet(4,5)&&(o<1?n=s+n:o-=1)}else{o=1;for(var d=1,c=t.length;d<=c;d++)l=d,(a=e.GetMaskCharType(t,l))in rtl.createSet(1,2)?(n=pas.System.Copy(n,1,o-1)+e.GetFormatSettingsChar(t.charAt(l-1))+pas.System.Copy(n,o,n.length-o+1),o+=1):a in rtl.createSet(4,5)&&(o>n.length&&(n+=s),o+=1)}return n},e.IsLiteralChar=function(t,i){var s,n=!1;return n=!1,(s=e.OffsetToMaskOffset(t,i))>=0&&(n=e.GetMaskCharType(t,s)in rtl.createSet(1,2)),n},e.GetMaskBlank=function(t){var i="";return i=e.mskBlank,t.length>=4&&6===e.GetMaskCharType(t,t.length-1)&&(6!==e.GetMaskCharType(t,t.length-2)&&6!==e.GetMaskCharType(t,t.length-3)||(i=t.charAt(t.length-1))),i}}}),["Math","WEBLib.WebTools"]),rtl.module("WEBLib.Grids",["System","Classes","JS","WEBLib.Controls","WEBLib.Graphics","Web","DB","WEBLib.Menus","WEBLib.StdCtrls","WEBLib.Mask"],(function(){"use strict";var t=this,e=t.$impl;rtl.recNewT(this,"TGridRect",(function(){this.Left=0,this.Top=0,this.Right=0,this.Bottom=0,this.$eq=function(t){return this.Left===t.Left&&this.Top===t.Top&&this.Right===t.Right&&this.Bottom===t.Bottom},this.$assign=function(t){return this.Left=t.Left,this.Top=t.Top,this.Right=t.Right,this.Bottom=t.Bottom,this}})),rtl.recNewT(this,"TGridCoord",(function(){this.X=0,this.Y=0,this.$eq=function(t){return this.X===t.X&&this.Y===t.Y},this.$assign=function(t){return this.X=t.X,this.Y=t.Y,this}})),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.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},this.$rtti.$Enum("TGridCellEditor",{minvalue:0,maxvalue:14,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("TGridSortClickEvent",{procsig:rtl.newTIProcSig([["Sender",pas.System.$rtti.TObject],["ACol",rtl.longint],["ARow",rtl.longint],["ASortIndicator",this.$rtti.TGridSortIndicator]]),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}),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(t,e){return"",""},this.SetCells=function(t,e,i){},this.SetColCount=function(t){var e=0;this.FColCount!==t&&t>=0&&(e=t-this.FColCount,this.FColCount=t,null!=this.GetElementHandle()&&(this.ColCountChanged(e),this.GridChanged()))},this.SetRowCount=function(t){var e=0;this.FRowCount!==t&&t>=0&&(e=t-this.FRowCount,this.FRowCount=t,null!=this.GetElementHandle()&&(this.RowCountChanged(e),this.GridChanged()))},this.GridChanged=function(){},this.RowCountChanged=function(t){},this.ColCountChanged=function(t){}})),this.TGridDrawingStyle={0:"gdsClassic",gdsClassic:0,1:"gdsThemed",gdsThemed:1,2:"gdsGradient",gdsGradient:2},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,this.FMin=0,this.FStep=0},this.Create$1=function(){return pas.System.TObject.Create.call(this),this.FMin=0,this.FMax=100,this.FStep=1,this},this.Assign=function(e){t.TGridRange.isPrototypeOf(e)&&(this.FMax=rtl.as(e,t.TGridRange).FMax,this.FMin=rtl.as(e,t.TGridRange).FMin,this.FStep=rtl.as(e,t.TGridRange).FStep)};var e=this.$rtti;e.addProperty("Min",0,rtl.double,"FMin","FMin",{Default:0}),e.addProperty("Max",0,rtl.double,"FMax","FMax",{Default:100}),e.addProperty("Step",0,rtl.double,"FStep","FStep",{Default:1})})),rtl.createClass(this,"TCustomStringGrid",this.TCustomGrid,(function(){this.$init=function(){t.TCustomGrid.$init.call(this),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=!1,this.FOnSelectCell=null,this.FOnTopLeftChanged=null,this.FOptions={},this.FSelection=t.TGridRect.$new(),this.FStartCell=t.TGridCoord.$new(),this.FOnHttpRequestError=null,this.FOnHttpRequestSuccess=null,this.FOnGetCellClass=null,this.FOnGetCellData=null,this.FOnGetCellChildren=null,this.FScrollBars=0,this.FSelMouseDown=!1,this.FStyleElements={},this.FEditCol=0,this.FEditRow=0,this.FEditType=0,this.FOnGetEditText=null,this.FOnSetEditText=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.FHandleFixedClickPtr=null,this.FHandleClickPtr=null,this.FDrawingStyle=0,this.FOnCanEditCell=null,this.FFixedTextColor=0,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=!1,this.FOnClickCell=null,this.FElementTableClassName="",this.FGridLineColor=0,this.FSelectionTextColor=0,this.FSelectionColor=0,this.FWordWrap=!1,this.FOnButtonClick=null,this.FSortIndex=0,this.FSortDirection=0,this.FOnSortClick=null,this.FHasMergedCells=!1,this.FObjectRows=null,this.FEditAdvance=!1},this.$final=function(){this.FGrid=void 0,this.FFixedColRow=void 0,this.FFixedRow=void 0,this.FFixedCol=void 0,this.FNormalCells=void 0,this.FColWidths=void 0,this.FRowHeights=void 0,this.FColAlignments=void 0,this.FSelectedCell=void 0,this.FEdit=void 0,this.FOnSelectCell=void 0,this.FOnTopLeftChanged=void 0,this.FOptions=void 0,this.FSelection=void 0,this.FStartCell=void 0,this.FOnHttpRequestError=void 0,this.FOnHttpRequestSuccess=void 0,this.FOnGetCellClass=void 0,this.FOnGetCellData=void 0,this.FOnGetCellChildren=void 0,this.FStyleElements=void 0,this.FOnGetEditText=void 0,this.FOnSetEditText=void 0,this.FOnCheckClick=void 0,this.FOnFixedCellClick=void 0,this.FOnValidateEdit=void 0,this.FOnCanEditCell=void 0,this.FOnColumnSized=void 0,this.FRows=void 0,this.FOnGetCellEditor=void 0,this.FCombo=void 0,this.FMemo=void 0,this.FMask=void 0,this.FComboBoxItems=void 0,this.FRange=void 0,this.FOnClickCell=void 0,this.FOnButtonClick=void 0,this.FOnSortClick=void 0,this.FObjectRows=void 0,t.TCustomGrid.$final.call(this)},this.GetCells=function(t,e){var i=null;return null==(i=this.CellRealElement(t,e))?"":(this.FWordWrap&&null!=i.firstChild&&(i=i.firstChild),i.innerHTML)},this.SetCells=function(t,e,i){var s=0,n="",r=null;e<0||t<0||(n=i,pas.System.Pos("\r",i)>0?(n=pas.SysUtils.StringReplace(n,"\r","<BR>",rtl.createSet(0)),n=pas.SysUtils.StringReplace(n,"\n","<BR>",rtl.createSet(0))):pas.System.Pos("\n",i)>0&&(n=pas.SysUtils.StringReplace(n,"\n","<BR>",rtl.createSet(0))),this.FWordWrap&&(s=this.GetRowHeights(e)-2,n='<DIV class="cell" style="height:'+pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get:function(){return s},set:function(t){s=t}})+"px;max-height:"+pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get:function(){return s},set:function(t){s=t}})+'px">'+n+"</DIV>"),null!=(r=this.CellRealElement(t,e))&&(r.innerHTML=n),0===e&&this.EnableColResize())},this.SetFixedCols=function(t){this.FFixedCols!==t&&(this.FFixedCols=t,this.IsUpdating()||this.ReRenderGrid())},this.SetFixedRows=function(t){this.FFixedRows!==t&&(this.FFixedRows=t,this.IsUpdating()||this.ReRenderGrid())},this.GetColWidths=function(t){return t<this.FColWidths.GetCount()?rtl.trunc(this.FColWidths.Get(t)):this.FDefaultColWidth},this.GetRowHeights=function(t){return t<this.FRowHeights.GetCount()?rtl.trunc(this.FRowHeights.Get(t)):this.FDefaultRowHeight},this.SetColWidths=function(t,e){for(var i,s,n,r,o=0;this.FColWidths.GetCount()<=t;)this.FColWidths.Add(this.FDefaultColWidth);if(this.FColWidths.Put(t,e),!this.IsUpdating()&&null!=this.FGrid){if(r=2===this.FWidthStyle,i=this.NormalColWidth(),n=(s=this.GetWidth()-this.FixedColWidth())-pas["WEBLib.Controls"].GetScrollBarWidth(),t<this.FFixedCols){if(o=this.FixedColWidth(),null!=(l=this.FGrid.rows[0]))null!=(a=l.cells[0])&&(a.style.width=o+"px",null!=a.firstChild&&(a.firstChild.style.width=o+"px"));null!=(l=this.FGrid.rows[1])&&(null!=(a=l.cells[0])&&(a.style.width=o+"px",null!=a.firstChild&&(a.firstChild.style.width=o+"px")),null!=(l=this.FFixedColRow.rows[0])&&null!=(a=l.cells[0])&&(a.style.width=o+"px")),null!=(l=this.FFixedCol.rows[0])&&null!=(a=l.cells[0])&&(a.style.width=o+"px")}var l,a;if(t>=this.FFixedCols)if(t-=this.FFixedCols,null!=(l=this.FFixedRow.rows[0]))if((a=l.cells[t]).style.width=e+"px",a.style.maxwidth=e+"px",this.FNormalCells.rows.length>0)(a=this.FNormalCells.rows[0].cells[t]).style.width=e+"px",a.style.maxwidth=e+"px";if(null!=(l=this.FGrid.rows[0]))null==(a=l.cells[1]).firstChild||r||(a.firstChild.style.width=n+"px",a.firstChild.firstChild.style.width=i+"px");null!=(l=this.FGrid.rows[1])&&(null==(a=l.cells[1]).firstChild||r||(a.firstChild.style.width=s+"px",a.firstChild.firstChild.style.width=i+"px")),this.UpdateGridSize()}},this.SetRowHeights=function(t,e){for(var i,s,n,r=0,o=0;this.FRowHeights.GetCount()<=t;)this.FRowHeights.Add(this.FDefaultRowHeight);if(this.FRowHeights.Put(t,e),!this.IsUpdating()&&null!=this.FGrid){if(this.FixedRowHeight(),i=this.NormalRowHeight(),n=(s=this.GetHeight()-this.FixedRowHeight())-pas["WEBLib.Controls"].GetScrollBarHeight(),t<this.FFixedRows){if(r=this.FixedRowHeight(),null!=(a=this.FGrid.rows[0]))if(a.style.height=r+"px",null!=(h=a.cells[0])){var l=h.firstChild;null!=l&&(l.style.height=r+"px"),null!=(l=(h=a.cells[1]).firstChild)&&(l.style.height=r+"px")}null!=(a=this.FFixedColRow.rows[0])&&null!=(a=a.cells[0])&&(a.style.height=e+"px",null!=(a=this.FFixedRow.rows[t].cells[0])&&(a.style.height=e+"px"))}var a,h;if(t>=this.FFixedRows)if(t-=this.FFixedRows,o=e,this.HasHorzScrollBar()&&this.HasVertScrollBar()&&t===this.FRowCount-1&&(o=e+this.FNormalCells.parentElement.scrollHeight),null!=(a=this.FFixedCol.rows[t]))a.style.height=e+"px",null!=(a=this.FNormalCells.rows[t])&&(a.style.height=o+"px");(h=this.FGrid.rows[1].cells[0]).firstChild&&(h.firstChild.style.height=n+"px",h.firstChild.firstChild.style.height=i+"px"),(h=this.FGrid.rows[1].cells[1]).firstChild&&(h.firstChild.style.height=s+"px",h.firstChild.firstChild.style.height=i+"px")}},this.SetDefaultColWidth=function(t){var e=0;this.FDefaultColWidth=t;for(var i=0,s=this.FColCount-1;i<=s;i++)e=i,this.SetColWidths(e,t)},this.SetDefaultRowHeight=function(t){var e=0;this.FDefaultRowHeight=t;for(var i=0,s=this.FRowCount-1;i<=s;i++)e=i,this.SetRowHeights(e,t)},this.GetCol=function(){var t=0;return t=-1,null!=this.FSelectedCell&&(t=this.FSelectedCell.cellIndex,t+=this.FFixedCols),t},this.GetRow=function(){var t=0;return t=-1,null!=this.FSelectedCell&&(t=this.FSelectedCell.parentElement.rowIndex,t+=this.FFixedRows),t},this.SetCol=function(t){var e=0,i=0,s=null;if(t<this.FColCount&&t>=this.FFixedCols){null!=this.FSelectedCell&&this.RemoveSelection(this.FSelectedCell),i=t-this.FFixedCols,(e=this.GetRow()-this.FFixedRows)<0&&(e=0),s=this.FNormalCells.rows[e].cells[i],this.AddSelection(s),this.FSelectedCell=s;var n=this.FNormalCells.parentElement.parentElement;s.offsetLeft<n.scrollLeft&&(n.scrollLeft=s.offsetLeft),s.offsetLeft+s.offsetWidth-n.scrollLeft>n.offsetWidth&&(n.scrollLeft=n.scrollLeft+s.offsetWidth)}},this.SetRow=function(t){var e=0,i=0,s=0,n=!1,r=null,o=null;if(t<this.FRowCount&&t>=this.FFixedRows){n=12 in this.FOptions,null!=this.FSelectedCell&&n&&(r=this.FSelectedCell.parentElement,this.RemoveSelection(r)),null!=this.FSelectedCell&&this.RemoveSelection(this.FSelectedCell),(i=this.GetCol()-this.FFixedCols)<0&&(i=0),e=t-this.FFixedRows,s=pas["WEBLib.Controls"].GetScrollBarHeight(),o=(r=this.FNormalCells.rows[e]).cells[i],n?(pas.JS.isUndefined(this.FSelectedCell)||this.RemoveSelection(this.FSelectedCell),this.AddSelection(r),this.FSelectedCell=o):(this.FSelectedCell=o,this.AddSelection(this.FSelectedCell));var l=this.FNormalCells.parentElement.parentElement;for(o.offsetTop<l.scrollTop&&(l.scrollTop=o.offsetTop);o.offsetTop+o.offsetHeight-l.scrollTop>l.offsetHeight-s;)l.scrollTop=l.scrollTop+o.offsetHeight}},this.GetCellElements=function(t,e){return this.CellRealElement(t,e)},this.GetCheckElement=function(t,e){var i=null,s=null;return i=null,t<this.FColCount&&e<this.FRowCount&&null!=(s=this.GetCellElements(t,e).firstChild)&&rtl.isExt(s,Element)&&s.hasAttribute("type")&&"CHECKBOX"===pas.SysUtils.UpperCase(s.getAttribute("type"))&&(i=s),i},this.GetButtonElement=function(t,e){var i=null,s=null;return i=null,t<this.FColCount&&e<this.FRowCount&&null!=(s=this.GetCellElements(t,e).firstChild)&&rtl.isExt(s,Element)&&"BUTTON"===pas.SysUtils.UpperCase(s.tagName)&&(i=s),i},this.GetSelection=function(){var e=t.TGridRect.$new();return e.$assign(this.FSelection),e},this.SetSelection=function(t){var e=0,i=0,s=0,n=0,r=0,o=0,l=0,a=0,h=null,u=null;this.FSelection.$assign(t),r=t.Left,o=t.Right,t.Left>t.Right&&(r=t.Right,o=t.Left),l=t.Top,a=t.Bottom,t.Top>t.Bottom&&(l=t.Bottom,a=t.Top);for(var d=this.FFixedRows,c=this.FRowCount-1;d<=c;d++)if(i=d,12 in this.FOptions)n=i-this.FFixedRows,i>=l&&i<=a?(h=this.FNormalCells.rows[n],this.AddSelection(h)):(h=this.FNormalCells.rows[n],this.RemoveSelection(h));else for(var F=this.FFixedCols,p=this.FColCount-1;F<=p;F++)s=(e=F)-this.FFixedCols,n=i-this.FFixedRows,e>=r&&e<=o&&i>=l&&i<=a?null!=(u=this.FNormalCells.rows[n].cells[s])&&this.AddSelection(u):null!=(u=this.FNormalCells.rows[n].cells[s])&&this.RemoveSelection(u)},this.GetLeftCol=function(){var t=0,e=0,i=0,s=0;if(t=this.FFixedCols,null!=this.FNormalCells){s=this.FNormalCells.parentElement.parentElement.scrollLeft,i=0;for(var n=this.FFixedCols,r=this.FColCount-1;n<=r;n++){if(e=n,s<=i){t=e;break}i=i+this.GetColWidths(e)+1-0}}return t},this.GetTopRow=function(){var t=0,e=0;return t=this.FFixedRows,null!=this.FNormalCells&&e>=0&&(e=this.FNormalCells.parentElement.parentElement.scrollTop,t=this.FFixedRows+rtl.trunc(e/this.FDefaultRowHeight)),t},this.SetLeftCol=function(t){var e=0,i=0;i=0;for(var s=this.FFixedCols,n=t-1;s<=n;s++)e=s,i=i+this.GetColWidths(e)+1-0;null!=this.FNormalCells&&(this.FNormalCells.parentElement.parentElement.scrollLeft=i,this.FFixedCols>0&&(this.FFixedCol.parentElement.parentElement.scrollLeft=i))},this.SetTopRow=function(t){var e;e=(t-this.FFixedRows)*this.FDefaultRowHeight,null!=this.FNormalCells&&e>=0&&(this.FNormalCells.parentElement.parentElement.scrollTop=e,this.FFixedCols>0&&(this.FFixedCol.parentElement.parentElement.scrollTop=e))},this.SetFixedColor=function(t){this.FFixedColor!==t&&(this.FFixedColor=t,this.UpdateElementVisual())},this.SetFixedTextColor=function(t){this.FFixedTextColor!==t&&(this.FFixedTextColor=t,this.UpdateElementVisual())},this.GetVisibleColCount=function(){var t,e=0;for(e=this.GetLeftCol(),t=this.GetElementHandle().getBoundingClientRect();e<this.FColCount&&!(this.GetCellElements(e,this.FFixedRows).getBoundingClientRect().right>t.right);)e+=1;return e-this.GetLeftCol()},this.GetVisibleRowCount=function(){var t,e=0;for(e=this.GetTopRow(),t=this.GetElementHandle().getBoundingClientRect();e<this.FRowCount&&!(this.GetCellElements(this.FFixedCols,e).getBoundingClientRect().bottom>t.bottom);)e+=1;return e-this.GetTopRow()},this.SetRows=function(t,e){var i=0;if(!(t>=0&&t<this.FRowCount))throw pas.SysUtils.Exception.$create("Create$1",["Invalid row index"]);for(var s=0,n=this.FColCount-1;s<=n;s++)(i=s)<e.GetCount()&&this.SetCells(i,t,e.Get(i))},this.RowsChanged=function(t){this.SetRows(this.FRowsIndex,this.FRows)},this.SetRange=function(t){this.FRange.Assign(t)},this.SetElementTableClassName=function(t){this.FElementTableClassName!==t&&(this.FElementTableClassName=t,this.IsUpdating()||this.ReRenderGrid())},this.SetGridLineColor=function(t){this.FGridLineColor!==t&&(this.FGridLineColor=t,this.UpdateElement())},this.SetSelectionColor=function(t){this.FSelectionColor!==t&&(this.FSelectionColor=t,this.UpdateElement())},this.SetSelectionTextColor=function(t){this.FSelectionTextColor!==t&&(this.FSelectionTextColor=t,this.UpdateElement())},this.GetColAlignments=function(t){return t<this.FColAlignments.GetCount()?this.FColAlignments.Get(t):this.FDefaultColAlignment},this.SetColAlignments=function(t,e){for(;this.FColAlignments.GetCount()<=t;)this.FColAlignments.Add(0);this.FColAlignments.Put(t,e),this.UpdateGridAlignment()},this.SetAlignAttr=function(t,e){var i=t;0===i?e.removeAttribute("align"):2===i?e.setAttribute("align","center"):1===i&&e.setAttribute("align","right")},this.SetDefaultColAlignment=function(t){this.FDefaultColAlignment!==t&&(this.FDefaultColAlignment=t,this.ReRenderGrid())},this.UnbindEvents=function(){pas["WEBLib.Controls"].TControl.UnbindEvents.call(this),null!=this.FNormalCells&&(this.FNormalCells.removeEventListener("mousedown",this.FHandleMouseDownPtr),this.FNormalCells.removeEventListener("mouseup",this.FHandleMouseUpPtr),this.FNormalCells.removeEventListener("mousemove",this.FHandleMouseMovePtr),this.FNormalCells.removeEventListener("click",this.FHandleClickPtr)),null!=this.FFixedCol&&this.FFixedCol.removeEventListener("click",this.FHandleFixedClickPtr),null!=this.FFixedRow&&this.FFixedRow.removeEventListener("click",this.FHandleFixedClickPtr),null!=this.FFixedColRow&&this.FFixedColRow.removeEventListener("click",this.FHandleFixedClickPtr)},this.StylePrefix=function(){var t,e="";return e="",null!=(t=pas["WEBLib.Forms"].GetParentForm(this))&&(e=t.$classname),e},this.CellRealElement=function(t,e){var i=null,s=null,n=0,r=0;if(t<this.FFixedCols&&e<this.FFixedRows?(s=this.FFixedColRow,n=t,r=e):t<this.FFixedCols&&e>=this.FFixedRows?(s=this.FFixedCol,n=t,r=e-this.FFixedRows):t>=this.FFixedCols&&e<this.FFixedRows?(s=this.FFixedRow,n=t-this.FFixedCols,r=e):(s=this.FNormalCells,n=t-this.FFixedCols,r=e-this.FFixedRows),i=null,this.FHasMergedCells){i=function(t,e,i){var s,n,r,o,l,a,h,u=[];for(h=0;h<t.rows.length;h++)for(s=t.rows[h],a=0;a<s.cells.length;a++){for(n=s.cells[a],r=a;u[h]&&u[h][r];++r);for(o=r;o<r+n.colSpan;++o)for(l=h;l<h+n.rowSpan;++l)u[l]||(u[l]=[]),u[l][o]=!0;if(r<=e&&e<r+n.colSpan&&h<=i&&i<h+n.rowSpan)return n}return null}(s,n,r)}else i=s.rows[r].cells[n];return i},this.CellRealCoords=function(t,e,i){var s=[],n=0,r=0;e.set(-1),i.set(-1),s=rtl.arraySetLength(s,null,this.FColCount,this.FRowCount);for(var o=0,l=this.FColCount-1;o<=l;o++){n=o;for(var a=0,h=this.FRowCount-1;a<=h;a++)r=a,s[n][r]=this.CellRealElement(n,r)}for(var u=0,d=this.FColCount-1;u<=d;u++){n=u;for(var c=0,F=this.FRowCount-1;c<=F;c++)if(r=c,s[n][r]===t){e.set(n-this.FFixedCols),i.set(r-this.FFixedRows);break}}},this.MouseMove=function(e,i,s){pas["WEBLib.Controls"].TControl.MouseMove.apply(this,arguments),-1!==this.FStartCell.X&&-1!==this.FStartCell.Y&&(s>this.GetHeight()-10&&(this.SetTopRow(this.GetTopRow()+1),this.SetSelection(t.GridRect(this.GetSelection().Left,Math.min(this.GetSelection().Top,this.GetSelection().Bottom),this.GetSelection().Right,Math.max(this.GetSelection().Top,this.GetSelection().Bottom)+1))),this.FFixedRows>0&&s<this.GetRowHeights(0)&&this.GetTopRow()>this.FFixedRows&&(this.SetTopRow(this.GetTopRow()-1),this.SetSelection(t.GridRect(this.GetSelection().Left,Math.min(this.GetSelection().Top,this.GetSelection().Bottom)-1,this.GetSelection().Right,Math.max(this.GetSelection().Top,this.GetSelection().Bottom)))),i>this.GetWidth()-10&&(this.SetLeftCol(this.GetLeftCol()+1),this.SetSelection(t.GridRect(Math.min(this.GetSelection().Left,this.GetSelection().Right),this.GetSelection().Top,Math.max(this.GetSelection().Left,this.GetSelection().Right)+1,this.GetSelection().Bottom))),this.FFixedCols>0&&i<this.GetColWidths(0)&&this.GetLeftCol()>this.FFixedCols&&(this.SetLeftCol(this.GetLeftCol()-1),this.SetSelection(t.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(t){var e,i,s=0,n=0,r=null,o=null,l="";if(!0,!this.FEnabled)return!0;if(e=12 in this.FOptions,s=-1,n=-1,"tr"===(i=(o=t.target).tagName.toLowerCase())||"tbody"===i)return!0;do{"td"!=(l=o.tagName.toLowerCase())&&(o=o.parentElement)}while("td"!==l&&null!==o);if("td"==l){n=o.cellIndex;r=o.parentElement;s=r.rowIndex}if("td"===l&&this.FHasMergedCells&&this.CellRealCoords(o,{get:function(){return n},set:function(t){n=t}},{get:function(){return s},set:function(t){s=t}}),-1===n||-1===s)return!0;if(!this.CanSelect(n+this.FFixedCols,s+this.FFixedRows))return!0;if(this.SelectCell(n+this.FFixedCols,s+this.FFixedRows),null!=this.FOnClickCell&&this.FEnabled&&this.FOnClickCell(this,n+this.FFixedCols,s+this.FFixedRows),null!=this.FSelectedCell)if(this.FSelMouseDown){if(10 in this.FOptions&&this.CanEditCell(this.GetCol(),this.GetRow()))return this.ShowEdit(),!0}else e?(r=this.FSelectedCell.parentElement,this.RemoveSelection(r)):this.RemoveSelection(this.FSelectedCell);return"td"===l&&(r=o.parentElement,this.FSelectedCell=o,e?this.AddSelection(r):this.AddSelection(o)),!0},this.HandleFixedClick=function(t){var e=0,i=0,s=null,n=0,r=0,o=null,l="",a=0;this.FOptions,e=-1,i=-1,a=0,"SPAN"===(o=t.target).tagName&&("up"===o.getAttribute("sort")?a=1:"dn"===o.getAttribute("sort")&&(a=2));do{"td"!=(l=o.tagName.toLowerCase())&&(o=o.parentElement)}while("td"!==l&&null!==o);if("td"==l){i=o.cellIndex;var h=o.parentElement;e=h.rowIndex,s=(s=h.parentElement).parentElement}return-1===i||-1===e||(n=i,r=e,s===this.FFixedCol&&(r=e+this.FFixedRows),s===this.FFixedRow&&(n=i+this.FFixedCols),1===a?(this.DoSortClick(n,r,2),this.SetSortIndicator(n,r,2)):2===a&&(this.DoSortClick(n,r,1),this.SetSortIndicator(n,r,1)),null!=this.FOnFixedCellClick&&this.FOnFixedCellClick(this,n,r)),!0},this.HandleMouseDown=function(e){var i,s,n=0,r=0,o=0,l=0,a=null;if(!0,!this.FEnabled)return!0;if(0!==(s=this.GetMouseEventButton(e)))return!0;(n=-1,r=-1,a=e.target,this.FWordWrap&&"div"===pas.SysUtils.LowerCase(a.tagName)&&(a=a.parentElement),"td"==a.tagName.toLowerCase())&&(r=a.cellIndex,n=a.parentElement.rowIndex);return this.FSelMouseDown=a===this.FSelectedCell,null==this.FSelectedCell||this.FSelMouseDown||-1===r||-1===n||this.HideEdit(!1),!this.CanSelect(r+this.FFixedCols,n+this.FFixedRows)||(r>=0&&n>=0&&(12 in this.FOptions?this.SetSelection(t.GridRect(this.FFixedCols,n+this.FFixedRows,this.FColCount-1,n+this.FFixedRows)):this.SetSelection(t.GridRect(r+this.FFixedCols,n+this.FFixedRows,r+this.FFixedCols,n+this.FFixedRows)),4 in this.FOptions?(this.FStartCell.X=r+this.FFixedCols,this.FStartCell.Y=n+this.FFixedRows):(this.FStartCell.X=-1,this.FStartCell.Y=-1)),this.XYToClient(e.clientX,e.clientY,{get:function(){return o},set:function(t){o=t}},{get:function(){return l},set:function(t){l=t}}),i=rtl.refSet(this.GetMouseEventShiftState(e)),this.MouseDown(s,rtl.refSet(i),pas.System.Trunc(o),pas.System.Trunc(l)),!0)},this.HandleMouseMove=function(e){var i,s=0,n=0,r=0,o=0;(s=-1,n=-1,"td"==e.target.tagName.toLowerCase())&&(n=e.target.cellIndex,s=e.target.parentElement.rowIndex);return n>=0&&s>=0&&this.FStartCell.X>=0&&this.FStartCell.Y>=0&&this.SetSelection(t.GridRect(this.FStartCell.X,this.FStartCell.Y,n+this.FFixedCols,s+this.FFixedRows)),!0,this.XYToClient(e.clientX,e.clientY,{get:function(){return r},set:function(t){r=t}},{get:function(){return o},set:function(t){o=t}}),i=rtl.refSet(this.GetMouseEventShiftState(e)),this.MouseMove(rtl.refSet(i),pas.System.Trunc(r),pas.System.Trunc(o)),!0},this.HandleMouseUp=function(t){var e,i,s=0,n=0;return TMSStringGridresetResize(),this.FStartCell.X=-1,this.FStartCell.Y=-1,!1,t.stopPropagation(),t.cancelBubble=!0,this.XYToClient(t.clientX,t.clientY,{get:function(){return s},set:function(t){s=t}},{get:function(){return n},set:function(t){n=t}}),e=rtl.refSet(this.GetMouseEventShiftState(t)),i=this.GetMouseEventButton(t),this.MouseUp(i,rtl.refSet(e),pas.System.Trunc(s),pas.System.Trunc(n)),!1},this.HandleKeyDown=function(e){var i,s=0,n=0,r=0,o={},l=!1;return!0,!this.FEnabled||(e.cancelBubble=!0,e.stopPropagation(),s=0,l=!1,i=null==e.key,"UNIDENTIFIED"===pas.SysUtils.UpperCase(e.key)||(i||(s=this.GetKeyCode(e.key,!0),l=1===e.key.length,o=rtl.refSet(this.GetKeyBoardEventShiftState(e)),null!=this.FOnKeyDown&&this.FOnKeyDown(this,{get:function(){return s},set:function(t){s=t}},rtl.refSet(o))),r=this.GetRow(),n=this.GetCol(),-1===r&&-1===n&&this.FColCount>this.FFixedCols&&this.FRowCount>this.FFixedRows&&(n=this.FFixedCols,r=this.FFixedRows,this.SetCol(this.FFixedCols),this.SetRow(this.FFixedRows),this.FNormalCells.focus()),s in rtl.createSet(38,40,33,34)&&(e.preventDefault(),this.HideEdit(!1),this.ChangeRow()),!this.FEditMode&&s in rtl.createSet(35,36,37,39)&&(e.preventDefault(),this.HideEdit(!1)),27===s&&this.CancelEdit(),this.FEditMode||!e.shiftKey||s>=48&&s<=122||!(4 in this.FOptions)?(35===s&&(r=this.FRowCount-1),36===s&&(r=this.FFixedRows),34===s&&(r=this.GetRow()+4<=this.FRowCount-1?this.GetRow()+4:this.FRowCount-1),33===s&&(r=this.GetRow()-4>this.FFixedRows?this.GetRow()-4:this.FFixedRows),!this.FEditMode&&38===s&&this.GetRow()>this.FFixedRows&&(r=this.GetRow()-1),!this.FEditMode&&40===s&&this.GetRow()<this.FRowCount-1&&(r=this.GetRow()+1),!this.FEditMode&&37===s&&this.GetCol()>this.FFixedCols&&(n=this.GetCol()-1),!this.FEditMode&&39===s&&this.GetCol()<this.FColCount-1&&(n=this.GetCol()+1),!this.FEditMode&&this.CanSelect(n,r)&&(this.SelectCell(n,r),38===s&&this.GetRow()<this.GetTopRow()&&this.SetTopRow(this.GetTopRow()-1),33===s&&this.GetRow()<this.GetTopRow()&&this.SetTopRow(this.GetRow()),34===s&&this.GetRow()>=this.GetTopRow()+this.GetVisibleRowCount()&&this.SetTopRow(this.GetRow()),40===s&&this.GetRow()>=this.GetTopRow()+this.GetVisibleRowCount()&&this.SetTopRow(this.GetTopRow()+1),37===s&&this.GetCol()<this.GetLeftCol()&&this.SetLeftCol(this.GetLeftCol()-1),39===s&&this.GetCol()>=this.GetLeftCol()+this.GetVisibleColCount()&&this.SetLeftCol(this.GetLeftCol()+1),35===s&&this.SetTopRow(this.GetRow()-this.GetVisibleRowCount()),36===s&&this.SetTopRow(this.FFixedRows)),113===s&&!this.FEditMode&&10 in this.FOptions&&this.CanEditCell(this.GetCol(),this.GetRow())&&this.ShowEdit(),s>=32&&s<=112&&l&&!this.FEditMode&&10 in this.FOptions&&this.CanEditCell(this.GetCol(),this.GetRow())&&this.StartEdit(e.key),13===s&&10 in this.FOptions&&this.CanEditCell(this.GetCol(),this.GetRow())&&(this.FEditMode?this.HideEdit(this.FEditAdvance):this.ShowEdit())):(35===s&&(this.SetRow(this.FRowCount-1),this.SetSelection(t.GridRect(this.GetCol(),r,this.GetCol(),this.GetRow())),this.GetRow()>=this.GetTopRow()+this.GetVisibleRowCount()&&this.SetTopRow(this.GetRow()-this.GetVisibleRowCount())),36===s&&(this.SetRow(this.FFixedRows),this.SetSelection(t.GridRect(this.GetCol(),r,this.GetCol(),this.GetRow())),this.GetRow()<this.GetTopRow()&&this.SetTopRow(this.FFixedRows)),38===s&&this.GetRow()>this.FFixedRows&&(r=this.GetRow()===Math.min(this.GetSelection().Top,this.GetSelection().Bottom)?Math.max(this.GetSelection().Top,this.GetSelection().Bottom):Math.min(this.GetSelection().Top,this.GetSelection().Bottom),this.SetRow(this.GetRow()-1),this.SetSelection(t.GridRect(this.GetSelection().Left,r,this.GetSelection().Right,this.GetRow())),this.GetRow()<this.GetTopRow()&&this.SetTopRow(this.GetTopRow()-1)),40===s&&this.GetRow()<this.FRowCount-1&&(r=this.GetRow()===Math.max(this.GetSelection().Top,this.GetSelection().Bottom)?Math.min(this.GetSelection().Top,this.GetSelection().Bottom):Math.max(this.GetSelection().Top,this.GetSelection().Bottom),this.SetRow(this.GetRow()+1),this.SetSelection(t.GridRect(this.GetSelection().Left,r,this.GetSelection().Right,this.GetRow())),this.GetRow()>this.GetTopRow()+this.GetVisibleRowCount()&&this.SetTopRow(this.GetTopRow()+1)),37===s&&this.GetCol()>this.FFixedCols&&(n=this.GetCol()===Math.min(this.GetSelection().Left,this.GetSelection().Right)?Math.max(this.GetSelection().Left,this.GetSelection().Right):Math.min(this.GetSelection().Left,this.GetSelection().Right),this.SetCol(this.GetCol()-1),this.SetSelection(t.GridRect(n,this.GetSelection().Top,this.GetCol(),this.GetSelection().Bottom)),this.GetCol()<this.GetLeftCol()&&this.SetLeftCol(this.GetLeftCol()-1)),39===s&&this.GetCol()<this.FColCount-1&&(n=this.GetCol()===Math.max(this.GetSelection().Left,this.GetSelection().Right)?Math.min(this.GetSelection().Left,this.GetSelection().Right):Math.max(this.GetSelection().Left,this.GetSelection().Right),this.SetCol(this.GetCol()+1),this.SetSelection(t.GridRect(n,this.GetSelection().Top,this.GetCol(),this.GetSelection().Bottom)),this.GetCol()>=this.GetLeftCol()+this.GetVisibleColCount()&&this.SetLeftCol(this.GetLeftCol()+1)))),!0)},this.HandleTableFocus=function(t){return!0,!this.FEnabled||(-1===this.GetCol()&&-1===this.GetRow()&&!this.HasSelection()&&this.FFixedCols<this.FColCount&&this.FFixedRows<this.FRowCount&&this.CanSelect(this.FFixedCols,this.FFixedRows)&&this.SelectCell(this.FFixedCols,this.FFixedRows),!0)},this.HandleScroll=function(t){return this.FFixedCols>0&&(this.FFixedCol.parentElement.scrollTop=this.FNormalCells.parentElement.parentElement.scrollTop),this.FFixedRows>0&&(this.FFixedRow.parentElement.parentElement.scrollLeft=this.FNormalCells.parentElement.parentElement.scrollLeft),this.TopLeftChanged(),!0,!0},this.HandleEditBlur=function(t){return this.FEditMode&&this.HideEdit(!1),!0,!0},this.HandleEditKeyPress=function(t){var e="";return t.cancelBubble=!0,t.stopPropagation(),!0,this.IsKeyCharacter(t.key)&&(e=String.fromCharCode(this.GetKeyCode(t.key,!1)),null!=this.FOnKeyPress&&this.FOnKeyPress(this,{get:function(){return e},set:function(t){e=t}})),!0},this.HandleComboExit=function(t){this.FEditMode&&this.HideEdit(!1)},this.HandleComboKeyPress=function(t,e){null!=this.FOnKeyPress&&this.FOnKeyPress(this,e),27===e.get().charCodeAt()&&this.CancelEdit(),13===e.get().charCodeAt()&&this.HideEdit(this.FEditAdvance)},this.HandleMaskExit=function(t){this.FEditMode&&this.HideEdit(!1)},this.HandleMaskKeyPress=function(t,e){null!=this.FOnKeyPress&&this.FOnKeyPress(this,e),27===e.get().charCodeAt()&&this.CancelEdit(),13===e.get().charCodeAt()&&this.HideEdit(this.FEditAdvance)},this.HandleMemoExit=function(t){this.FEditMode&&this.HideEdit(!1)},this.HandleMemoKeyPress=function(t,e){null!=this.FOnKeyPress&&this.FOnKeyPress(this,e),27===e.get().charCodeAt()&&this.CancelEdit()},this.HandleCheckBoxClick=function(t){var e,i=0,s=0;i=-1,s=-1,e=(n=t.target).checked;var n,r=n.parentElement;"td"==r.tagName.toLowerCase()&&(s=r.cellIndex,i=r.parentElement.rowIndex);-1!==i&&-1!==s&&(this.CanEditCell(s+this.FFixedCols,i+this.FFixedRows)?this.DoCheckClick(s+this.FFixedCols,i+this.FFixedRows,e):(n=t.target).checked=!n.checked);return!1},this.HandleButtonClick=function(t){var e=0,i=0;e=-1,i=-1;var s=t.target.parentElement;"td"==s.tagName.toLowerCase()&&(i=s.cellIndex,e=s.parentElement.rowIndex);return-1!==e&&-1!==i&&this.DoButtonClick(i+this.FFixedCols,e+this.FFixedRows),!1},this.HandleDoMouseUp=function(t){var e=0;return pas["WEBLib.Controls"].TControl.HandleDoMouseUp.apply(this,arguments),e=TMSStringGridisSizing(),TMSStringGridresetResize(),e>=0&&this.DoColumnSized(e),!0},this.HandleDoMouseMove=function(t){var e="",i=!1;return pas["WEBLib.Controls"].TControl.HandleDoMouseMove.apply(this,arguments),e=this.GetID()+"tbl",i=this.FWidthStyle in rtl.createSet(2),TMSStringGridID=e,TMSStringGridautoWidth=i,GridNormalCells=this.FNormalCells,GridFixedCells=this.FFixedRow,GridFixedColCells=this.FFixedCol,GridFixedColRows=this.FFixedColRow,GridColWidths=this.FColWidths,GridFixedCols=this.FFixedCols,TMSStringGridresizeColumn(t),!0},this.HandleDoClick=function(t){var e=!1;return e=pas["WEBLib.Controls"].TControl.HandleDoClick.apply(this,arguments),this.FEditMode||null==this.FNormalCells||this.FNormalCells.focus(),e},this.DoCheckClick=function(t,e,i){null!=this.FOnCheckClick&&this.FOnCheckClick(this,t,e,i)},this.DoButtonClick=function(t,e){null!=this.FOnButtonClick&&this.FOnButtonClick(this,t,e)},this.DoSortClick=function(t,e,i){var s=0;this.FSortIndex=t;for(var n=0,r=this.FColCount-1;n<=r;n++)s=n,this.SelectSortIndicator(s,e,s===t);this.FSortDirection=i,null!=this.FOnSortClick&&this.FOnSortClick(this,t,e,i),this.Sort(t,i)},this.GetEditText=function(t,e){var i="";return i=this.GetCells(t,e),null!=this.FOnGetEditText&&this.FOnGetEditText(this,t,e,{get:function(){return i},set:function(t){i=t}}),i},this.SetEditText=function(t,e,i){null!=this.FOnSetEditText&&this.FOnSetEditText(this,t,e,i)},this.GetCellData=function(t,e,i,s){null!=this.FOnGetCellData&&this.FOnGetCellData(this,t,e,i,s)},this.GetCellClassName=function(t,e,i,s,n){null!=this.FOnGetCellClass&&this.FOnGetCellClass(this,t,e,i,s,n)},this.GetCellChildren=function(t,e,i,s,n){var r=pas["WEBLib.Controls"].TJSHTMLElementRecord.$new();null!=this.FOnGetCellChildren&&(r.element=n,this.FOnGetCellChildren(this,t,e,i,s,pas["WEBLib.Controls"].TJSHTMLElementRecord.$clone(r)))},this.GetCellEditor=function(t,e,i){null!=this.FOnGetCellEditor&&this.FOnGetCellEditor(this,t,e,i)},this.AddSelection=function(t){this.FShowSelection&&t.classList.add("selected")},this.RemoveSelection=function(t){this.FShowSelection&&t.classList.remove("selected")},this.DoBoundsChange=function(){var t=0,e=0,i=0,s=0;pas["WEBLib.Controls"].TControl.DoBoundsChange.call(this),null!=this.GetElementHandle()&&(this.UpdateGridSize(),t=this.FixedColWidth(),e=this.FixedRowHeight(),i=this.GetWidth()-t,s=this.GetHeight()-e,null!=this.FNormalCells&&(this.FNormalCells.parentElement.parentElement.style.setProperty("width",pas.SysUtils.IntToStr(i)+"px"),this.FNormalCells.parentElement.parentElement.style.setProperty("height",pas.SysUtils.IntToStr(s)+"px")))},this.DoColumnSized=function(t){null!=this.FOnColumnSized&&this.FOnColumnSized(this,t)},this.GetGridCSS=function(t){var e="";return e="",""!==this.FElementTableClassName?e:(2 in this.FOptions||(e="border-left: 0px; border-right: 0px;"),3 in this.FOptions||(e+="border-top: 0px; border-bottom: 0px;"),0===this.FElementFont&&(e+=pas["WEBLib.Graphics"].CSSFont(this.FFont)),e="table#"+t+" td { overflow: hidden; text-overflow: ellipsis; white-space:nowrap; border: solid 1px "+pas["WEBLib.Graphics"].ColorToHTML(this.FGridLineColor)+"; padding: 0px;"+e+"} \rtable#"+t+" td.selected { background-color: "+pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionColor)+"; color: "+pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionTextColor)+";} \rtable#"+t+" tr.selected { background-color: "+pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionColor)+"; color: "+pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionTextColor)+";} \rtable#"+t+" DIV.cell {word-wrap: normal; white-space: normal; text-overflow: clip; } ")},this.RenderGrid=function(){for(var t,e,i,s,n,r,o,l,a,h,u=null,d=0,c=0,F=0,p=0,C=0,m=null,S=null,y="";this.FColWidths.GetCount()<=this.FColCount;)this.FColWidths.Add(this.FDefaultColWidth);if(null==this.FGrid){u=this.GetIsLinked()&&null!=this.GetElementHandle().firstElementChild?this.GetElementHandle().firstElementChild:document.createElement("TABLE"),""===(y=this.GetID())&&(y=this.FName),u.setAttribute("id",y+"tbl"),""===this.FElementTableClassName?(u.setAttribute("class","table."+this.StylePrefix()+this.FName),u.style.setProperty("border-collapse","collapse"),u.style.setProperty("border-spacing","0px"),u.style.setProperty("border","0px")):u.setAttribute("class",this.FElementTableClassName),this.FGrid=u,pas["WEBLib.Controls"].SetHTMLElementFont(u,this.FFont,!(""===this.FElementClassName&&0===this.FElementFont)),this.$class.AddInstanceStyle$1(this.StylePrefix()+y,this.GetGridCSS(this.StylePrefix()+y)),a=2===this.FWidthStyle,h=this.GetID()+"tbl";m=void 0;var f=void 0,g=(S=void 0,void 0);if(this.FFixedColRow=document.createElement("TABLE"),this.FFixedColRow.setAttribute("id",h+"ResizeFixedRowTable"),this.FFixedColRow.style.setProperty("border-collapse","collapse"),this.FFixedColRow.style.setProperty("border-spacing","0px"),this.FFixedCol=document.createElement("TABLE"),this.FFixedCol.setAttribute("id",h+"ResizeFixedColTable"),this.FFixedCol.style.setProperty("border-collapse","collapse"),this.FFixedCol.style.setProperty("border-spacing","0px"),this.FFixedRow=document.createElement("TABLE"),this.FFixedRow.setAttribute("id",h+"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",h+"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(u),this.FixedColWidth(),t=this.FixedRowHeight(),e=this.NormalColWidth(),i=this.NormalRowHeight(),p=this.GetWidth()-this.FixedColWidth(),C=this.GetHeight()-this.FixedRowHeight(),1===this.FBorderStyle&&(p-=2,C-=2),p-pas["WEBLib.Controls"].GetScrollBarWidth(),s=C-pas["WEBLib.Controls"].GetScrollBarHeight(),n=pas["WEBLib.Graphics"].ColorToHTML(this.FFixedColor),r=pas["WEBLib.Graphics"].ColorToHTML(this.FFixedTextColor),(m=(f=u.insertRow(0)).insertCell(0)).style.border="0px",(m=f.insertCell(1)).style.border="0px",(m=(f=u.insertRow(1)).insertCell(0)).style.border="0px",(m=f.insertCell(1)).style.border="0px",this.FFixedRows>0){if(F=0,this.FFixedCols>0?(F=1,m=u.rows[0].cells[0],(S=document.createElement("DIV")).style.height=t+"px",S.style.overflow="hidden",S.style.backgroundColor=n,S.style.color=r,m.appendChild(S),S.appendChild(this.FFixedColRow)):((m=u.rows[0].cells[0]).style.border="0px",(m=u.rows[1].cells[0]).style.border="0px"),(m=u.rows[0].cells[1]).style.backgroundColor=n,m.style.color=r,(S=document.createElement("DIV")).style.height=t+"px",a||(S.style.width=p+"px"),S.style.overflow="hidden",S.style.backgroundColor=n,S.style.color=r,m.appendChild(S),(g=document.createElement("DIV")).style.height=t+"px",a||(g.style.width=e+"px"),S.appendChild(g),g.appendChild(this.FFixedRow),this.FFixedCols>0)for(var E=0,T=this.FFixedRows-1;E<=T;E++){d=E,f=this.FFixedColRow.insertRow(d);for(var b=0,P=this.FFixedCols-1;b<=P;b++)c=b,(m=f.insertCell(c)).style.setProperty("background-color",n),m.style.setProperty("color",r),this.SetAlignAttr(this.GetColAlignments(c),m)}for(var v=0,L=this.FFixedRows-1;v<=L;v++){d=v,f=this.FFixedRow.insertRow(d);for(var D=this.FFixedCols,M=this.FColCount-1;D<=M;D++)F=(c=D)-this.FFixedCols,(m=f.insertCell(F)).style.setProperty("background-color",n),m.style.setProperty("color",r),this.SetAlignAttr(this.GetColAlignments(c),m)}}if(F=0,this.FFixedCols>0){F=1,(m=u.rows[1].cells[0]).style.backgroundColor=n,m.style.color=r,(S=document.createElement("DIV")).style.height=s+"px",S.style.overflow="hidden",S.style.backgroundColor=n,S.style.color=r,m.setAttribute("valign","top"),m.appendChild(S),S.appendChild(this.FFixedCol),this.SetAlignAttr(this.GetColAlignments(0),m);for(var G=this.FFixedRows,A=this.FRowCount-1;G<=A;G++){c=(d=G)-this.FFixedRows,f=this.FFixedCol.insertRow(c);for(var O=0,B=this.FFixedCols-1;O<=B;O++)c=O,(m=f.insertCell(c)).style.setProperty("background-color",n),m.style.setProperty("color",r),this.SetAlignAttr(this.GetColAlignments(c),m)}}m=(this.FFixedCols,u.rows[1].cells[1]),o=2===this.FScrollBars||3===this.FScrollBars,l=1===this.FScrollBars||3===this.FScrollBars,(S=document.createElement("DIV")).style.overflowY=o?"auto":"hidden",S.style.overflowX=l?"auto":"hidden",a||(S.style.width=p+"px"),S.style.height=C+"px",m.appendChild(S),g=document.createElement("DIV"),a||(g.style.width=e+"px"),g.style.height=i+"px",S.parentElement.style.verticalAlign="top",S.appendChild(g),g.appendChild(this.FNormalCells),S.addEventListener("scroll",rtl.createSafeCallback(this,"HandleScroll"));for(var $=this.FFixedRows,W=this.FRowCount-1;$<=W;$++){F=(d=$)-this.FFixedRows,f=this.FNormalCells.insertRow(F);for(var R=this.FFixedCols,I=this.FColCount-1;R<=I;R++)F=(c=R)-this.FFixedCols,m=f.insertCell(F),this.SetAlignAttr(this.GetColAlignments(0),m)}this.FNormalCells.parentElement.parentElement.addEventListener("keydown",rtl.createCallback(this,"HandleKeyDown")),this.FNormalCells.addEventListener("focus",rtl.createSafeCallback(this,"HandleTableFocus")),this.EnableColResize(),1===this.FDragMode&&this.EnableDrag()}},this.ReRenderGrid=function(){this.GetIsLinked()||null==this.FGrid.firstElementChild||this.FGrid.removeChild(this.FGrid.firstChild),this.FGrid=null,this.RenderGrid(),this.UpdateGridSize(),this.UpdateGridAlignment()},this.RenderGridSize=function(){var t,e,i=0,s=0;if(null!=this.FGrid){var n,r;if(this.FixedColWidth(),this.FixedRowHeight(),this.NormalColWidth(),this.NormalRowHeight(),i=this.GetWidth()-this.FixedColWidth(),s=this.GetHeight()-this.FixedRowHeight(),1===this.FBorderStyle&&(i-=2,s-=2),t=i-pas["WEBLib.Controls"].GetScrollBarWidth(),e=s-pas["WEBLib.Controls"].GetScrollBarHeight(),this.FFixedRows>0&&1===this.FWidthStyle)if(null!=(n=this.FGrid.rows[0].cells[1]))(r=n.firstChild).style.width=t+"px",r.style.overflow="hidden";if(this.FFixedCols>0&&1===this.FHeightStyle)if(null!=(n=this.FGrid.rows[1].cells[0]))(r=n.firstChild).style.height=e+"px",r.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;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) { TMSStringGridresetResize();}\r\nfunction 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("mouseuo", 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 = " "; return div; }};')},this.UpdateGridSize=function(){var t=0,e=0,i=0,s=0,n=0,r=0,o=0;if(null!=this.GetElementHandle()&&!this.IsUpdating()&&0!==this.FRowCount&&0!==this.FColCount){for(var l=0,a=this.FFixedCols-1;l<=a;l++){if(t=l,n=this.GetColWidths(t)-0,this.FFixedRows>0&&this.FFixedCols>0)for(e=0;e<this.FFixedColRow.rows.length;e++){(S=(y=this.FFixedColRow.rows[e]).cells[t]).style.width=n+"px",S.style.maxWidth=n+"px"}if(this.FFixedCols>0)for(e=0;e<this.FFixedCol.rows.length;e++){(S=(y=this.FFixedCol.rows[e]).cells[t]).style.width=n+"px",S.style.maxWidth=n+"px"}}for(var h=0,u=this.FFixedRows-1;h<=u;h++){if(t=h,r=this.GetRowHeights(t),this.FFixedCols>0)(y=this.FFixedColRow.rows[t]).style.height=r+"px";(y=this.FFixedRow.rows[t]).style.height=r+"px"}for(var d=this.FFixedCols,c=this.FColCount-1;d<=c;d++){if(t=d,n=this.GetColWidths(t)-0,i=t-this.FFixedCols,this.FFixedRows>0)for(t=0;t<this.FFixedRow.rows.length;t++){(S=(y=this.FFixedRow.rows[t]).cells[i]).style.width=n+"px",S.style.maxWidth=n+"px"}if(this.FNormalCells.rows.length>0)(S=(y=this.FNormalCells.rows[0]).cells[i]).style.width=n+"px",S.style.maxWidth=n+"px"}for(var F=this.FFixedRows,p=this.FRowCount-1;F<=p;F++){i=(t=F)-this.FFixedRows,r=this.GetRowHeights(t);for(var C=this.FFixedCols,m=this.FColCount-1;C<=m;C++){var S,y;if(s=(e=C)-this.FFixedCols,n=this.GetColWidths(e)-0,o=r,t===this.FRowCount-1&&this.HasHorzScrollBar()&&this.HasVertScrollBar()&&(o=r+20),this.FFixedCols>0)if((y=this.FFixedCol.rows[i]).style.height=o+"px",t===this.FRowCount-1&&this.HasHorzScrollBar()&&this.HasVertScrollBar())(S=this.FFixedCol.rows[i].cells[0]).style.setProperty("vertical-align","top");(y=this.FNormalCells.rows[i]).style.height=r+"px",(S=y.cells[s]).style.maxWidth=n+"px"}}}},this.UpdateGridAlignment=function(){var t=0,e=0,i=0;if(null!=this.GetElementHandle()&&!this.IsUpdating()&&0!==this.FRowCount&&0!==this.FColCount&&0!==this.FColAlignments.GetCount()){for(var s=0,n=this.FFixedCols-1;s<=n;s++){if(t=s,i=this.GetColAlignments(t),this.FFixedRows>0&&this.FFixedCols>0)for(j=0;j<this.FFixedColRow.rows.length;j++){var r=this.FFixedColRow.rows[j].cells[t];this.SetAlignAttr(i,r)}if(this.FFixedCols>0)for(j=0;j<this.FFixedCol.rows.length;j++){r=this.FFixedCol.rows[j].cells[t];this.SetAlignAttr(i,r)}}for(var o=this.FFixedCols,l=this.FColCount-1;o<=l;o++){if(t=o,i=this.GetColAlignments(t),e=t-this.FFixedCols,this.FFixedRows>0)for(t=0;t<this.FFixedRow.rows.length;t++){r=this.FFixedRow.rows[t].cells[e];this.SetAlignAttr(i,r)}for(t=0;t<this.FNormalCells.rows.length;t++){r=this.FNormalCells.rows[t].cells[e];this.SetAlignAttr(i,r)}}}},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.GridChanged=function(){t.TCustomGrid.GridChanged.call(this),this.FSelectedCell=null,this.UpdateGridSize(),this.UpdateGridAlignment()},this.CreateElement=function(){var t;return t=document.createElement("SPAN"),this.FGrid=null,t},this.UpdateElement=function(){var t="",e="";if(pas["WEBLib.Controls"].TControl.UpdateElement.call(this),!this.IsUpdating()&&null!=this.GetElementHandle()){if(16711422!==this.FColor&&-1!==this.FColor&&this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(this.FColor)),this.GetElementHandle().style.setProperty("overflow","hidden"),1!==this.FBorderStyle||-1===this.FBorderColor||""!==this.FElementClassName||this.GetIsLinked()?this.GetElementHandle().style.setProperty("border",""):this.GetElementHandle().style.setProperty("border","1px solid "+pas["WEBLib.Graphics"].ColorToHTML(this.FBorderColor)),this.RenderGrid(),t=pas["WEBLib.Graphics"].ColorToHTML(this.FColor),16711422!==this.FColor)null!=this.FNormalCells.tBodies[0]&&this.FNormalCells.tBodies[0].style.setProperty("background-color",t),this.FNormalCells.parentElement.parentElement.style.setProperty("background-color",t);""===(e=this.GetID())&&(e=this.FName),this.$class.AddInstanceStyle$1(this.StylePrefix()+e,this.GetGridCSS(e+"tbl")),this.UpdateGridSize(),this.UpdateGridAlignment()}},this.UpdateElementVisual=function(){var t="",e="";pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this),this.IsUpdating()||null!=this.GetElementHandle()&&null!=this.FGrid&&(t=pas["WEBLib.Graphics"].ColorToHTML(this.FFixedColor),e=pas["WEBLib.Graphics"].ColorToHTML(this.FFixedTextColor),this.FFixedCols>0&&this.FFixedRows>0&&(this.FFixedColRow.parentElement.style.setProperty("background-color",t),this.FFixedColRow.parentElement.style.setProperty("color",e)),this.FFixedCols>0&&(this.FFixedCol.parentElement.style.setProperty("background-color",t),this.FFixedCol.parentElement.style.setProperty("color",e)),this.FFixedRows>0&&(this.FFixedRow.parentElement.style.setProperty("background-color",t),this.FFixedRow.parentElement.style.setProperty("color",e),this.FFixedRow.parentElement.parentElement.style.setProperty("background-color",t),this.FFixedRow.parentElement.parentElement.style.setProperty("color",e)))},this.FixedColWidth=function(){var t=0,e=0;t=0;for(var i=0,s=this.FFixedCols-1;i<=s;i++)e=i,t=t+this.GetColWidths(e)-0;return t},this.FixedRowHeight=function(){var t=0,e=0;t=0;for(var i=0,s=this.FFixedRows-1;i<=s;i++)e=i,t+=this.GetRowHeights(e);return t},this.NormalColWidth=function(){var t=0,e=0;t=1;for(var i=this.FFixedCols,s=this.FColCount-1;i<=s;i++)e=i,t=t+this.GetColWidths(e)+1-0;return t},this.NormalRowHeight=function(){var t=0,e=0;t=0;for(var i=this.FFixedRows,s=this.FRowCount-1;i<=s;i++)e=i,t+=this.GetRowHeights(e);return t},this.CanSelect=function(t,e){var i=!1;return i=!0,null!=this.FOnSelectCell&&this.FOnSelectCell(this,t,e,{get:function(){return i},set:function(t){i=t}}),i},this.HasSelection=function(){return!(0===this.GetSelection().Left&&0===this.GetSelection().Top&&0===this.GetSelection().Right&&0===this.GetSelection().Bottom)},this.UpdateCell=function(t,e,i){},this.ValidateCell=function(t,e,i){null!=this.FOnValidateEdit&&this.FOnValidateEdit(this,t,e,i)},this.TopLeftChanged=function(){null!=this.FOnTopLeftChanged&&this.FOnTopLeftChanged(this)},this.RowCountChanged=function(t){var e,i=0,s="",n="";if(!(this.IsUpdating()&&0 in this.FComponentState||null==this.FNormalCells)){if(this.FFixedRows,e=this.FFixedCols,t>0){s=pas["WEBLib.Graphics"].ColorToHTML(this.FFixedColor),n=pas["WEBLib.Graphics"].ColorToHTML(this.FFixedTextColor);var r=0,o=0,l=void 0,a=void 0,h=this.FNormalCells.rows.length;for(r=0;r<t;r++){for(l=this.FNormalCells.insertRow(h),o=this.FFixedCols;o<this.FColCount;o++)a=l.insertCell(0);if(e>0)for(l=this.FFixedCol.insertRow(h),o=0;o<this.FFixedCols;o++)(a=l.insertCell(0)).style.setProperty("background-color",s),a.style.setProperty("color",n)}this.BeginUpdate();for(var u=1,d=t;u<=d;u++)i=u,this.SetRowHeights(this.FRowCount-i,this.FDefaultRowHeight);1===this.FDragMode&&this.EnableDrag(),this.EndUpdate()}if(t<0){r=0;if((h=this.FNormalCells.rows.length)>0)for(r=0;r<-t;r++)this.FNormalCells.deleteRow(h-r-1),e>0&&this.FFixedCol.deleteRow(h-r-1);this.FRowCount>0&&this.SetRowHeights(this.FRowCount-1,this.GetRowHeights(this.FRowCount-1))}}},this.ColCountChanged=function(t){var e=0,i="",s="";if(!(this.IsUpdating()&&0 in this.FComponentState||null==this.FNormalCells)){if(t>0){i=pas["WEBLib.Graphics"].ColorToHTML(this.FFixedColor),s=pas["WEBLib.Graphics"].ColorToHTML(this.FFixedTextColor);var n,r=0,o=0,l=0,a=void 0,h=void 0,u=void 0,d=this.FNormalCells.rows.length;for(o=0;o<d;o++)for(l=(a=this.FNormalCells.rows[o]).cells.length,r=0;r<t;r++)a.insertCell(l);for(o=0;o<this.FFixedRows;o++)for(l=this.FFixedRow.rows[o].cells.length,r=0;r<t;r++)(h=this.FFixedRow.rows[o].insertCell(l)).style.setProperty("background-color",i),h.style.setProperty("color",s),(u=document.createElement("DIV")).style="position:relative;height:100%;width:100%",h.appendChild(u),(n=document.createElement("DIV")).style="position:absolute;height:100%;width:5px;margin-right:-5px;left:100%;top:0px;cursor:w-resize;z-index:999;",u.appendChild(n);for(var c=1,F=t;c<=F;c++)e=c,this.SetColWidths(this.FColCount-e,this.FDefaultColWidth);1===this.FDragMode&&this.EnableDrag()}if(t<0){r=0,o=0,l=0,a=void 0,d=this.FNormalCells.rows.length;for(o=0;o<d;o++)for(l=(a=this.FNormalCells.rows[o]).cells.length,r=0;r<-t;r++)a.deleteCell(l-r-1);if(this.FFixedRows>0)for(l=this.FFixedRow.rows[0].cells.length,r=0;r<-t;r++)this.FFixedRow.rows[0].deleteCell(l-r-1);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.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.FHandleClickPtr=rtl.createCallback(this,"HandleClick")},this.StartEdit=function(t){var e,i,s=!1;if(this.FWordWrap?this.FEditType=13:this.FEditType=0,this.GetCellEditor(this.GetCol(),this.GetRow(),{p:this,get:function(){return this.p.FEditType},set:function(t){this.p.FEditType=t}}),14!==this.FEditType){if(e=this.GetElementHandle(),this.FEditRow=this.GetRow(),this.FEditCol=this.GetCol(),this.FEditMode=!0,i=this.GetEditText(this.GetCol(),this.GetRow()),this.FOrigVal=i,12===this.FEditType)return null==this.FCombo&&(this.FCombo=pas["WEBLib.StdCtrls"].TWebComboBox.$create("Create$1",[this]),this.FCombo.SetElementPosition(1),this.FCombo.SetWidthStyle(0),this.FCombo.SetWidthPercent(100),this.FCombo.SetHeightStyle(0),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(i),this.FSelectedCell.innerHTML="",this.FSelectedCell.appendChild(this.FCombo.GetElementHandle()),this.FCombo.SetFocus(),void this.RemoveSelection(this.FSelectedCell);if(13===this.FEditType)return null==this.FMemo&&(this.FMemo=pas["WEBLib.StdCtrls"].TWebMemo.$create("Create$1",[this]),this.FMemo.SetElementPosition(1),this.FMemo.SetWidthStyle(0),this.FMemo.SetWidthPercent(100),this.FMemo.SetBorderStyle(0),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(i),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(),void this.RemoveSelection(this.FSelectedCell);if(11===this.FEditType)return null==this.FMask&&(this.FMask=pas["WEBLib.Mask"].TWebMaskEdit.$create("Create$1",[this]),this.FMask.SetElementPosition(1),this.FMask.SetWidthStyle(0),this.FMask.SetWidthPercent(100),this.FMask.SetHeightStyle(0),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(i),this.FSelectedCell.innerHTML="",this.FSelectedCell.appendChild(this.FMask.GetElementHandle()),this.FMask.SetFocus(),this.FMask.SetSelection(0,i.length),void this.RemoveSelection(this.FSelectedCell);s=!1,null==this.FEdit&&(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"),s=!0),this.FEdit.removeAttribute("type"),this.FEdit.removeAttribute("min"),this.FEdit.removeAttribute("max"),this.FEdit.removeAttribute("step"),this.FEdit.value=""==t?i:t,this.FEdit.style.width="100%",this.FEdit.style.height="100%",this.FEdit.style.fontFamily=e.style.fontFamily,this.FEdit.style.fontSize=e.style.fontSize,this.FEdit.setSelectionRange(0,this.FEdit.value.length),this.FSelectedCell.innerHTML="",this.FSelectedCell.appendChild(this.FEdit);var n=this.FEditType;8===n?this.FEdit.setAttribute("type","URL"):2===n?this.FEdit.setAttribute("type","DATE"):3===n?this.FEdit.setAttribute("type","TIME"):4===n?(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))):9===n?this.FEdit.setAttribute("type","EMAIL"):1===n?this.FEdit.setAttribute("type","NUMBER"):10===n?this.FEdit.setAttribute("type","TEL"):5===n&&this.FEdit.setAttribute("type","COLOR"),this.FEdit.focus(),this.RemoveSelection(this.FSelectedCell),s&&(this.FEdit.addEventListener("blur",this.FHandleEditBlurPtr),this.FEdit.addEventListener("keypress",this.FHandleEditKeypressPtr))}},this.CanEditCell=function(t,e){var i=!1;return i=!0,null!=this.FOnCanEditCell&&this.FOnCanEditCell(this,t,e,{get:function(){return i},set:function(t){i=t}}),i},this.ChangeRow=function(){},this.EnableColResize=function(){var t="",e=!1;4 in this.FComponentState||(t=this.GetID()+"tblResizeRow",e=7 in this.FOptions,TMSStringGridresizableGrid(t,e),t=this.GetID()+"tblResizeFixedRow",e=7 in this.FOptions,TMSStringGridresizableGrid(t,e))},this.EnableDrag=function(){null!=this.GetContainer()&&function t(e){for(var i=0,s=0,n=e.children.length-1;s<=n;s++)i=s,"TD"===e.children.item(i).tagName?(e.children.item(i).setAttribute("draggable","true"),t(e.children.item(i))):t(e.children.item(i))}(this.GetContainer())},this.DisableDrag=function(){null!=this.GetContainer()&&function t(e){for(var i=0,s=0,n=e.children.length-1;s<=n;s++)i=s,"TD"===e.children.item(i).tagName?(e.children.item(i).removeAttribute("draggable"),t(e.children.item(i))):t(e.children.item(i))}(this.GetContainer())},this.Create$1=function(t){return pas["WEBLib.Controls"].TControl.Create$1.apply(this,arguments),this.FDrawingStyle=1,this},this.Destroy=function(){var t=0,e=null;rtl.free(this,"FRange"),rtl.free(this,"FColWidths"),rtl.free(this,"FColAlignments"),rtl.free(this,"FRowHeights"),rtl.free(this,"FRows");for(var i=0,s=this.FObjectRows.GetCount()-1;i<=s;i++)t=i,e=rtl.getObject(this.FObjectRows.Get(t)),e=rtl.freeLoc(e);this.FObjectRows.Clear(),rtl.free(this,"FObjectRows"),rtl.free(this,"FComboBoxItems"),null!=this.FCombo&&rtl.free(this,"FCombo"),null!=this.FMask&&rtl.free(this,"FMask"),pas["WEBLib.Controls"].TCustomControl.Destroy.call(this)},this.CreateInitialize=function(){pas["WEBLib.Controls"].TCustomControl.CreateInitialize.call(this),this.FEditAdvance=!1,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=t.TGridRange.$create("Create$1"),this.FHasMergedCells=!1,this.FDefaultColAlignment=0,this.FStartCell.X=-1,this.FStartCell.Y=-1,this.FFixedColor=15790320,this.FRowCount=5,this.FColCount=5,this.FFixedCols=1,this.FFixedRows=1,this.FDefaultColWidth=64,this.FDefaultRowHeight=22,this.FShowSelection=!0,this.SetElementFont(0),this.SetElementPosition(0),this.FScrollBars=3,this.FGridLineColor=12632256,this.FSelectionColor=16748379,this.FSelectionTextColor=16777215,this.FOptions=rtl.createSet(3,2,4),4 in this.FComponentState&&(this.SetWidth(400),this.SetHeight(300))},this.SetFocus=function(){null!=this.FNormalCells&&this.FNormalCells.focus()},this.ShowEdit=function(){this.StartEdit("")},this.HideEdit=function(t){var e="",i="",s=null,n=0;this.FEditMode&&(this.FEditMode=!1,12===this.FEditType?(e=this.FCombo.GetText(),s=this.FCombo.GetElementHandle()):13===this.FEditType?(e=this.FMemo.FLines.GetTextStr(),s=this.FMemo.GetElementHandle()):11===this.FEditType?(e=this.FMask.GetText(),s=this.FMask.GetElementHandle()):(e=rtl.asExt(this.FEdit,HTMLInputElement).value,s=this.FEdit),this.ValidateCell(this.FEditCol,this.FEditRow,{get:function(){return e},set:function(t){e=t}}),this.FSelectedCell.contains(s)&&this.FSelectedCell.removeChild(s),i=e,this.FWordWrap&&(n=this.GetRowHeights(this.FEditRow)-2,i='<DIV class="cell" style="height:'+pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get:function(){return n},set:function(t){n=t}})+"px;max-height:"+pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get:function(){return n},set:function(t){n=t}})+'px">'+i+"</DIV>"),this.FSelectedCell.innerHTML=i,this.UpdateCell(this.FEditCol,this.FEditRow,{get:function(){return e},set:function(t){e=t}}),this.AddSelection(this.FSelectedCell),this.SetEditText(this.FEditCol,this.FEditRow,e),this.FNormalCells.focus(),t&&(this.GetCol()<this.FColCount-1?this.SetCol(this.GetCol()+1):this.GetRow()<this.FRowCount-1?(this.SetCol(this.FFixedCols),this.SetRow(this.GetRow()+1)):(this.SetCol(this.FFixedCols),this.SetRow(this.FFixedRows)),this.CanEditCell(this.GetCol(),this.GetRow())&&this.StartEdit("")))},this.CancelEdit=function(){var t=null;this.FEditMode&&(t=12===this.FEditType?this.FCombo.GetElementHandle():13===this.FEditType?this.FMemo.GetElementHandle():11===this.FEditType?this.FMask.GetElementHandle():this.FEdit,this.FEditMode=!1,this.ValidateCell(this.FEditCol,this.FEditRow,{p:this,get:function(){return this.p.FOrigVal},set:function(t){this.p.FOrigVal=t}}),this.FSelectedCell.contains(t)&&this.FSelectedCell.removeChild(t),this.FSelectedCell.innerHTML=this.FOrigVal,this.UpdateCell(this.FEditCol,this.FEditRow,{p:this,get:function(){return this.p.FOrigVal},set:function(t){this.p.FOrigVal=t}}),this.AddSelection(this.FSelectedCell),this.SetEditText(this.FEditCol,this.FEditRow,this.FOrigVal),this.FNormalCells.focus())},this.Clear=function(){for(var t=0,e=0,i=0,s=this.FColCount-1;i<=s;i++){t=i;for(var n=0,r=this.FRowCount-1;n<=r;n++)e=n,this.HasButton(t,e)&&this.RemoveButton(t,e),this.HasCheckBox(t,e)&&this.RemoveCheckBox(t,e),this.SetCells(t,e,"")}},this.Sort=function(t,e){var i,s,n;s=this.FNormalCells,n=1===e,i=t-this.FFixedCols;const r=(t,e)=>t.children[e].innerText||t.children[e].textContent,o=s;Array.from(o.querySelectorAll("tr:nth-child(n+1)")).sort(((t,e)=>(i,s)=>{return n=r(e?i:s,t),o=r(e?s:i,t),""===n||""===o||isNaN(n)||isNaN(o)?n.toString().localeCompare(o):n-o;var n,o})(i,n)).forEach(t=>o.appendChild(t))},this.LoadFromJSON$1=function(t,e){var i=void 0,s=null,n=0,r=0,o="",l=null,a=null,h="",u="";if(null!=(s=""!==e?t[e]:t)){l=pas.Classes.TStringList.$create("Create$1"),this.Clear(),this.SetRowCount(s.length+this.FFixedRows);for(var d=0,c=s.length-1;d<=c;d++){i=s[n=d],r=0,o="";var F=void 0;for(F in i)o+="|"+i[F],r++;pas.System.Delete({get:function(){return o},set:function(t){o=t}},1,1),l.FStrictDelimiter=!0,l.SetDelimiter("|"),l.SetDelimitedText(o),this.FColCount<l.GetCount()&&this.SetColCount(l.GetCount()+this.FFixedCols);for(var p=0,C=l.GetCount()-1;p<=C;p++)r=p,h=l.Get(r),this.GetCellData(this.FFixedCols+r,this.FFixedRows+n,null,{get:function(){return h},set:function(t){h=t}}),this.SetCells(this.FFixedCols+r,this.FFixedRows+n,h),u="",a=this.GetCellElements(this.FFixedCols+r,this.FFixedRows+n),this.GetCellChildren(this.FFixedCols+r,this.FFixedRows+n,null,h,a),this.GetCellClassName(this.FFixedCols+r,this.FFixedRows+n,null,h,{get:function(){return u},set:function(t){u=t}}),""!==u&&a.setAttribute("class",u)}l=rtl.freeLoc(l)}this.UpdateGridSize(),this.UpdateGridAlignment()},this.SelectCell=function(e,i){var s,n;if(this.SetSelection(t.GridRect(e,i,e,i)),s=e-this.FFixedCols,n=i-this.FFixedRows,s>=0&&n>=0){if(this.FNormalCells.rows.length<=0)return this.FSelectedCell=null,void this.UpdateIndicator(this.FFixedRows);this.FSelectedCell=this.FNormalCells.rows[n].cells[s]}else this.FSelectedCell=null},this.RemoveCheckBox=function(t,e){var i=null;t<this.FColCount&&e<this.FRowCount&&null!=(i=this.GetCheckElement(t,e))&&(i.removeEventListener("click",this.FHandleCheckClickPtr),i.remove())},this.HasCheckBox=function(t,e){var i=!1;return i=!1,t<this.FColCount&&e<this.FRowCount&&(i=null!=this.GetCheckElement(t,e)),i},this.RemoveButton=function(t,e){var i=null;t<this.FColCount&&e<this.FRowCount&&null!=(i=this.GetButtonElement(t,e))&&(i.removeEventListener("click",this.FHandleCheckClickPtr),i.remove())},this.HasButton=function(t,e){var i=!1;return i=!1,t<this.FColCount&&e<this.FRowCount&&(i=null!=this.GetButtonElement(t,e)),i},this.SelectSortIndicator=function(t,e,i){var s,n=null;s=this.FName+"si"+pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get:function(){return t},set:function(t){rtl.raiseE("EPropReadOnly")}})+"_"+pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get:function(){return e},set:function(t){rtl.raiseE("EPropReadOnly")}}),null!=(n=document.getElementById(s))&&(i?n.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FSelectionColor)):n.style.removeProperty("color"))},this.SetSortIndicator=function(t,i,s){var n,r=null;n=this.FName+"si"+pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get:function(){return t},set:function(t){rtl.raiseE("EPropReadOnly")}})+"_"+pas["WEBLib.Utils"].TLongIntHelper.ToString.call({get:function(){return i},set:function(t){rtl.raiseE("EPropReadOnly")}}),null!=(r=document.getElementById(n))&&(1===s?(r.innerHTML=e.GlyphAscending,r.setAttribute("sort","up")):(r.innerHTML=e.GlyphDescending,r.setAttribute("sort","dn")))},this.HasVertScrollBar=function(){var t=!1;return t=!1,null!=this.FNormalCells.parentElement&&(t=this.FNormalCells.parentElement.parentElement.clientHeight<this.FNormalCells.parentElement.scrollHeight),t},this.HasHorzScrollBar=function(){var t=!1;return t=!1,null!=this.FNormalCells.parentElement&&(t=this.FNormalCells.parentElement.parentElement.clientWidth<this.FNormalCells.parentElement.scrollWidth),t};var i=this.$rtti;i.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),i.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",{Default:!1}),i.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),i.addProperty("BiDiMode",2,pas["WEBLib.Controls"].$rtti.TBiDiMode,"FBiDiMode","SetBiDiMode",{Default:pas["WEBLib.Controls"].TBiDiMode.bdLeftToRight}),i.addProperty("BorderColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FBorderColor","SetBorderColor",{Default:12632256}),i.addProperty("BorderStyle",2,pas["WEBLib.Controls"].$rtti.TBorderStyle,"FBorderStyle","SetBorderStyle",{Default:pas["WEBLib.Controls"].TBorderStyle.bsSingle}),i.addProperty("DragMode",2,pas["WEBLib.Controls"].$rtti.TDragMode,"FDragMode","SetDragMode",{Default:pas["WEBLib.Controls"].TDragMode.dmManual}),i.addProperty("DefaultColAlignment",2,pas.Classes.$rtti.TAlignment,"FDefaultColAlignment","SetDefaultColAlignment",{Default:pas.Classes.TAlignment.taLeftJustify}),i.addProperty("DefaultColWidth",2,rtl.longint,"FDefaultColWidth","SetDefaultColWidth",{Default:64}),i.addProperty("DefaultRowHeight",2,rtl.longint,"FDefaultRowHeight","SetDefaultRowHeight",{Default:24}),i.addProperty("EditAdvance",0,rtl.boolean,"FEditAdvance","FEditAdvance",{Default:!1}),i.addProperty("EditMask",0,pas["WEBLib.Mask"].$rtti.TEditMask,"FEditMask","FEditMask"),i.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),i.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),i.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),i.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),i.addProperty("ElementTableClassName",2,rtl.string,"FElementTableClassName","SetElementTableClassName"),i.addProperty("FixedRows",2,rtl.longint,"FFixedRows","SetFixedRows",{Default:1}),i.addProperty("FixedCols",2,rtl.longint,"FFixedCols","SetFixedCols",{Default:1}),i.addProperty("FixedColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FFixedColor","SetFixedColor",{Default:15790320}),i.addProperty("FixedTextColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FFixedTextColor","SetFixedTextColor",{Default:0}),i.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),i.addProperty("GridLineColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FGridLineColor","SetGridLineColor",{Default:12632256}),i.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight"),i.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",{Default:100}),i.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FHeightStyle","SetHeightStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),i.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti.TMargins,"FMargins","SetMargins"),i.addProperty("Options",0,t.$rtti.TGridOptions,"FOptions","FOptions"),i.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),i.addProperty("ParentBiDiMode",0,rtl.boolean,"FParentBiDiMode","FParentBiDiMode",{Default:!0}),i.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti.TPopupMenu,"FPopupMenu","FPopupMenu"),i.addProperty("RangeEdit",2,t.$rtti.TGridRange,"FRange","SetRange"),i.addProperty("Scrollbars",0,pas["WEBLib.Controls"].$rtti.TScrollStyle,"FScrollBars","FScrollBars",{Default:pas["WEBLib.Controls"].TScrollStyle.ssBoth}),i.addProperty("SelectionColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FSelectionColor","SetSelectionColor",{Default:16748379}),i.addProperty("SelectionTextColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FSelectionTextColor","SetSelectionTextColor",{Default:16777215}),i.addProperty("ShowSelection",0,rtl.boolean,"FShowSelection","FShowSelection",{Default:!0}),i.addProperty("StyleElements",0,pas["WEBLib.Controls"].$rtti.TStyleElements,"FStyleElements","FStyleElements"),i.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder"),i.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),i.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth"),i.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",{Default:100}),i.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FWidthStyle","SetWidthStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),i.addProperty("WordWrap",0,rtl.boolean,"FWordWrap","FWordWrap",{Default:!1}),i.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),i.addProperty("OnClickCell",0,t.$rtti.TCellEvent,"FOnClickCell","FOnClickCell"),i.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),i.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnEnter","FOnEnter"),i.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnExit","FOnExit"),i.addProperty("OnMouseWheelDown",0,pas["WEBLib.Controls"].$rtti.TMouseWheelUpDownEvent,"FOnMouseWheelDown","FOnMouseWheelDown"),i.addProperty("OnMouseWheelUp",0,pas["WEBLib.Controls"].$rtti.TMouseWheelUpDownEvent,"FOnMouseWheelUp","FOnMouseWheelUp"),i.addProperty("OnCanEditCell",0,t.$rtti.TCellCanEditEvent,"FOnCanEditCell","FOnCanEditCell"),i.addProperty("OnColumnSized",0,t.$rtti.TColumnSizedEvent,"FOnColumnSized","FOnColumnSized"),i.addProperty("OnGetCellData",0,t.$rtti.TGridGetCellDataEvent,"FOnGetCellData","FOnGetCellData"),i.addProperty("OnGetCellChildren",0,t.$rtti.TGridGetCellChildrenEvent,"FOnGetCellChildren","FOnGetCellChildren"),i.addProperty("OnGetCellClass",0,t.$rtti.TGridGetCellClassEvent,"FOnGetCellClass","FOnGetCellClass"),i.addProperty("OnGetCellEditor",0,t.$rtti.TGridGetCellEditorEvent,"FOnGetCellEditor","FOnGetCellEditor"),i.addProperty("OnButtonClick",0,t.$rtti.TCellEvent,"FOnButtonClick","FOnButtonClick"),i.addProperty("OnCheckClick",0,t.$rtti.TCellCheckEvent,"FOnCheckClick","FOnCheckClick"),i.addProperty("OnFixedCellClick",0,t.$rtti.TCellEvent,"FOnFixedCellClick","FOnFixedCellClick"),i.addProperty("OnGetEditText",0,t.$rtti.TGetEditEvent,"FOnGetEditText","FOnGetEditText"),i.addProperty("OnSetEditText",0,t.$rtti.TSetEditEvent,"FOnSetEditText","FOnSetEditText"),i.addProperty("OnSelectCell",0,t.$rtti.TSelectCellEvent,"FOnSelectCell","FOnSelectCell"),i.addProperty("OnSortClick",0,t.$rtti.TGridSortClickEvent,"FOnSortClick","FOnSortClick"),i.addProperty("OnTopLeftChanged",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnTopLeftChanged","FOnTopLeftChanged"),i.addProperty("OnValidateEdit",0,t.$rtti.TGetEditEvent,"FOnValidateEdit","FOnValidateEdit"),i.addProperty("OnDragDrop",0,pas["WEBLib.Controls"].$rtti.TDragDropEvent,"FOnDragDrop","FOnDragDrop"),i.addProperty("OnDragOver",0,pas["WEBLib.Controls"].$rtti.TDragOverEvent,"FOnDragOver","FOnDragOver"),i.addProperty("OnEndDrag",0,pas["WEBLib.Controls"].$rtti.TEndDragEvent,"FonEndDrag","FonEndDrag"),i.addProperty("OnStartDrag",0,pas["WEBLib.Controls"].$rtti.TStartDragEvent,"FOnStartDrag","FOnStartDrag")})),rtl.createClass(this,"TStringGrid",this.TCustomStringGrid,(function(){var t=this.$rtti;t.addProperty("ColCount",2,rtl.longint,"FColCount","SetColCount"),t.addProperty("RowCount",2,rtl.longint,"FRowCount","SetRowCount"),t.addProperty("OnHttpRequestError",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnHttpRequestError","FOnHttpRequestError"),t.addProperty("OnHttpRequestSuccess",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnHttpRequestSuccess","FOnHttpRequestSuccess")})),this.GridRect=function(e,i,s,n){var r=t.TGridRect.$new();return r.Left=e,r.Top=i,r.Right=s,r.Bottom=n,r},t.$implcode=function(){e.GlyphAscending="▲",e.GlyphDescending="▼",e.CELLPADDING=0}}),["SysUtils","Math","WEBLib.Utils","WEBLib.WebTools","WEBLib.Forms","Types"]),rtl.module("WEBLib.REST",["System","Classes","Web","JS","SysUtils","WEBLib.Controls","WEBLib.JSON"],(function(){"use strict";var t=this;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.$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.FPostData="",this.FOnRequestResponse=null,this.FPassword="",this.FUser="",this.FTimeout=0,this.FOnTimeout=null,this.FOnError=null,this.FResponse=null,this.FResponseType=0,this.FOnProgress=null},this.$final=function(){this.FOnResponse=void 0,this.FOnAbort=void 0,this.FHeaders=void 0,this.FOnRequestResponse=void 0,this.FOnTimeout=void 0,this.FOnError=void 0,this.FResponse=void 0,this.FOnProgress=void 0,pas.Classes.TComponent.$final.call(this)},this.SetHeaders=function(t){this.FHeaders.Assign(t)},this.Create$1=function(t){return pas.Classes.TComponent.Create$1.apply(this,arguments),this.FHeaders=pas.Classes.TStringList.$create("Create$1"),this.FResponseType=0,this.FCommand=0,this.FTimeout=0,this.FResponse=null,this},this.Destroy=function(){rtl.free(this,"FHeaders"),pas.Classes.TComponent.Destroy.call(this)},this.GetResponseType=function(t){var e="";e="";return 1===t?e="text":2===t?e="blob":4===t?e="document":3===t?e="json":5===t&&(e="arraybuffer"),e};var e=this.$rtti;e.addProperty("Command",0,t.$rtti.THTTPCommand,"FCommand","FCommand"),e.addProperty("CustomCommand",0,rtl.string,"FCustomCommand","FCustomCommand"),e.addProperty("Headers",2,pas.Classes.$rtti.TStringList,"FHeaders","SetHeaders"),e.addProperty("Password",0,rtl.string,"FPassword","FPassword"),e.addProperty("PostData",0,rtl.string,"FPostData","FPostData"),e.addProperty("ResponseType",0,t.$rtti.THTTPRequestResponseType,"FResponseType","FResponseType",{Default:t.THTTPRequestResponseType.rtDefault}),e.addProperty("Timeout",0,rtl.longint,"FTimeout","FTimeout",{Default:0}),e.addProperty("URL",0,rtl.string,"FURL","FURL"),e.addProperty("User",0,rtl.string,"FUser","FUser"),e.addProperty("OnError",0,pas["WEBLib.Controls"].$rtti.THTTPErrorEvent,"FOnError","FOnError"),e.addProperty("OnAbort",0,pas["WEBLib.Controls"].$rtti.THTTPAbortEvent,"FOnAbort","FOnAbort"),e.addProperty("OnProgress",0,t.$rtti.THTTPProgressEvent,"FOnProgress","FOnProgress"),e.addProperty("OnRequestResponse",0,pas["WEBLib.Controls"].$rtti.THTTPRequestResponseEvent,"FOnRequestResponse","FOnRequestResponse"),e.addProperty("OnResponse",0,pas["WEBLib.Controls"].$rtti.THTTPResponseEvent,"FOnResponse","FOnResponse"),e.addProperty("OnTimeout",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnTimeout","FOnTimeout")})),this.$rtti.$MethodVar("THttpResponse",{procsig:rtl.newTIProcSig([["Sender",pas.System.$rtti.TObject],["AResponse",rtl.string]]),methodkind:0}),rtl.createClass(this,"TPersistTokens",pas.Classes.TPersistent,(function(){this.$init=function(){pas.Classes.TPersistent.$init.call(this),this.FKey="",this.FEnabled=!1},this.Create$1=function(){return this.FEnabled=!1,this.FKey="",this},this.Assign=function(e){t.TPersistTokens.isPrototypeOf(e)&&(this.FKey=rtl.as(e,t.TPersistTokens).FKey,this.FEnabled=rtl.as(e,t.TPersistTokens).FEnabled)};var e=this.$rtti;e.addProperty("Key",0,rtl.string,"FKey","FKey"),e.addProperty("Enabled",0,rtl.boolean,"FEnabled","FEnabled",{Default:!1})})),rtl.createClass(this,"TRESTApp",pas.Classes.TPersistent,(function(){this.$init=function(){pas.Classes.TPersistent.$init.call(this),this.FKey="",this.FCallbackURL="",this.FSecret=""},this.Assign=function(e){t.TRESTApp.isPrototypeOf(e)&&(this.FKey=rtl.as(e,t.TRESTApp).FKey,this.FCallbackURL=rtl.as(e,t.TRESTApp).FCallbackURL,this.FSecret=rtl.as(e,t.TRESTApp).FSecret)};var e=this.$rtti;e.addProperty("Key",0,rtl.string,"FKey","FKey"),e.addProperty("CallbackURL",0,rtl.string,"FCallbackURL","FCallbackURL"),e.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},rtl.recNewT(this,"TCoreCloudHeader",(function(){this.header="",this.value="",this.$eq=function(t){return this.header===t.header&&this.value===t.value},this.$assign=function(t){return this.header=t.header,this.value=t.value,this}})),rtl.createClass(this,"TRESTClient",pas.Classes.TComponent,(function(){this.$init=function(){pas.Classes.TComponent.$init.call(this),this.FAccessToken="",this.FOnAccessToken=null,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.$final=function(){this.FOnAccessToken=void 0,this.FOnResponse=void 0,this.FPersistTokens=void 0,this.FOnHttpResponse=void 0,this.FApp=void 0,this.FScopes=void 0,this.FOnRequestResponse=void 0,this.FOnError=void 0,pas.Classes.TComponent.$final.call(this)},this.SetPersistTokens=function(t){this.FPersistTokens.Assign(t)},this.SetApp=function(t){this.FApp.Assign(t)},this.SetScopes=function(t){this.FScopes.Assign(t)},this.InstallCallback=function(){var t=document.createElement("script");t.innerHTML=' 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);}',document.head.appendChild(t);var e=document.createElement("script");return e.async=!0,e.defer=!0,e.type="text/javascript",document.body.appendChild(e),!0,!0},this.HttpsCommand=function(e,i,s,n,r){var o=this,l=0,a=null,h=null,u=null,d=null;if(h=this.FOnRequestResponse,u=this.FOnResponse,d=this.FOnHttpResponse,(a=new XMLHttpRequest).addEventListener("load",rtl.createSafeCallback(null,(function(t){var e,i=!1,s=pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();return s.req=t.target,e=t.target.responseText,i=!1,null!=d&&d(o,e,{get:function(){return i},set:function(t){i=t}}),null==h||i||h(o,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(s),e),null==u||i||u(o,e),!0,!0}))),a.addEventListener("error",rtl.createSafeCallback(null,(function(t){var e=!1,s=pas["WEBLib.Controls"].TJSEventRecord.$new(),n=pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$new();if(e=!1,null!=o.FOnError&&(n.req=t.target,s.event=t,o.FOnError(o,pas["WEBLib.Controls"].TJSXMLHttpRequestRecord.$clone(n),pas["WEBLib.Controls"].TJSEventRecord.$clone(s),{get:function(){return e},set:function(t){e=t}})),!e)throw pas.SysUtils.Exception.$create("Create$1",["HTTP request error @"+i]);return!0,!0}))),a.responseType=t.THttpRequest.GetResponseType(this.FResponseType),a.open(e,i,!0),""!==n&&a.setRequestHeader("Content-Type",n),""!==this.FAccessToken&&a.setRequestHeader("Authorization","Bearer "+this.FAccessToken),rtl.length(r)>0)for(var c=0,F=rtl.length(r)-1;c<=F;c++)l=c,a.setRequestHeader(r[l].header,r[l].value);""===s?a.send(null):a.send(s)},this.Create$1=function(e){return pas.Classes.TComponent.Create$1.apply(this,arguments),this.FPersistTokens=t.TPersistTokens.$create("Create$1"),this.FApp=t.TRESTApp.$create("Create"),this.FScopes=pas.Classes.TStringList.$create("Create$1"),this.FLocale=0,this.FResponseType=0,this},this.Destroy=function(){rtl.free(this,"FApp"),rtl.free(this,"FScopes"),rtl.free(this,"FPersistTokens"),pas.Classes.TComponent.Destroy.call(this)},this.HttpsGet=function(t){this.HttpsCommand("GET",t,"","",[])};var e=this.$rtti;e.addProperty("App",2,t.$rtti.TRESTApp,"FApp","SetApp"),e.addProperty("PersistTokens",2,t.$rtti.TPersistTokens,"FPersistTokens","SetPersistTokens"),e.addProperty("ResponseType",0,t.$rtti.THTTPRequestResponseType,"FResponseType","FResponseType",{Default:t.THTTPRequestResponseType.rtDefault}),e.addProperty("Scopes",2,pas.Classes.$rtti.TStrings,"FScopes","SetScopes"),e.addProperty("OnAccessToken",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnAccessToken","FOnAccessToken"),e.addProperty("OnRequestResponse",0,pas["WEBLib.Controls"].$rtti.THTTPRequestResponseEvent,"FOnRequestResponse","FOnRequestResponse"),e.addProperty("OnResponse",0,t.$rtti.THttpResponse,"FOnResponse","FOnResponse"),e.addProperty("OnError",0,pas["WEBLib.Controls"].$rtti.THTTPErrorEvent,"FOnError","FOnError")})),t.$init=function(){t.TRESTClient.InstallCallback()}}),[]),rtl.module("WEBLib.Imaging.pngImage",["System"],(function(){"use strict";this.$init=function(){}})),rtl.module("WEBLib.Buttons",["System","Classes","SysUtils","WEBLib.Controls","Web","WEBLib.Graphics","WEBLib.StdCtrls","WEBLib.ExtCtrls","WEBLib.Forms","WEBLib.Menus"],(function(){"use strict";var t=this;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=!1,this.FFlat=!1,this.FGroupIndex=0,this.FAllowAllUp=!1,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=void 0,pas["WEBLib.Menus"].TWebCustomControl.$final.call(this)},this.SetMaterialGlyph=function(t){this.FMaterialGlyph!==t&&(this.FMaterialGlyph=t,this.UpdateElement())},this.SetColorEx=function(t){this.FColor$1!==t&&(this.FColor$1=t,this.FIntColor=t,this.UpdateElement())},this.SetIntColor=function(t){this.FIntColor!==t&&(this.FIntColor=t,this.UpdateElement())},this.SetGroupIndex=function(t){this.FGroupIndex=t},this.SetDown=function(t){this.FDown!==t&&(this.FDown=t,this.UpdateElement())},this.SetFlat=function(t){this.FFlat!==t&&(this.FFlat=t,this.RecreateElement())},this.SetGlyph=function(t){this.FGlyph.Assign(t),this.UpdateElement()},this.SetGlyphURL=function(t){this.FGlyphURL!==t&&(this.FGlyphURL=t,this.RecreateElement())},this.SetMaterialGlyphSize=function(t){t>0&&t<100&&(this.FMaterialGlyphSize=t,this.UpdateElement())},this.SetMaterialGyphColor=function(t){this.FMaterialGlyphColor!==t&&(this.FMaterialGlyphColor=t,this.UpdateElement())},this.SetMaterialGlyphType=function(t){this.FMaterialGlyphType!==t&&(this.FMaterialGlyphType=t,this.UpdateElement())},this.SetGlyphSize=function(t){this.FGlyphSize!==t&&(this.FGlyphSize=t,this.UpdateElement())},this.SetEnabled=function(t){pas["WEBLib.Controls"].TControl.SetEnabled.apply(this,arguments),this.UpdateElement()},this.SetCaption=function(t){this.FCaption!==t&&(pas["WEBLib.Controls"].TCustomControl.SetCaption.call(this,t),this.UpdateElement())},this.CreateElement=function(){return this.FFlat?document.createElement("SPAN"):document.createElement("BUTTON")},this.UpdateElement=function(){var t="",e="",i="",s="",n="",r="",o="",l="",a="";if(pas["WEBLib.Controls"].TControl.UpdateElement.call(this),this.IsUpdating()||""===this.FMaterialGlyph||this.AddControlLink("googlematerial","https://fonts.googleapis.com/icon?family=Material+Icons"),null!=this.GetElementHandle()){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.FFlat&&this.FVisible&&(this.GetElementHandle().style.setProperty("display","flex"),this.GetElementHandle().style.setProperty("justify-content","center")),t="",e="",i="",this.FEnabled||(e=" md-light md-inactive"),i="pointer-events:none",""!==this.FMaterialGlyph&&(o="",-1!==this.FMaterialGlyphColor&&(o=";color:"+pas["WEBLib.Graphics"].ColorToHTML(this.FMaterialGlyphColor)),s='<i class="'+pas["WEBLib.Controls"].GetMaterialClass(this.FMaterialGlyphType)+e+'" style="'+i+";font-size:"+pas.SysUtils.IntToStr(this.FMaterialGlyphSize)+"px"+o+'">'+this.FMaterialGlyph+"</i>"),""!==this.FGlyph.GetData()?n="data:image/jpeg;base64,"+pas["WEBLib.WebTools"].HexImageDecodeAsBase64(this.FGlyph.GetData()):""!==this.FGlyph.FFilename?n=this.FGlyph.FFilename:""!==this.FGlyphURL&&(n=this.FGlyphURL),r="",0!==this.FGlyphSize&&(r="width:"+pas.SysUtils.TIntegerHelper.ToString$1.call({p:this,get:function(){return this.p.FGlyphSize},set:function(t){this.p.FGlyphSize=t}})+"px"),""!==n&&(s='<img style="'+i+";vertical-align:middle;"+r+'" src="'+n+'">'),0!==this.GetElementHandle().childElementCount&&this.GetIsLinked()||(l=pas["WEBLib.WebTools"].ProcessAccelerator(this.FCaption,{get:function(){return a},set:function(t){a=t}})),""!==a&&this.GetElementHandle().setAttribute("accesskey",a),this.FTabStop?this.GetElementHandle().setAttribute("tabindex",pas.SysUtils.IntToStr(this.FTabOrder)):this.GetElementHandle().setAttribute("tabindex","-1");var h=this.FLayout;0===h?t='<table border="0" align="center" style="'+i+'"><tr><td style="border:none">'+s+'</td><td style="border:none">'+l+"</td></tr></table>":1===h?t='<table border="0" align="center" style="'+i+'"><tr><td style="border:none">'+l+'</td><td style="border:none">'+s+"</td></tr></table>":2===h?t='<table border="0" align="center" style="'+i+'"><tr><td style="border:none">'+s+'</td></tr><tr><td style="border:none">'+l+"</td></tr></table>":3===h&&(t='<table border="0" align="center" style="'+i+'"><tr><td style="border:none">'+l+'</td></tr><tr><td style="border:none">'+s+"</td></tr></table>"),this.GetElementHandle().innerHTML=t,pas["WEBLib.Controls"].SetHTMLElementFont(this.GetElementHandle().firstChild,this.FFont,!(""===this.FElementClassName&&0===this.FElementFont)),this.IsEnabled()?0===this.FElementFont&&""===this.FElementClassName&&(this.GetElementHandle().style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor)),4 in this.FComponentState&&this.GetElementHandle().firstChild.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor))):this.GetElementHandle().style.removeProperty("color")}},this.UpdateElementVisual=function(){var t=0;pas["WEBLib.Controls"].TCustomControl.UpdateElementVisual.call(this),null!=this.GetElementHandle()&&(-1!==(t=this.FDown?8421504:this.FIntColor)&&""===this.FElementClassName?this.GetElementHandle().style.setProperty("background-color",pas["WEBLib.Graphics"].ColorToHTML(t)):this.GetElementHandle().style.setProperty("background-color",""),null!=this.GetElementHandle().firstChild&&pas["WEBLib.Controls"].SetHTMLElementFont(this.GetElementHandle().firstChild,this.FFont,!(""===this.FElementClassName&&0===this.FElementFont)),this.IsEnabled()?0===this.FElementFont&&""===this.FElementClassName&&(this.GetElementHandle().style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor)),4 in this.FComponentState&&null!=this.GetElementHandle().firstChild&&this.GetElementHandle().firstChild.style.setProperty("color",pas["WEBLib.Graphics"].ColorToHTML(this.FFont.FColor))):this.GetElementHandle().style.removeProperty("color"))},this.UpdateGroup=function(){var e=0;if(null!=this.FParent)for(var i=0,s=this.FParent.GetControlsCount()-1;i<=s;i++)e=i,this.FParent.GetControls(e)!==this&&t.TSpeedButton.isPrototypeOf(this.FParent.GetControls(e))&&rtl.as(this.FParent.GetControls(e),t.TSpeedButton).FGroupIndex===this.FGroupIndex&&rtl.as(this.FParent.GetControls(e),t.TSpeedButton).SetDown(!1)},this.DoMouseLeave=function(){var t;pas["WEBLib.Controls"].TControl.DoMouseLeave.call(this),null!=(t=pas["WEBLib.Forms"].GetParentForm(this))&&1===t.FCSSLibrary&&this.FShowHint&&""!==this.FHint||this.SetIntColor(this.FColor$1)},this.DoMouseEnter=function(){var t;pas["WEBLib.Controls"].TControl.DoMouseEnter.call(this),null!=(t=pas["WEBLib.Forms"].GetParentForm(this))&&1===t.FCSSLibrary&&this.FShowHint&&""!==this.FHint||this.FEnabled&&this.SetIntColor(12632256)},this.MouseUp=function(t,e,i,s){pas["WEBLib.Controls"].TControl.MouseUp.apply(this,arguments),this.FEnabled&&this.SetIntColor(12632256)},this.MouseDown=function(t,e,i,s){pas["WEBLib.Controls"].TControl.MouseDown.apply(this,arguments),this.FEnabled&&(this.SetIntColor(8421504),this.FGroupIndex>0&&(this.FDown&&this.FAllowAllUp?this.SetDown(!1):(this.SetDown(!0),this.UpdateGroup())))},this.GlyphChanged=function(t){this.UpdateElement()},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=!1,this.FFlat=!1,this.FGlyph=pas["WEBLib.Graphics"].TURLPicture.$create("Create"),this.FGlyph.FOnChange=rtl.createCallback(this,"GlyphChanged"),this.FGlyph.FOnDataChange=rtl.createCallback(this,"GlyphChanged"),this.FLayout=0,this.FMaterialGlyphSize=18,this.FMaterialGlyphColor=-1,this.FMaterialGlyphType=0},this.CanFocus=function(){return!1,!1}})),rtl.createClass(this,"TSpeedButton",this.TCustomSpeedButton,(function(){var e=this.$rtti;e.addProperty("Align",2,pas["WEBLib.Controls"].$rtti.TAlign,"FAlign","SetAlign",{Default:pas["WEBLib.Controls"].TAlign.alNone}),e.addProperty("AlignWithMargins",2,rtl.boolean,"FAlignWithMargins","SetAlignWithMargins",{Default:!1}),e.addProperty("Anchors",2,pas["WEBLib.Controls"].$rtti.TAnchors,"FAnchors","SetAnchors",{Default:rtl.createSet(0,1)}),e.addProperty("AllowAllUp",0,rtl.boolean,"FAllowAllUp","FAllowAllUp"),e.addProperty("Caption",2,rtl.string,"FCaption","SetCaption"),e.addProperty("Color",2,pas["WEBLib.Graphics"].$rtti.TColor,"FColor$1","SetColorEx",{Default:-1}),e.addProperty("Down",2,rtl.boolean,"FDown","SetDown"),e.addProperty("ElementClassName",2,pas["WEBLib.Controls"].$rtti.TElementClassName,"FElementClassName","SetElementClassName"),e.addProperty("ElementID",3,pas["WEBLib.Controls"].$rtti.TElementID,"GetID","SetID"),e.addProperty("ElementFont",2,pas["WEBLib.Controls"].$rtti.TElementFont,"FElementFont","SetElementFont",{Default:pas["WEBLib.Controls"].TElementFont.efProperty}),e.addProperty("ElementPosition",2,pas["WEBLib.Controls"].$rtti.TElementPosition,"FElementPosition","SetElementPosition",{Default:pas["WEBLib.Controls"].TElementPosition.epAbsolute}),e.addProperty("Enabled",2,rtl.boolean,"FEnabled","SetEnabled",{Default:!0}),e.addProperty("Flat",2,rtl.boolean,"FFlat","SetFlat",{Default:!1}),e.addProperty("Font",2,pas["WEBLib.Graphics"].$rtti.TFont,"FFont","SetFont"),e.addProperty("Glyph",2,pas["WEBLib.Graphics"].$rtti.TURLPicture,"FGlyph","SetGlyph"),e.addProperty("GlyphURL",2,rtl.string,"FGlyphURL","SetGlyphURL"),e.addProperty("GlyphSize",2,rtl.longint,"FGlyphSize","SetGlyphSize",{Default:0}),e.addProperty("GroupIndex",2,rtl.longint,"FGroupIndex","SetGroupIndex"),e.addProperty("Height",3,rtl.longint,"GetHeight","SetHeight"),e.addProperty("HeightPercent",2,rtl.double,"FHeightPercent","SetHeightPercent",{Default:100}),e.addProperty("HeightStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FHeightStyle","SetHeightStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),e.addProperty("Hint",2,rtl.string,"FHint","SetHint"),e.addProperty("Layout",0,t.$rtti.TButtonLayout,"FLayout","FLayout",{Default:t.TButtonLayout.blGlyphLeft}),e.addProperty("Margins",2,pas["WEBLib.Controls"].$rtti.TMargins,"FMargins","SetMargins"),e.addProperty("MaterialGlyph",2,rtl.string,"FMaterialGlyph","SetMaterialGlyph"),e.addProperty("MaterialGlyphColor",2,pas["WEBLib.Graphics"].$rtti.TColor,"FMaterialGlyphColor","SetMaterialGyphColor",{Default:-1}),e.addProperty("MaterialGlyphSize",2,rtl.longint,"FMaterialGlyphSize","SetMaterialGlyphSize",{Default:18}),e.addProperty("MaterialGlyphType",2,pas["WEBLib.Controls"].$rtti.TMaterialGlyphType,"FMaterialGlyphType","SetMaterialGlyphType",{Default:pas["WEBLib.Controls"].TMaterialGlyphType.mgNormal}),e.addProperty("ParentFont",2,rtl.boolean,"FParentFont","SetParentFont",{Default:!0}),e.addProperty("PopupMenu",0,pas["WEBLib.Menus"].$rtti.TPopupMenu,"FPopupMenu","FPopupMenu"),e.addProperty("ShowHint",2,rtl.boolean,"FShowHint","SetShowHint",{Default:!1}),e.addProperty("TabOrder",2,rtl.longint,"FTabOrder","SetTabOrder"),e.addProperty("TabStop",2,rtl.boolean,"FTabStop","SetTabStop",{Default:!0}),e.addProperty("Visible",2,rtl.boolean,"FVisible","SetVisible",{Default:!0}),e.addProperty("Width",3,rtl.longint,"GetWidth","SetWidth"),e.addProperty("WidthPercent",2,rtl.double,"FWidthPercent","SetWidthPercent",{Default:100}),e.addProperty("WidthStyle",2,pas["WEBLib.Controls"].$rtti.TSizeStyle,"FWidthStyle","SetWidthStyle",{Default:pas["WEBLib.Controls"].TSizeStyle.ssAbsolute}),e.addProperty("OnClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnClick","FOnClick"),e.addProperty("OnDblClick",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnDblClick","FOnDblClick"),e.addProperty("OnKeyDown",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyDown","FOnKeyDown"),e.addProperty("OnKeyPress",0,pas["WEBLib.Controls"].$rtti.TKeyPressEvent,"FOnKeyPress","FOnKeyPress"),e.addProperty("OnKeyUp",0,pas["WEBLib.Controls"].$rtti.TKeyEvent,"FOnKeyUp","FOnKeyUp"),e.addProperty("OnMouseDown",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseDown","FOnMouseDown"),e.addProperty("OnMouseUp",0,pas["WEBLib.Controls"].$rtti.TMouseEvent,"FOnMouseUp","FOnMouseUp"),e.addProperty("OnMouseMove",0,pas["WEBLib.Controls"].$rtti.TMouseMoveEvent,"FOnMouseMove","FOnMouseMove"),e.addProperty("OnMouseLeave",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseLeave","FOnMouseLeave"),e.addProperty("OnMouseEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnMouseEnter","FOnMouseEnter"),e.addProperty("OnEnter",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnEnter","FOnEnter"),e.addProperty("OnExit",0,pas["WEBLib.Controls"].$rtti.TNotifyEvent,"FOnExit","FOnExit")}))}),["WEBLib.WebTools","Math"]),rtl.module("Main",["System","SysUtils","Classes","JS","Web","WEBLib.Graphics","WEBLib.Controls","WEBLib.Forms","WEBLib.Dialogs","WEBLib.Controls","WEBLib.ExtCtrls","WEBLib.Grids","WEBLib.Grids","WEBLib.StdCtrls","WEBLib.StdCtrls","WEBLib.REST","WEBLib.JSON","WEBLib.Imaging.pngImage","WEBLib.Buttons","WEBLib.WebTools"],(function(){"use strict";var t=this;rtl.createClass(this,"TForm1",pas["WEBLib.Forms"].TForm,(function(){this.$init=function(){pas["WEBLib.Forms"].TForm.$init.call(this),this.pPodatoci=null,this.grdProducts=null,this.lblPoslAzur=null,this.lblDatum=null,this.cbProdavnici=null,this.lblIzborProd=null,this.pBottom=null,this.pLeft=null,this.pTop=null,this.lblNaslov=null,this.WebRESTClient1=null,this.btnPrebaraj=null,this.pNavigator=null,this.btnFirst=null,this.btnPrevious=null,this.btnNext=null,this.btnLast=null,this.lblBrojStrana=null,this.eStrana=null,this.lblStrana=null,this.WebRESTClient2=null,this.pBottom1=null,this.lblFilter=null,this.pBotRight=null,this.lblPrikazPoStrana=null,this.cbPrikazPoStrana=null,this.eFilter=null,this.lblFiltriranPrikaz=null,this.WRClient=null,this.WRClient1=null,this.WRClient2=null,this.WRClient3=null,this.sopstvenik="",this.firma="",this.sifra="",this.strana="",this.filter="",this.stranaPresmetana=0},this.$final=function(){this.pPodatoci=void 0,this.grdProducts=void 0,this.lblPoslAzur=void 0,this.lblDatum=void 0,this.cbProdavnici=void 0,this.lblIzborProd=void 0,this.pBottom=void 0,this.pLeft=void 0,this.pTop=void 0,this.lblNaslov=void 0,this.WebRESTClient1=void 0,this.btnPrebaraj=void 0,this.pNavigator=void 0,this.btnFirst=void 0,this.btnPrevious=void 0,this.btnNext=void 0,this.btnLast=void 0,this.lblBrojStrana=void 0,this.eStrana=void 0,this.lblStrana=void 0,this.WebRESTClient2=void 0,this.pBottom1=void 0,this.lblFilter=void 0,this.pBotRight=void 0,this.lblPrikazPoStrana=void 0,this.cbPrikazPoStrana=void 0,this.eFilter=void 0,this.lblFiltriranPrikaz=void 0,this.WRClient=void 0,this.WRClient1=void 0,this.WRClient2=void 0,this.WRClient3=void 0,pas["WEBLib.Forms"].TForm.$final.call(this)},this.WebFormShow=function(e){this.grdProducts.SetVisible(!1),this.pBottom1.SetVisible(!1),this.pNavigator.SetVisible(!1),this.lblFiltriranPrikaz.SetVisible(!1),this.strana="1",this.WRClient.HttpsGet(t.URL+"GetStores/"+this.sopstvenik+"/"+this.firma+"/"+this.sifra)},this.WebRESTClient1Response=function(t,e){},this.GetStoresResponse=function(t,e){var i=null,s=null,n=null,r=null,o=null,l=0,a="";i=pas["WEBLib.JSON"].TJSONObject.$create("Create$2");try{if(null!=(i=rtl.as(pas["WEBLib.JSON"].TJSONObject.ParseJSONValue(e),pas["WEBLib.JSON"].TJSONObject))&&(s=rtl.as(i.GetValue$1("result"),pas["WEBLib.JSON"].TJSONArray)).GetCount()>0&&pas["WEBLib.JSON"].TJSONArray.isPrototypeOf(s.GetItem(0))){n=rtl.as(s.GetItem(0),pas["WEBLib.JSON"].TJSONArray),this.cbProdavnici.FItems.Clear(),this.cbProdavnici.SetItemIndex(-1);for(var h=0,u=n.GetCount()-1;h<=u;h++)l=h,o=rtl.as(n.GetItem(l),pas["WEBLib.JSON"].TJSONObject),r=pas["WEBLib.JSON"].TJSONObject.ParseJSONValue(o.ToString()),pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(r)&&(i=rtl.as(r,pas["WEBLib.JSON"].TJSONObject),pas["WEBLib.JSON"].TJSONString.isPrototypeOf(i.GetValue$1("nazivProd"))&&(a=i.GetValue$1("nazivProd").GetStrValue()),this.cbProdavnici.FItems.Add(a),this.cbProdavnici.FItems.PutObject(l,i))}}finally{}this.cbProdavnici.FItems.GetCount()>0&&(this.cbProdavnici.SetItemIndex(0),this.cbProdavniciChange(this))},this.GetProductsResponse=function(t,e){var i=null,s=null,n=0,r="";i=pas["WEBLib.JSON"].TJSONObject.$create("Create$2");try{if(null!=(i=rtl.as(pas["WEBLib.JSON"].TJSONObject.ParseJSONValue(e),pas["WEBLib.JSON"].TJSONObject))){s=rtl.as(i.GetValue$1("result"),pas["WEBLib.JSON"].TJSONArray),(s=rtl.as(s.GetItem(0),pas["WEBLib.JSON"].TJSONArray)).GetCount()>0?(r=(i=rtl.as(s.GetItem(0),pas["WEBLib.JSON"].TJSONObject)).GetValue$1("RecNo").GetStrValue(),i=rtl.as(s.GetItem(1),pas["WEBLib.JSON"].TJSONObject),s=rtl.as(i.GetValue$1("Podatoci"),pas["WEBLib.JSON"].TJSONArray),this.grdProducts.LoadFromJSON$1(JSON.parse(s.ToString()),"")):(this.strana="0",this.grdProducts.SetRowCount(1)),this.grdProducts.SetCells(0,0,"Назив на стока/производ"),this.grdProducts.SetCells(1,0,"Продажна цена"),this.grdProducts.SetCells(2,0,"Единечна цена"),this.grdProducts.SetCells(3,0,"Опис на стока"),this.grdProducts.SetCells(4,0,"Достапност"),this.grdProducts.SetCells(5,0,"Редовна цена"),this.grdProducts.SetCells(6,0,"Цена со попуст"),this.grdProducts.SetCells(7,0,"Вид поттик"),this.grdProducts.SetCells(8,0,"Времетраење");for(var o=0,l=this.grdProducts.FColCount-1;o<=l;o++)n=o,this.SrediKolona(n);this.stranaPresmetana=rtl.trunc(pas.SysUtils.StrToIntDef(r,0)/pas.SysUtils.StrToInt(this.cbPrikazPoStrana.GetText())),pas.SysUtils.StrToIntDef(r,0)%pas.SysUtils.StrToInt(this.cbPrikazPoStrana.GetText())>0&&(this.stranaPresmetana=this.stranaPresmetana+1),this.lblBrojStrana.SetCaption(this.strana+" / "+pas.SysUtils.IntToStr(this.stranaPresmetana)),this.btnFirst.SetEnabled(1!==pas.SysUtils.StrToInt(this.strana)),this.btnPrevious.SetEnabled(1!==pas.SysUtils.StrToInt(this.strana)),this.btnNext.SetEnabled(this.stranaPresmetana!==pas.SysUtils.StrToInt(this.strana)),this.btnLast.SetEnabled(this.stranaPresmetana!==pas.SysUtils.StrToInt(this.strana))}}finally{pas.SysUtils.FreeAndNil({get:function(){return i},set:function(t){i=t}})}},this.GetDateAndTimeResponse=function(t,e){var i=null,s=null,n=null;i=pas["WEBLib.JSON"].TJSONObject.$create("Create$2");try{null!=(i=rtl.as(pas["WEBLib.JSON"].TJSONObject.ParseJSONValue(e),pas["WEBLib.JSON"].TJSONObject))&&(s=rtl.as(i.GetValue$1("result"),pas["WEBLib.JSON"].TJSONArray),s=rtl.as(s.GetItem(0),pas["WEBLib.JSON"].TJSONArray),i=rtl.as(s.GetItem(0),pas["WEBLib.JSON"].TJSONObject),n=pas["WEBLib.JSON"].TJSONObject.ParseJSONValue(i.ToString()),pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(n)&&(i=rtl.as(n,pas["WEBLib.JSON"].TJSONObject),pas["WEBLib.JSON"].TJSONString.isPrototypeOf(i.GetValue$1("DatumIVreme"))&&this.lblDatum.SetCaption(i.GetValue$1("DatumIVreme").GetStrValue())))}finally{pas.SysUtils.FreeAndNil({get:function(){return i},set:function(t){i=t}})}},this.GetStoreNameResponse=function(t,e){},this.cbProdavniciChange=function(t){pas["WEBLib.JSON"].TJSONString.isPrototypeOf(rtl.as(this.cbProdavnici.FItems.GetObject(this.cbProdavnici.GetItemIndex()),pas["WEBLib.JSON"].TJSONObject).GetValue$1("sifraProd"))&&(this.sifra=rtl.as(this.cbProdavnici.FItems.GetObject(this.cbProdavnici.GetItemIndex()),pas["WEBLib.JSON"].TJSONObject).GetValue$1("sifraProd").GetStrValue()),pas["WEBLib.JSON"].TJSONString.isPrototypeOf(rtl.as(this.cbProdavnici.FItems.GetObject(this.cbProdavnici.GetItemIndex()),pas["WEBLib.JSON"].TJSONObject).GetValue$1("DatumIVreme"))&&this.lblDatum.SetCaption(rtl.as(this.cbProdavnici.FItems.GetObject(this.cbProdavnici.GetItemIndex()),pas["WEBLib.JSON"].TJSONObject).GetValue$1("DatumIVreme").GetStrValue()),this.strana="1",this.eStrana.SetText(""),this.filter="",this.eFilter.SetText(""),this.btnPrebaraj.SetColor(15527167)},this.btnPrebarajClick=function(e){var i;0===pas.SysUtils.StrToInt(this.strana)&&(this.strana="1"),i=this.cbPrikazPoStrana.GetText(),this.lblFiltriranPrikaz.SetVisible(""!==this.filter),this.WRClient1.HttpsGet(t.URL+"GetProducts/"+this.sopstvenik+"/"+this.firma+"/"+this.sifra+"/"+this.filter+"/"+this.strana+"/"+i),this.btnPrebaraj.SetColor(-1),this.grdProducts.SetVisible(!0),this.pBottom1.SetVisible(!0),this.pNavigator.SetVisible(!0)},this.cbPrikazPoStranaChange=function(t){this.btnPrebaraj.SetColor(15527167),this.btnPrebarajClick(t)},this.btnNextClick=function(t){this.strana=pas.SysUtils.IntToStr(pas.SysUtils.StrToInt(this.strana)+1),this.btnPrebarajClick(t)},this.btnPreviousClick=function(t){this.strana=pas.SysUtils.IntToStr(pas.SysUtils.StrToInt(this.strana)-1),this.btnPrebarajClick(t)},this.btnFirstClick=function(t){this.strana="1",this.btnPrebarajClick(t)},this.btnLastClick=function(t){this.strana=pas.SysUtils.IntToStr(this.stranaPresmetana),this.btnPrebarajClick(t)},this.eStranaKeyDown=function(t,e,i){13===e.get()&&""!==this.eStrana.GetText()&&pas.SysUtils.StrToIntDef(this.eStrana.GetText(),0)>=1&&pas.SysUtils.StrToIntDef(this.eStrana.GetText(),0)<=this.stranaPresmetana&&(this.strana=this.eStrana.GetText(),this.btnPrebarajClick(t))},this.eStranaExit=function(t){""!==this.eStrana.GetText()&&pas.SysUtils.StrToIntDef(this.eStrana.GetText(),0)>=1&&pas.SysUtils.StrToIntDef(this.eStrana.GetText(),0)<=this.stranaPresmetana&&(this.strana=this.eStrana.GetText())},this.eFilterExit=function(t){this.filter=this.eFilter.GetText()},this.eFilterKeyDown=function(t,e,i){13===e.get()&&(this.filter=this.eFilter.GetText(),this.btnPrebarajClick(t))},this.WebFormCreate=function(t){window.document.title="WEB Ценовник",this.sopstvenik=window.atob(this.GetQueryParam("p1")),this.firma=window.atob(this.GetQueryParam("p2")),this.sifra=window.atob(this.GetQueryParam("p3")),this.WRClient=pas["WEBLib.REST"].TRESTClient.$create("Create$1",[this]),this.WRClient1=pas["WEBLib.REST"].TRESTClient.$create("Create$1",[this]),this.WRClient2=pas["WEBLib.REST"].TRESTClient.$create("Create$1",[this]),this.WRClient3=pas["WEBLib.REST"].TRESTClient.$create("Create$1",[this]),this.WRClient.FOnResponse=rtl.createCallback(this,"GetStoresResponse"),this.WRClient1.FOnResponse=rtl.createCallback(this,"GetProductsResponse"),this.WRClient2.FOnResponse=rtl.createCallback(this,"GetDateAndTimeResponse"),this.WRClient3.FOnResponse=rtl.createCallback(this,"GetStoreNameResponse")},this.WebRESTClient2Response=function(t,e){var i=null,s=null,n=null;i=pas["WEBLib.JSON"].TJSONObject.$create("Create$2");try{null!=(i=rtl.as(pas["WEBLib.JSON"].TJSONObject.ParseJSONValue(e),pas["WEBLib.JSON"].TJSONObject))&&(s=rtl.as(i.GetValue$1("result"),pas["WEBLib.JSON"].TJSONArray),s=rtl.as(s.GetItem(0),pas["WEBLib.JSON"].TJSONArray),i=rtl.as(s.GetItem(0),pas["WEBLib.JSON"].TJSONObject),n=pas["WEBLib.JSON"].TJSONObject.ParseJSONValue(i.ToString()),pas["WEBLib.JSON"].TJSONObject.isPrototypeOf(n)&&(i=rtl.as(n,pas["WEBLib.JSON"].TJSONObject),pas["WEBLib.JSON"].TJSONString.isPrototypeOf(i.GetValue$1("DatumIVreme"))&&this.lblDatum.SetCaption(i.GetValue$1("DatumIVreme").GetStrValue())))}finally{pas.SysUtils.FreeAndNil({get:function(){return i},set:function(t){i=t}})}},this.WebFormClose=function(t,e){rtl.free(this,"WRClient"),rtl.free(this,"WRClient1"),rtl.free(this,"WRClient2"),rtl.free(this,"WRClient3")},this.SrediKolona=function(t){var e=0,i=0,s=0;i=0;for(var n=0,r=this.grdProducts.FRowCount-1;n<=r;n++)e=n,(s=this.MeasureTextWidth(this.grdProducts.GetCells(t,e),this.grdProducts.FFont.FName)+20)>i&&(i=Math.round(s));this.grdProducts.SetColWidths(t,i),t in rtl.createSet(1,2,5)&&this.grdProducts.SetColAlignments(t,1),t in rtl.createSet(4)&&this.grdProducts.SetColAlignments(t,2),this.CenterHeader()},this.CenterHeader=function(){for(var t=0,e=0,i=this.grdProducts.FColCount-1;e<=i;e++)t=e,this.grdProducts.GetCellElements(t,0).style.setProperty("text-align","center")},this.MeasureTextWidth=function(t,e){return 7*pas.SysUtils.TStringHelper.GetLength.call({get:function(){return t},set:function(t){rtl.raiseE("EPropReadOnly")}})},this.GetQueryParam=function(t){var e,i="",s="",n="";i="",(s=pas.JS.ToString(window.location.search)).length>1&&pas.System.Delete({get:function(){return s},set:function(t){s=t}},1,1);for(var r=0,o=(e=s.split("&")).length-1;r<=o;r++)if(n=""+e[r],1===pas.System.Pos(t+"=",n))return i=pas.System.Copy(n,t.length+2,2147483647);return i},this.LoadDFMValues=function(){pas["WEBLib.Forms"].TCustomForm.LoadDFMValues.call(this),this.pPodatoci=pas["WEBLib.ExtCtrls"].TPanel.$create("Create$1",[this]),this.pBottom=pas["WEBLib.ExtCtrls"].TPanel.$create("Create$1",[this]),this.lblPoslAzur=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.lblDatum=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.pLeft=pas["WEBLib.ExtCtrls"].TPanel.$create("Create$1",[this]),this.lblIzborProd=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.cbProdavnici=pas["WEBLib.StdCtrls"].TComboBox.$create("Create$1",[this]),this.btnPrebaraj=pas["WEBLib.StdCtrls"].TButton.$create("Create$1",[this]),this.pTop=pas["WEBLib.ExtCtrls"].TPanel.$create("Create$1",[this]),this.lblNaslov=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.grdProducts=pas["WEBLib.Grids"].TStringGrid.$create("Create$1",[this]),this.pNavigator=pas["WEBLib.ExtCtrls"].TPanel.$create("Create$1",[this]),this.lblBrojStrana=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.lblStrana=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.lblFiltriranPrikaz=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.btnFirst=pas["WEBLib.Buttons"].TSpeedButton.$create("Create$1",[this]),this.btnPrevious=pas["WEBLib.Buttons"].TSpeedButton.$create("Create$1",[this]),this.btnNext=pas["WEBLib.Buttons"].TSpeedButton.$create("Create$1",[this]),this.btnLast=pas["WEBLib.Buttons"].TSpeedButton.$create("Create$1",[this]),this.eStrana=pas["WEBLib.StdCtrls"].TEdit.$create("Create$1",[this]),this.pBottom1=pas["WEBLib.ExtCtrls"].TPanel.$create("Create$1",[this]),this.lblFilter=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.pBotRight=pas["WEBLib.ExtCtrls"].TPanel.$create("Create$1",[this]),this.lblPrikazPoStrana=pas["WEBLib.StdCtrls"].TLabel.$create("Create$1",[this]),this.cbPrikazPoStrana=pas["WEBLib.StdCtrls"].TComboBox.$create("Create$1",[this]),this.eFilter=pas["WEBLib.StdCtrls"].TEdit.$create("Create$1",[this]),this.WebRESTClient1=pas["WEBLib.REST"].TRESTClient.$create("Create$1",[this]),this.WebRESTClient2=pas["WEBLib.REST"].TRESTClient.$create("Create$1",[this]),this.pPodatoci.BeforeLoadDFMValues(),this.pBottom.BeforeLoadDFMValues(),this.lblPoslAzur.BeforeLoadDFMValues(),this.lblDatum.BeforeLoadDFMValues(),this.pLeft.BeforeLoadDFMValues(),this.lblIzborProd.BeforeLoadDFMValues(),this.cbProdavnici.BeforeLoadDFMValues(),this.btnPrebaraj.BeforeLoadDFMValues(),this.pTop.BeforeLoadDFMValues(),this.lblNaslov.BeforeLoadDFMValues(),this.grdProducts.BeforeLoadDFMValues(),this.pNavigator.BeforeLoadDFMValues(),this.lblBrojStrana.BeforeLoadDFMValues(),this.lblStrana.BeforeLoadDFMValues(),this.lblFiltriranPrikaz.BeforeLoadDFMValues(),this.btnFirst.BeforeLoadDFMValues(),this.btnPrevious.BeforeLoadDFMValues(),this.btnNext.BeforeLoadDFMValues(),this.btnLast.BeforeLoadDFMValues(),this.eStrana.BeforeLoadDFMValues(),this.pBottom1.BeforeLoadDFMValues(),this.lblFilter.BeforeLoadDFMValues(),this.pBotRight.BeforeLoadDFMValues(),this.lblPrikazPoStrana.BeforeLoadDFMValues(),this.cbPrikazPoStrana.BeforeLoadDFMValues(),this.eFilter.BeforeLoadDFMValues(),this.WebRESTClient1.BeforeLoadDFMValues(),this.WebRESTClient2.BeforeLoadDFMValues();try{this.SetName("Form1"),this.SetWidth(1107),this.SetHeight(699),this.FFont.FCharset=1,this.FFont.SetColor(65793),this.FFont.SetHeight(-13),this.FFont.SetName("Segoe UI"),this.FFont.SetStyle({}),this.SetParentFont(!1),this.SetEvent(this,"OnClose","WebFormClose"),this.SetEvent(this,"OnCreate","WebFormCreate"),this.SetEvent(this,"OnShow","WebFormShow"),this.pPodatoci.SetParentComponent(this),this.pPodatoci.SetName("pPodatoci"),this.pPodatoci.SetLeft(0),this.pPodatoci.SetTop(0),this.pPodatoci.SetWidth(1107),this.pPodatoci.SetHeight(130),this.pPodatoci.FMargins.SetBottom(5),this.pPodatoci.SetAlign(1),this.pPodatoci.SetBorderStyle(0),this.pBottom.SetParentComponent(this.pPodatoci),this.pBottom.SetName("pBottom"),this.pBottom.SetLeft(0),this.pBottom.SetTop(101),this.pBottom.SetWidth(1107),this.pBottom.SetHeight(29),this.pBottom.SetAlign(2),this.pBottom.SetBorderColor(-1),this.pBottom.SetBorderStyle(0),this.pBottom.SetChildOrderEx(5),this.lblPoslAzur.SetParentComponent(this.pBottom),this.lblPoslAzur.SetName("lblPoslAzur"),this.lblPoslAzur.SetAlignWithMargins(!0),this.lblPoslAzur.SetLeft(10),this.lblPoslAzur.SetTop(3),this.lblPoslAzur.SetWidth(140),this.lblPoslAzur.SetHeight(23),this.lblPoslAzur.FMargins.SetLeft(10),this.lblPoslAzur.SetAlign(3),this.lblPoslAzur.SetAutoSize(!1),this.lblPoslAzur.SetCaption("Последно ажурирање: "),this.lblPoslAzur.FFont.FCharset=1,this.lblPoslAzur.FFont.SetColor(65793),this.lblPoslAzur.FFont.SetHeight(-13),this.lblPoslAzur.FFont.SetName("Segoe UI"),this.lblPoslAzur.FFont.SetStyle({}),this.lblPoslAzur.SetHeightPercent(100),this.lblPoslAzur.SetLayout(1),this.lblPoslAzur.SetParentFont(!1),this.lblPoslAzur.SetWidthPercent(100),this.lblDatum.SetParentComponent(this.pBottom),this.lblDatum.SetName("lblDatum"),this.lblDatum.SetAlignWithMargins(!0),this.lblDatum.SetLeft(156),this.lblDatum.SetTop(3),this.lblDatum.SetWidth(165),this.lblDatum.SetHeight(23),this.lblDatum.SetAlign(3),this.lblDatum.SetAutoSize(!1),this.lblDatum.SetCaption("31/12/1899 00:00:00"),this.lblDatum.FFont.FCharset=1,this.lblDatum.FFont.SetColor(65793),this.lblDatum.FFont.SetHeight(-13),this.lblDatum.FFont.SetName("Segoe UI"),this.lblDatum.FFont.SetStyle({}),this.lblDatum.SetHeightPercent(100),this.lblDatum.SetLayout(1),this.lblDatum.SetParentFont(!1),this.lblDatum.SetWidthPercent(100),this.pLeft.SetParentComponent(this.pPodatoci),this.pLeft.SetName("pLeft"),this.pLeft.SetLeft(0),this.pLeft.SetTop(45),this.pLeft.SetWidth(433),this.pLeft.SetHeight(56),this.pLeft.SetAlign(3),this.pLeft.SetBorderStyle(0),this.pLeft.SetChildOrderEx(4),this.lblIzborProd.SetParentComponent(this.pLeft),this.lblIzborProd.SetName("lblIzborProd"),this.lblIzborProd.SetLeft(10),this.lblIzborProd.SetTop(2),this.lblIzborProd.SetWidth(138),this.lblIzborProd.SetHeight(17),this.lblIzborProd.SetCaption("Одберете продавница:"),this.lblIzborProd.FFont.FCharset=1,this.lblIzborProd.FFont.SetColor(65793),this.lblIzborProd.FFont.SetHeight(-13),this.lblIzborProd.FFont.SetName("Segoe UI"),this.lblIzborProd.FFont.SetStyle({}),this.lblIzborProd.SetHeightPercent(100),this.lblIzborProd.SetParentFont(!1),this.lblIzborProd.SetWidthPercent(100),this.cbProdavnici.SetParentComponent(this.pLeft),this.cbProdavnici.SetName("cbProdavnici"),this.cbProdavnici.SetLeft(10),this.cbProdavnici.SetTop(23),this.cbProdavnici.SetWidth(259),this.cbProdavnici.SetHeight(25),this.cbProdavnici.SetHeightPercent(100),this.cbProdavnici.SetWidthPercent(100),this.SetEvent$1(this.cbProdavnici,this,"OnChange","cbProdavniciChange"),this.cbProdavnici.SetItemIndex(-1),this.btnPrebaraj.SetParentComponent(this.pLeft),this.btnPrebaraj.SetName("btnPrebaraj"),this.btnPrebaraj.SetLeft(287),this.btnPrebaraj.SetTop(6),this.btnPrebaraj.SetWidth(137),this.btnPrebaraj.SetHeight(40),this.btnPrebaraj.SetCaption("Пребарај"),this.btnPrebaraj.SetChildOrderEx(2),this.btnPrebaraj.SetHeightPercent(100),this.btnPrebaraj.SetWidthPercent(100),this.SetEvent$1(this.btnPrebaraj,this,"OnClick","btnPrebarajClick"),this.pTop.SetParentComponent(this.pPodatoci),this.pTop.SetName("pTop"),this.pTop.SetLeft(0),this.pTop.SetTop(0),this.pTop.SetWidth(1107),this.pTop.SetHeight(45),this.pTop.SetAlign(1),this.pTop.SetBorderStyle(0),this.pTop.SetChildOrderEx(3),this.lblNaslov.SetParentComponent(this.pTop),this.lblNaslov.SetName("lblNaslov"),this.lblNaslov.SetAlignWithMargins(!0),this.lblNaslov.SetLeft(3),this.lblNaslov.SetTop(3),this.lblNaslov.SetWidth(1101),this.lblNaslov.SetHeight(25),this.lblNaslov.SetAlign(1),this.lblNaslov.SetAlignment(2),this.lblNaslov.SetCaption("Табеларен приказ за цените на стоките"),this.lblNaslov.FFont.FCharset=1,this.lblNaslov.FFont.SetColor(0),this.lblNaslov.FFont.SetHeight(-19),this.lblNaslov.FFont.SetName("Segoe UI"),this.lblNaslov.FFont.SetStyle(rtl.createSet(0)),this.lblNaslov.SetHeightPercent(100),this.lblNaslov.SetParentFont(!1),this.lblNaslov.SetWidthPercent(100),this.grdProducts.SetParentComponent(this),this.grdProducts.SetName("grdProducts"),this.grdProducts.SetLeft(0),this.grdProducts.SetTop(194),this.grdProducts.SetWidth(1107),this.grdProducts.SetHeight(505),this.grdProducts.SetAlign(5),this.grdProducts.SetColCount(9),this.grdProducts.SetFixedColor(14079702),this.grdProducts.SetFixedCols(0),this.grdProducts.FOptions=rtl.createSet(0,1,2,3,4,12,18),this.grdProducts.SetTabOrder(1),this.grdProducts.FRange.FMax=100,this.grdProducts.FRange.FStep=1,this.grdProducts.SetHeightPercent(100),this.grdProducts.SetWidthPercent(100),this.pNavigator.SetParentComponent(this),this.pNavigator.SetName("pNavigator"),this.pNavigator.SetLeft(0),this.pNavigator.SetTop(162),this.pNavigator.SetWidth(1107),this.pNavigator.SetHeight(32),this.pNavigator.SetAlign(1),this.pNavigator.SetBorderStyle(0),this.pNavigator.SetChildOrderEx(2),this.lblBrojStrana.SetParentComponent(this.pNavigator),this.lblBrojStrana.SetName("lblBrojStrana"),this.lblBrojStrana.SetAlignWithMargins(!0),this.lblBrojStrana.SetLeft(10),this.lblBrojStrana.SetTop(3),this.lblBrojStrana.SetWidth(53),this.lblBrojStrana.SetHeight(26),this.lblBrojStrana.FMargins.SetLeft(10),this.lblBrojStrana.SetAlign(3),this.lblBrojStrana.SetAutoSize(!1),this.lblBrojStrana.SetCaption("0 / 0"),this.lblBrojStrana.FFont.FCharset=1,this.lblBrojStrana.FFont.SetColor(65793),this.lblBrojStrana.FFont.SetHeight(-13),this.lblBrojStrana.FFont.SetName("Segoe UI"),this.lblBrojStrana.FFont.SetStyle({}),this.lblBrojStrana.SetHeightPercent(100),this.lblBrojStrana.SetLayout(1),this.lblBrojStrana.SetParentFont(!1),this.lblBrojStrana.SetWidthPercent(100),this.lblStrana.SetParentComponent(this.pNavigator),this.lblStrana.SetName("lblStrana"),this.lblStrana.SetAlignWithMargins(!0),this.lblStrana.SetLeft(224),this.lblStrana.SetTop(7),this.lblStrana.SetWidth(45),this.lblStrana.SetHeight(17),this.lblStrana.SetCaption("Страна:"),this.lblStrana.FFont.FCharset=1,this.lblStrana.FFont.SetColor(65793),this.lblStrana.FFont.SetHeight(-13),this.lblStrana.FFont.SetName("Segoe UI"),this.lblStrana.FFont.SetStyle({}),this.lblStrana.SetHeightPercent(100),this.lblStrana.SetLayout(1),this.lblStrana.SetParentFont(!1),this.lblStrana.SetWidthPercent(100),this.lblFiltriranPrikaz.SetParentComponent(this.pNavigator),this.lblFiltriranPrikaz.SetName("lblFiltriranPrikaz"),this.lblFiltriranPrikaz.SetAlignWithMargins(!0),this.lblFiltriranPrikaz.SetLeft(322),this.lblFiltriranPrikaz.SetTop(16),this.lblFiltriranPrikaz.SetWidth(113),this.lblFiltriranPrikaz.SetHeight(16),this.lblFiltriranPrikaz.FMargins.SetLeft(5),this.lblFiltriranPrikaz.SetAnchors(rtl.createSet(0,3)),this.lblFiltriranPrikaz.SetCaption("Филтриран приказ "),this.lblFiltriranPrikaz.FFont.FCharset=1,this.lblFiltriranPrikaz.FFont.SetColor(10526880),this.lblFiltriranPrikaz.FFont.SetHeight(-13),this.lblFiltriranPrikaz.FFont.SetName("4"),this.lblFiltriranPrikaz.FFont.SetStyle({}),this.lblFiltriranPrikaz.SetHeightPercent(100),this.lblFiltriranPrikaz.SetLayout(1),this.lblFiltriranPrikaz.SetParentFont(!1),this.lblFiltriranPrikaz.SetVisible(!1),this.lblFiltriranPrikaz.SetWidthPercent(100),this.btnFirst.SetParentComponent(this.pNavigator),this.btnFirst.SetName("btnFirst"),this.btnFirst.SetLeft(62),this.btnFirst.SetTop(0),this.btnFirst.SetWidth(40),this.btnFirst.SetHeight(31),this.btnFirst.SetColorEx(-1),this.btnFirst.SetFlat(!0),this.btnFirst.FGlyph.LoadFromFile("Main.pNavigator.btnFirst.Glyph.png"),this.btnFirst.SetGlyphSize(24),this.btnFirst.SetHeightPercent(100),this.btnFirst.SetTabOrder(0),this.btnFirst.SetWidthPercent(100),this.SetEvent$1(this.btnFirst,this,"OnClick","btnFirstClick"),this.btnPrevious.SetParentComponent(this.pNavigator),this.btnPrevious.SetName("btnPrevious"),this.btnPrevious.SetLeft(101),this.btnPrevious.SetTop(0),this.btnPrevious.SetWidth(40),this.btnPrevious.SetHeight(31),this.btnPrevious.SetColorEx(-1),this.btnPrevious.SetFlat(!0),this.btnPrevious.FGlyph.LoadFromFile("Main.pNavigator.btnPrevious.Glyph.png"),this.btnPrevious.SetGlyphSize(24),this.btnPrevious.SetHeightPercent(100),this.btnPrevious.SetTabOrder(1),this.btnPrevious.SetWidthPercent(100),this.SetEvent$1(this.btnPrevious,this,"OnClick","btnPreviousClick"),this.btnNext.SetParentComponent(this.pNavigator),this.btnNext.SetName("btnNext"),this.btnNext.SetLeft(140),this.btnNext.SetTop(0),this.btnNext.SetWidth(40),this.btnNext.SetHeight(31),this.btnNext.SetColorEx(-1),this.btnNext.SetFlat(!0),this.btnNext.FGlyph.LoadFromFile("Main.pNavigator.btnNext.Glyph.png"),this.btnNext.SetGlyphSize(24),this.btnNext.SetHeightPercent(100),this.btnNext.SetTabOrder(2),this.btnNext.SetWidthPercent(100),this.SetEvent$1(this.btnNext,this,"OnClick","btnNextClick"),this.btnLast.SetParentComponent(this.pNavigator),this.btnLast.SetName("btnLast"),this.btnLast.SetLeft(179),this.btnLast.SetTop(0),this.btnLast.SetWidth(40),this.btnLast.SetHeight(31),this.btnLast.SetColorEx(-1),this.btnLast.SetFlat(!0),this.btnLast.FGlyph.LoadFromFile("Main.pNavigator.btnLast.Glyph.png"),this.btnLast.SetGlyphSize(24),this.btnLast.SetHeightPercent(100),this.btnLast.SetTabOrder(3),this.btnLast.SetWidthPercent(100),this.SetEvent$1(this.btnLast,this,"OnClick","btnLastClick"),this.eStrana.SetParentComponent(this.pNavigator),this.eStrana.SetName("eStrana"),this.eStrana.SetLeft(274),this.eStrana.SetTop(4),this.eStrana.SetWidth(42),this.eStrana.SetHeight(22),this.eStrana.SetChildOrderEx(5),this.eStrana.SetEditType(3),this.eStrana.SetHeightPercent(100),this.eStrana.SetWidthPercent(100),this.SetEvent$1(this.eStrana,this,"OnExit","eStranaExit"),this.SetEvent$1(this.eStrana,this,"OnKeyDown","eStranaKeyDown"),this.pBottom1.SetParentComponent(this),this.pBottom1.SetName("pBottom1"),this.pBottom1.SetLeft(0),this.pBottom1.SetTop(130),this.pBottom1.SetWidth(1107),this.pBottom1.SetHeight(32),this.pBottom1.SetAlign(1),this.pBottom1.SetBorderStyle(0),this.pBottom1.SetChildOrderEx(2),this.lblFilter.SetParentComponent(this.pBottom1),this.lblFilter.SetName("lblFilter"),this.lblFilter.SetAlignWithMargins(!0),this.lblFilter.SetLeft(10),this.lblFilter.SetTop(7),this.lblFilter.SetWidth(46),this.lblFilter.SetHeight(17),this.lblFilter.SetCaption("Филтер:"),this.lblFilter.FFont.FCharset=1,this.lblFilter.FFont.SetColor(65793),this.lblFilter.FFont.SetHeight(-13),this.lblFilter.FFont.SetName("Segoe UI"),this.lblFilter.FFont.SetStyle({}),this.lblFilter.SetHeightPercent(100),this.lblFilter.SetLayout(1),this.lblFilter.SetParentFont(!1),this.lblFilter.SetWidthPercent(100),this.pBotRight.SetParentComponent(this.pBottom1),this.pBotRight.SetName("pBotRight"),this.pBotRight.SetLeft(205),this.pBotRight.SetTop(0),this.pBotRight.SetWidth(230),this.pBotRight.SetHeight(32),this.pBotRight.SetBorderStyle(0),this.pBotRight.SetChildOrderEx(4),this.lblPrikazPoStrana.SetParentComponent(this.pBotRight),this.lblPrikazPoStrana.SetName("lblPrikazPoStrana"),this.lblPrikazPoStrana.SetAlignWithMargins(!0),this.lblPrikazPoStrana.SetLeft(56),this.lblPrikazPoStrana.SetTop(3),this.lblPrikazPoStrana.SetWidth(108),this.lblPrikazPoStrana.SetHeight(16),this.lblPrikazPoStrana.FMargins.SetLeft(5),this.lblPrikazPoStrana.SetAnchors(rtl.createSet(2,3)),this.lblPrikazPoStrana.SetCaption("Приказ по страна:"),this.lblPrikazPoStrana.FFont.FCharset=1,this.lblPrikazPoStrana.FFont.SetColor(65793),this.lblPrikazPoStrana.FFont.SetHeight(-13),this.lblPrikazPoStrana.FFont.SetName("4"),this.lblPrikazPoStrana.FFont.SetStyle({}),this.lblPrikazPoStrana.SetHeightPercent(100),this.lblPrikazPoStrana.SetLayout(1),this.lblPrikazPoStrana.SetParentFont(!1),this.lblPrikazPoStrana.SetWidthPercent(100),this.cbPrikazPoStrana.SetParentComponent(this.pBotRight),this.cbPrikazPoStrana.SetName("cbPrikazPoStrana"),this.cbPrikazPoStrana.SetAlignWithMargins(!0),this.cbPrikazPoStrana.SetLeft(170),this.cbPrikazPoStrana.SetTop(0),this.cbPrikazPoStrana.SetWidth(49),this.cbPrikazPoStrana.SetHeight(25),this.cbPrikazPoStrana.FMargins.SetRight(15),this.cbPrikazPoStrana.SetAnchors(rtl.createSet(2,3)),this.cbPrikazPoStrana.SetHeightPercent(100),this.cbPrikazPoStrana.SetText("25"),this.cbPrikazPoStrana.SetWidthPercent(100),this.SetEvent$1(this.cbPrikazPoStrana,this,"OnChange","cbPrikazPoStranaChange"),this.cbPrikazPoStrana.SetItemIndex(0),this.cbPrikazPoStrana.FItems.BeginUpdate();try{this.cbPrikazPoStrana.FItems.Clear(),this.cbPrikazPoStrana.FItems.Add("25"),this.cbPrikazPoStrana.FItems.Add("50"),this.cbPrikazPoStrana.FItems.Add("100")}finally{this.cbPrikazPoStrana.FItems.EndUpdate()}this.eFilter.SetParentComponent(this.pBottom1),this.eFilter.SetName("eFilter"),this.eFilter.SetLeft(62),this.eFilter.SetTop(4),this.eFilter.SetWidth(134),this.eFilter.SetHeight(22),this.eFilter.SetChildOrderEx(5),this.eFilter.SetHeightPercent(100),this.eFilter.SetWidthPercent(100),this.SetEvent$1(this.eFilter,this,"OnExit","eFilterExit"),this.SetEvent$1(this.eFilter,this,"OnKeyDown","eFilterKeyDown"),this.WebRESTClient1.SetParentComponent(this),this.WebRESTClient1.SetName("WebRESTClient1"),this.WebRESTClient1.SetLeft(912),this.WebRESTClient1.SetTop(312),this.WebRESTClient2.SetParentComponent(this),this.WebRESTClient2.SetName("WebRESTClient2"),this.WebRESTClient2.SetLeft(776),this.WebRESTClient2.SetTop(288)}finally{this.pPodatoci.AfterLoadDFMValues(),this.pBottom.AfterLoadDFMValues(),this.lblPoslAzur.AfterLoadDFMValues(),this.lblDatum.AfterLoadDFMValues(),this.pLeft.AfterLoadDFMValues(),this.lblIzborProd.AfterLoadDFMValues(),this.cbProdavnici.AfterLoadDFMValues(),this.btnPrebaraj.AfterLoadDFMValues(),this.pTop.AfterLoadDFMValues(),this.lblNaslov.AfterLoadDFMValues(),this.grdProducts.AfterLoadDFMValues(),this.pNavigator.AfterLoadDFMValues(),this.lblBrojStrana.AfterLoadDFMValues(),this.lblStrana.AfterLoadDFMValues(),this.lblFiltriranPrikaz.AfterLoadDFMValues(),this.btnFirst.AfterLoadDFMValues(),this.btnPrevious.AfterLoadDFMValues(),this.btnNext.AfterLoadDFMValues(),this.btnLast.AfterLoadDFMValues(),this.eStrana.AfterLoadDFMValues(),this.pBottom1.AfterLoadDFMValues(),this.lblFilter.AfterLoadDFMValues(),this.pBotRight.AfterLoadDFMValues(),this.lblPrikazPoStrana.AfterLoadDFMValues(),this.cbPrikazPoStrana.AfterLoadDFMValues(),this.eFilter.AfterLoadDFMValues(),this.WebRESTClient1.AfterLoadDFMValues(),this.WebRESTClient2.AfterLoadDFMValues()}};var e=this.$rtti;e.addField("pPodatoci",pas["WEBLib.ExtCtrls"].$rtti.TPanel),e.addField("grdProducts",pas["WEBLib.Grids"].$rtti.TStringGrid),e.addField("lblPoslAzur",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addField("lblDatum",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addField("cbProdavnici",pas["WEBLib.StdCtrls"].$rtti.TComboBox),e.addField("lblIzborProd",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addField("pBottom",pas["WEBLib.ExtCtrls"].$rtti.TPanel),e.addField("pLeft",pas["WEBLib.ExtCtrls"].$rtti.TPanel),e.addField("pTop",pas["WEBLib.ExtCtrls"].$rtti.TPanel),e.addField("lblNaslov",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addField("WebRESTClient1",pas["WEBLib.REST"].$rtti.TRESTClient),e.addField("btnPrebaraj",pas["WEBLib.StdCtrls"].$rtti.TButton),e.addField("pNavigator",pas["WEBLib.ExtCtrls"].$rtti.TPanel),e.addField("btnFirst",pas["WEBLib.Buttons"].$rtti.TSpeedButton),e.addField("btnPrevious",pas["WEBLib.Buttons"].$rtti.TSpeedButton),e.addField("btnNext",pas["WEBLib.Buttons"].$rtti.TSpeedButton),e.addField("btnLast",pas["WEBLib.Buttons"].$rtti.TSpeedButton),e.addField("lblBrojStrana",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addField("eStrana",pas["WEBLib.StdCtrls"].$rtti.TEdit),e.addField("lblStrana",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addField("WebRESTClient2",pas["WEBLib.REST"].$rtti.TRESTClient),e.addField("pBottom1",pas["WEBLib.ExtCtrls"].$rtti.TPanel),e.addField("lblFilter",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addField("pBotRight",pas["WEBLib.ExtCtrls"].$rtti.TPanel),e.addField("lblPrikazPoStrana",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addField("cbPrikazPoStrana",pas["WEBLib.StdCtrls"].$rtti.TComboBox),e.addField("eFilter",pas["WEBLib.StdCtrls"].$rtti.TEdit),e.addField("lblFiltriranPrikaz",pas["WEBLib.StdCtrls"].$rtti.TLabel),e.addMethod("WebFormShow",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("WebRESTClient1Response",0,[["Sender",pas.System.$rtti.TObject],["AResponse",rtl.string]]),e.addMethod("GetStoresResponse",0,[["Sender",pas.System.$rtti.TObject],["AResponse",rtl.string]]),e.addMethod("GetProductsResponse",0,[["Sender",pas.System.$rtti.TObject],["AResponse",rtl.string]]),e.addMethod("GetDateAndTimeResponse",0,[["Sender",pas.System.$rtti.TObject],["AResponse",rtl.string]]),e.addMethod("GetStoreNameResponse",0,[["Sender",pas.System.$rtti.TObject],["AResponse",rtl.string]]),e.addMethod("cbProdavniciChange",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("btnPrebarajClick",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("cbPrikazPoStranaChange",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("btnNextClick",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("btnPreviousClick",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("btnFirstClick",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("btnLastClick",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("eStranaKeyDown",0,[["Sender",pas.System.$rtti.TObject],["Key",rtl.word,1],["Shift",pas.Classes.$rtti.TShiftState]]),e.addMethod("eStranaExit",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("eFilterExit",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("eFilterKeyDown",0,[["Sender",pas.System.$rtti.TObject],["Key",rtl.word,1],["Shift",pas.Classes.$rtti.TShiftState]]),e.addMethod("WebFormCreate",0,[["Sender",pas.System.$rtti.TObject]]),e.addMethod("WebRESTClient2Response",0,[["Sender",pas.System.$rtti.TObject],["AResponse",rtl.string]]),e.addMethod("WebFormClose",0,[["Sender",pas.System.$rtti.TObject],["Action",pas["WEBLib.Forms"].$rtti.TCloseAction,1]])})),this.Form1=null,this.URL="http://82.214.112.74:9898/datasnap/rest/TServerMethods1/"})),rtl.module("program",["System","WEBLib.Forms","WEBLib.Forms","Main"],(function(){"use strict";this.$main=function(){pas["WEBLib.Forms"].Application.Initialize(),pas["WEBLib.Forms"].Application.FMainFormOnTaskBar=!0,pas["WEBLib.Forms"].Application.CreateForm(pas.Main.TForm1,{p:pas.Main,get:function(){return this.p.Form1},set:function(t){this.p.Form1=t}}),pas["WEBLib.Forms"].Application.Run()}}));