amf.js 61 KB

1
  1. var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=='function'?Object.defineProperty:function(b,c,a){a=a;if(b==Array.prototype||b==Object.prototype){return}b[c]=a.value};$jscomp.getGlobal=function(a){return typeof window!='undefined'&&window===a?a:typeof global!='undefined'&&global!=null?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(i,f,j,k){if(!f){return}var a=$jscomp.global;var b=i.split('.');for(var e=0;e<b.length-1;e++){var d=b[e];if(!(d in a)){a[d]={}}a=a[d]}var g=b[b.length-1];var h=a[g];var c=f(h);if(c==h||c==null){return}$jscomp.defineProperty(a,g,{configurable:!0,writable:!0,value:c})};$jscomp.polyfill('Array.prototype.copyWithin',function(a){if(a){return a}var b=function(d,c,b){var e=this.length;d=Number(d);c=Number(c);b=Number(b!=null?b:e);if(d<c){b=Math.min(b,e);while(c<b){if(c in this){this[d++]=this[c++]}else {delete this[d++];c++}}}else {b=Math.min(b,e+c-d);d+=b-c;while(b>c){if(--b in this){this[--d]=this[b]}else {delete this[d]}}}return this};return b},'es6','es3');$jscomp.SYMBOL_PREFIX='jscomp_symbol_';$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};if(!$jscomp.global['Symbol']){$jscomp.global['Symbol']=$jscomp.Symbol}};$jscomp.Symbol=function(){var a=0;function Symbol(b){return $jscomp.SYMBOL_PREFIX+(b||'')+a++}return Symbol}();$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global['Symbol'].iterator;if(!a){a=$jscomp.global['Symbol'].iterator=$jscomp.global['Symbol']('iterator')}if(typeof Array.prototype[a]!='function'){$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}})}$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){if(b<a.length){return {done:!1,value:a[b++]}}else {return {done:!0}}})};$jscomp.iteratorPrototype=function(b){$jscomp.initSymbolIterator();var a={next:b};a[$jscomp.global['Symbol'].iterator]=function(){return this};return a};$jscomp.iteratorFromArray=function(a,d){$jscomp.initSymbolIterator();if(a instanceof String){a=a+''}var c=0;var b={next:function(){if(c<a.length){var e=c++;return {value:d(e,a[e]),done:!1}}b.next=function(){return {done:!0,value:void 0}};return b.next()}};b[Symbol.iterator]=function(){return b};return b};$jscomp.polyfill('Array.prototype.entries',function(a){if(a){return a}var b=function(){return $jscomp.iteratorFromArray(this,function(b,c){return [b,c]})};return b},'es6','es3');$jscomp.polyfill('Array.prototype.fill',function(a){if(a){return a}var b=function(f,c,b){var d=this.length||0;if(c<0){c=Math.max(0,d+c)}if(b==null||b>d){b=d}b=Number(b);if(b<0){b=Math.max(0,d+b)}for(var e=Number(c||0);e<b;e++){this[e]=f}return this};return b},'es6','es3');$jscomp.findInternal=function(a,d,e){if(a instanceof String){a=String(a)}var f=a.length;for(var b=0;b<f;b++){var c=a[b];if(d.call(e,c,b,a)){return {i:b,v:c}}}return {i:-1,v:void 0}};$jscomp.polyfill('Array.prototype.find',function(a){if(a){return a}var b=function(c,b){return $jscomp.findInternal(this,c,b).v};return b},'es6','es3');$jscomp.polyfill('Array.prototype.findIndex',function(a){if(a){return a}var b=function(c,b){return $jscomp.findInternal(this,c,b).i};return b},'es6','es3');$jscomp.polyfill('Array.from',function(a){if(a){return a}var b=function(b,c,g){$jscomp.initSymbolIterator();c=c!=null?c:function(d){return d};var e=[];var f=b[Symbol.iterator];if(typeof f=='function'){b=f.call(b);var h;var j=0;while(!(h=b.next()).done){e.push(c.call(g,h.value,j++))}}else {var i=b.length;for(var d=0;d<i;d++){e.push(c.call(g,b[d],d))}}return e};return b},'es6','es3');$jscomp.polyfill('Object.is',function(a){if(a){return a}var b=function(b,c){if(b===c){return b!==0||1/b===1/c}else {return b!==b&&c!==c}};return b},'es6','es3');$jscomp.polyfill('Array.prototype.includes',function(a){if(a){return a}var b=function(d,g){var c=this;if(c instanceof String){c=String(c)}var f=c.length;var b=g||0;if(b<0){b=Math.max(b+f,0)}for(;b<f;b++){var e=c[b];if(e===d||Object.is(e,d)){return !0}}return !1};return b},'es7','es3');$jscomp.polyfill('Array.prototype.keys',function(a){if(a){return a}var b=function(){return $jscomp.iteratorFromArray(this,function(b){return b})};return b},'es6','es3');$jscomp.polyfill('Array.of',function(a){if(a){return a}var b=function(b){return Array.from(arguments)};return b},'es6','es3');$jscomp.polyfill('Array.prototype.values',function(a){if(a){return a}var b=function(){return $jscomp.iteratorFromArray(this,function(c,b){return b})};return b},'es8','es3');$jscomp.makeIterator=function(a){$jscomp.initSymbolIterator();var b=a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.polyfill('Promise',function(c){if(c&&!$jscomp.FORCE_POLYFILL_PROMISE){return c}function AsyncExecutor(){this.batch_=null}AsyncExecutor.prototype.asyncExecute=function(a){if(this.batch_==null){this.batch_=[];this.asyncExecuteBatch_()}this.batch_.push(a);return this};AsyncExecutor.prototype.asyncExecuteBatch_=function(){var a=this;this.asyncExecuteFunction(function(){a.executeBatch_()})};var e=$jscomp.global['setTimeout'];AsyncExecutor.prototype.asyncExecuteFunction=function(a){e(a,0)};AsyncExecutor.prototype.executeBatch_=function(){while(this.batch_&&this.batch_.length){var b=this.batch_;this.batch_=[];for(var a=0;a<b.length;++a){var d=b[a];b[a]=null;try{d()}catch(f){this.asyncThrow_(f)}}}this.batch_=null};AsyncExecutor.prototype.asyncThrow_=function(a){this.asyncExecuteFunction(function(){throw a})};var b={PENDING:0,FULFILLED:1,REJECTED:2};var a=function(d){this.state_=b.PENDING;this.result_=undefined;this.onSettledCallbacks_=[];var a=this.createResolveAndReject_();try{d(a.resolve,a.reject)}catch(f){a.reject(f)}};a.prototype.createResolveAndReject_=function(){var b=this;var a=!1;function firstCallWins(d){return function(e){if(!a){a=!0;d.call(b,e)}}}return {resolve:firstCallWins(this.resolveTo_),reject:firstCallWins(this.reject_)}};a.prototype.resolveTo_=function(b){if(b===this){this.reject_(new TypeError('A Promise cannot resolve to itself'))}else {if(b instanceof a){this.settleSameAsPromise_(b)}else {if(isObject(b)){this.resolveToNonPromiseObj_(b)}else {this.fulfill_(b)}}}};a.prototype.resolveToNonPromiseObj_=function(b){var a=undefined;try{a=b.then}catch(f){this.reject_(f);return}if(typeof a=='function'){this.settleSameAsThenable_(a,b)}else {this.fulfill_(b)}};function isObject(a){switch(typeof a){case 'object':return a!=null;case 'function':return !0;default:return !1;}}a.prototype.reject_=function(a){this.settle_(b.REJECTED,a)};a.prototype.fulfill_=function(a){this.settle_(b.FULFILLED,a)};a.prototype.settle_=function(d,a){if(this.state_!=b.PENDING){throw new Error('Cannot settle('+d+', '+a+'): Promise already settled in state'+this.state_)}this.state_=d;this.result_=a;this.executeOnSettledCallbacks_()};a.prototype.executeOnSettledCallbacks_=function(){if(this.onSettledCallbacks_!=null){for(var a=0;a<this.onSettledCallbacks_.length;++a){d.asyncExecute(this.onSettledCallbacks_[a])}this.onSettledCallbacks_=null}};var d=new AsyncExecutor();a.prototype.settleSameAsPromise_=function(b){var a=this.createResolveAndReject_();b.callWhenSettled_(a.resolve,a.reject)};a.prototype.settleSameAsThenable_=function(b,d){var a=this.createResolveAndReject_();try{b.call(d,a.resolve,a.reject)}catch(f){a.reject(f)}};a.prototype.then=function(f,g){var b;var d;var e=new a(function(a,e){b=a;d=e});function createCallback(a,e){if(typeof a=='function'){return function(h){try{b(a(h))}catch(i){d(i)}}}else {return e}}this.callWhenSettled_(createCallback(f,b),createCallback(g,d));return e};a.prototype['catch']=function(a){return this.then(undefined,a)};a.prototype.callWhenSettled_=function(e,f){var a=this;function callback(){switch(a.state_){case b.FULFILLED:e(a.result_);break;case b.REJECTED:f(a.result_);break;default:throw new Error('Unexpected state: '+a.state_);}}if(this.onSettledCallbacks_==null){d.asyncExecute(callback)}else {this.onSettledCallbacks_.push(callback)}};function resolvingPromise(b){if(b instanceof a){return b}else {return new a(function(a,d){a(b)})}}a['resolve']=resolvingPromise;a['reject']=function(b){return new a(function(d,a){a(b)})};a['race']=function(b){return new a(function(e,f){var d=$jscomp.makeIterator(b);for(var a=d.next();!a.done;a=d.next()){resolvingPromise(a.value).callWhenSettled_(e,f)}})};a['all']=function(e){var d=$jscomp.makeIterator(e);var b=d.next();if(b.done){return resolvingPromise([])}else {return new a(function(g,h){var a=[];var f=0;function onFulfilled(b){return function(d){a[b]=d;f--;if(f==0){g(a)}}}do{a.push(undefined);f++;resolvingPromise(b.value).callWhenSettled_(onFulfilled(a.length-1),h);b=d.next()}while(!b.done)})}};return a},'es6','es3');$jscomp.polyfill('Promise.prototype.finally',function(a){if(a){return a}var b=function(b){return this.then(function(d){var c=Promise.resolve(b());return c.then(function(){return d})},function(d){var c=Promise.resolve(b());return c.then(function(){throw d})})};return b},'es9','es3');$jscomp.underscoreProtoCanBeSet=function(){var b={a:!0};var a={};try{a.__proto__=b;return a.a}catch(c){}return !1};$jscomp.setPrototypeOf=typeof Object.setPrototypeOf=='function'?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,b){a.__proto__=b;if(a.__proto__!==b){throw new TypeError(a+' is not extensible')}return a}:null;$jscomp.generator={};$jscomp.generator.ensureIteratorResultIsObject_=function(a){if(a instanceof Object){return}throw new TypeError('Iterator result '+a+' is not an object')};$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=undefined;this.nextAddress=1;this.catchAddress_=0;this.finallyAddress_=0;this.abruptCompletion_=null;this.finallyContexts_=null};$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_){throw new TypeError('Generator is already running')}this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(a){this.yieldResult=a};$jscomp.generator.Context.prototype.throw_=function(a){this.abruptCompletion_={exception:a,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype['return']=function(a){this.abruptCompletion_={'return':a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(a){this.abruptCompletion_={jumpTo:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(b,a){this.nextAddress=a;return {value:b}};$jscomp.generator.Context.prototype.yieldAll=function(d,b){var c=$jscomp.makeIterator(d);var a=c.next();$jscomp.generator.ensureIteratorResultIsObject_(a);if(a.done){this.yieldResult=a.value;this.nextAddress=b;return}this.yieldAllIterator_=c;return this.yield(a.value,b)};$jscomp.generator.Context.prototype.jumpTo=function(a){this.nextAddress=a};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(b,a){this.catchAddress_=b;if(a!=undefined){this.finallyAddress_=a}};$jscomp.generator.Context.prototype.setFinallyBlock=function(a){this.catchAddress_=0;this.finallyAddress_=a||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(b,a){this.nextAddress=b;this.catchAddress_=a||0};$jscomp.generator.Context.prototype.enterCatchBlock=function(a){this.catchAddress_=a||0;var b=this.abruptCompletion_.exception;this.abruptCompletion_=null;return b};$jscomp.generator.Context.prototype.enterFinallyBlock=function(c,b,a){if(!a){this.finallyContexts_=[this.abruptCompletion_]}else {this.finallyContexts_[a]=this.abruptCompletion_}this.catchAddress_=c||0;this.finallyAddress_=b||0};$jscomp.generator.Context.prototype.leaveFinallyBlock=function(d,c){var b=this.finallyContexts_.splice(c||0)[0];var a=this.abruptCompletion_=this.abruptCompletion_||b;if(a){if(a.isException){return this.jumpToErrorHandler_()}if(a.jumpTo!=undefined&&this.finallyAddress_<a.jumpTo){this.nextAddress=a.jumpTo;this.abruptCompletion_=null}else {this.nextAddress=this.finallyAddress_}}else {this.nextAddress=d}};$jscomp.generator.Context.prototype.forIn=function(a){return new $jscomp.generator.Context.PropertyIterator(a)};$jscomp.generator.Context.PropertyIterator=function(a){this.object_=a;this.properties_=[];for(var b in a){this.properties_.push(b)}this.properties_.reverse()};$jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){while(this.properties_.length>0){var a=this.properties_.pop();if(a in this.object_){return a}}return null};$jscomp.generator.Engine_=function(a){this.context_=new $jscomp.generator.Context();this.program_=a};$jscomp.generator.Engine_.prototype.next_=function(a){this.context_.start_();if(this.context_.yieldAllIterator_){return this.yieldAllStep_(this.context_.yieldAllIterator_.next,a,this.context_.next_)}this.context_.next_(a);return this.nextStep_()};$jscomp.generator.Engine_.prototype.return_=function(b){this.context_.start_();var a=this.context_.yieldAllIterator_;if(a){var c='return' in a?a['return']:function(a){return {value:a,done:!0}};return this.yieldAllStep_(c,b,this.context_['return'])}this.context_['return'](b);return this.nextStep_()};$jscomp.generator.Engine_.prototype.throw_=function(a){this.context_.start_();if(this.context_.yieldAllIterator_){return this.yieldAllStep_(this.context_.yieldAllIterator_['throw'],a,this.context_.next_)}this.context_.throw_(a);return this.nextStep_()};$jscomp.generator.Engine_.prototype.yieldAllStep_=function(d,e,c){try{var a=d.call(this.context_.yieldAllIterator_,e);$jscomp.generator.ensureIteratorResultIsObject_(a);if(!a.done){this.context_.stop_();return a}var b=a.value}catch(f){this.context_.yieldAllIterator_=null;this.context_.throw_(f);return this.nextStep_()}this.context_.yieldAllIterator_=null;c.call(this.context_,b);return this.nextStep_()};$jscomp.generator.Engine_.prototype.nextStep_=function(){while(this.context_.nextAddress){try{var b=this.program_(this.context_);if(b){this.context_.stop_();return {value:b.value,done:!1}}}catch(c){this.context_.yieldResult=undefined;this.context_.throw_(c)}}this.context_.stop_();if(this.context_.abruptCompletion_){var a=this.context_.abruptCompletion_;this.context_.abruptCompletion_=null;if(a.isException){throw a.exception}return {value:a['return'],done:!0}}return {value:undefined,done:!0}};$jscomp.generator.Generator_=function(a){this.next=function(b){return a.next_(b)};this['throw']=function(b){return a.throw_(b)};this['return']=function(b){return a.return_(b)};$jscomp.initSymbolIterator();this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(b,c){var a=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(c));if($jscomp.setPrototypeOf){$jscomp.setPrototypeOf(a,b.prototype)}return a};$jscomp.asyncExecutePromiseGenerator=function(a){function passValueToGenerator(b){return a.next(b)}function passErrorToGenerator(b){return a['throw'](b)}return new Promise(function(b,c){function handleGeneratorRecord(d){if(d.done){b(d.value)}else {Promise.resolve(d.value).then(passValueToGenerator,passErrorToGenerator).then(handleGeneratorRecord,c)}}handleGeneratorRecord(a.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(a){return $jscomp.asyncExecutePromiseGenerator(a())};$jscomp.asyncExecutePromiseGeneratorProgram=function(a){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(a)))};$jscomp.checkEs6ConformanceViaProxy=function(){try{var a={};var b=Object.create(new $jscomp.global['Proxy'](a,{'get':function(d,e,c){return d==a&&e=='q'&&c==b}}));return b['q']===!0}catch(c){return !1}};$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();$jscomp.owns=function(b,a){return Object.prototype.hasOwnProperty.call(b,a)};$jscomp.polyfill('WeakMap',function(c){function isConformant(){if(!c||!Object.seal){return !1}try{var b=Object.seal({});var d=Object.seal({});var a=new c([[b,2],[d,3]]);if(a.get(b)!=2||a.get(d)!=3){return !1}a['delete'](b);a.set(d,4);return !a.has(b)&&a.get(d)==4}catch(e){return !1}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(c&&$jscomp.ES6_CONFORMANCE){return c}}else {if(isConformant()){return c}}var a='$jscomp_hidden_'+Math.random();function insert(b){if(!$jscomp.owns(b,a)){var d={};$jscomp.defineProperty(b,a,{value:d})}}function patch(a){var b=Object[a];if(b){Object[a]=function(d){insert(d);return b(d)}}}patch('freeze');patch('preventExtensions');patch('seal');var d=0;var b=function(a){this.id_=(d+=Math.random()+1).toString();if(a){$jscomp.initSymbol();$jscomp.initSymbolIterator();var f=$jscomp.makeIterator(a);var b;while(!(b=f.next()).done){var e=b.value;this.set(e[0],e[1])}}};b.prototype.set=function(b,d){insert(b);if(!$jscomp.owns(b,a)){throw new Error('WeakMap key fail: '+b)}b[a][this.id_]=d;return this};b.prototype.get=function(b){return $jscomp.owns(b,a)?b[a][this.id_]:undefined};b.prototype.has=function(b){return $jscomp.owns(b,a)&&$jscomp.owns(b[a],this.id_)};b.prototype['delete']=function(b){if(!$jscomp.owns(b,a)||!$jscomp.owns(b[a],this.id_)){return !1}return delete b[a][this.id_]};return b},'es6','es3');$jscomp.MapEntry=function(){this.previous;this.next;this.head;this.key;this.value};$jscomp.polyfill('Map',function(b){function isConformant(){if($jscomp.ASSUME_NO_NATIVE_MAP||!b||typeof b!='function'||!b.prototype.entries||typeof Object.seal!='function'){return !1}try{b=b;var e=Object.seal({x:4});var c=new b($jscomp.makeIterator([[e,'s']]));if(c.get(e)!='s'||c.size!=1||c.get({x:4})||c.set({x:4},'t')!=c||c.size!=2){return !1}var d=c.entries();var a=d.next();if(a.done||a.value[0]!=e||a.value[1]!='s'){return !1}a=d.next();if(a.done||a.value[0].x!=4||a.value[1]!='t'||!d.next().done){return !1}return !0}catch(i){return !1}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(b&&$jscomp.ES6_CONFORMANCE){return b}}else {if(isConformant()){return b}}$jscomp.initSymbol();$jscomp.initSymbolIterator();var e=new WeakMap();var a=function(a){this.data_={};this.head_=f();this.size=0;if(a){var e=$jscomp.makeIterator(a);var c;while(!(c=e.next()).done){var d=c.value;this.set(d[0],d[1])}}};a.prototype.set=function(d,e){d=d===0?0:d;var a=c(this,d);if(!a.list){a.list=this.data_[a.id]=[]}if(!a.entry){a.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:d,value:e};a.list.push(a.entry);this.head_.previous.next=a.entry;this.head_.previous=a.entry;this.size++}else {a.entry.value=e}return this};a.prototype['delete']=function(d){var a=c(this,d);if(a.entry&&a.list){a.list.splice(a.index,1);if(!a.list.length){delete this.data_[a.id]}a.entry.previous.next=a.entry.next;a.entry.next.previous=a.entry.previous;a.entry.head=null;this.size--;return !0}return !1};a.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=f();this.size=0};a.prototype.has=function(a){return !!c(this,a).entry};a.prototype.get=function(d){var a=c(this,d).entry;return a&&a.value};a.prototype.entries=function(){return d(this,function(a){return [a.key,a.value]})};a.prototype.keys=function(){return d(this,function(a){return a.key})};a.prototype.values=function(){return d(this,function(a){return a.value})};a.prototype.forEach=function(e,d){var f=this.entries();var c;while(!(c=f.next()).done){var a=c.value;e.call(d,a[1],a[0],this)}};a.prototype[Symbol.iterator]=a.prototype.entries;var c=function(g,e){var f=h(e);var a=g.data_[f];if(a&&$jscomp.owns(g.data_,f)){for(var d=0;d<a.length;d++){var c=a[d];if(e!==e&&c.key!==c.key||e===c.key){return {id:f,list:a,index:d,entry:c}}}}return {id:f,list:a,index:-1,entry:undefined}};var d=function(c,d){var a=c.head_;return $jscomp.iteratorPrototype(function(){if(a){while(a.head!=c.head_){a=a.previous}while(a.next!=a.head){a=a.next;return {done:!1,value:d(a)}}a=null}return {done:!0,value:void 0}})};var f=function(){var a={};a.previous=a.next=a.head=a;return a};var g=0;var h=function(a){var c=a&&typeof a;if(c=='object'||c=='function'){a=a;if(!e.has(a)){var d=''+ ++g;e.set(a,d);return d}return e.get(a)}return 'p_'+a};return a},'es6','es3');$jscomp.polyfill('Math.acosh',function(a){if(a){return a}var b=function(b){b=Number(b);return Math.log(b+Math.sqrt(b*b-1))};return b},'es6','es3');$jscomp.polyfill('Math.asinh',function(a){if(a){return a}var b=function(b){b=Number(b);if(b===0){return b}var c=Math.log(Math.abs(b)+Math.sqrt(b*b+1));return b<0?-c:c};return b},'es6','es3');$jscomp.polyfill('Math.log1p',function(a){if(a){return a}var b=function(b){b=Number(b);if(b<0.25&&b>-0.25){var f=b;var g=1;var c=b;var d=0;var e=1;while(d!=c){f*=b;e*=-1;c=(d=c)+e*f/++g}return c}return Math.log(1+b)};return b},'es6','es3');$jscomp.polyfill('Math.atanh',function(b){if(b){return b}var a=Math.log1p;var c=function(c){c=Number(c);return (a(c)-a(-c))/2};return c},'es6','es3');$jscomp.polyfill('Math.cbrt',function(a){if(a){return a}var b=function(b){if(b===0){return b}b=Number(b);var c=Math.pow(Math.abs(b),1/3);return b<0?-c:c};return b},'es6','es3');$jscomp.polyfill('Math.clz32',function(a){if(a){return a}var b=function(b){b=Number(b)>>>0;if(b===0){return 32}var c=0;if((b&4.29490176E9)===0){b<<=16;c+=16}if((b&4.27819008E9)===0){b<<=8;c+=8}if((b&4.02653184E9)===0){b<<=4;c+=4}if((b&3.221225472E9)===0){b<<=2;c+=2}if((b&2.147483648E9)===0){c++}return c};return b},'es6','es3');$jscomp.polyfill('Math.cosh',function(a){if(a){return a}var b=Math.exp;var c=function(c){c=Number(c);return (b(c)+b(-c))/2};return c},'es6','es3');$jscomp.polyfill('Math.expm1',function(a){if(a){return a}var b=function(b){b=Number(b);if(b<0.25&&b>-0.25){var e=b;var f=1;var c=b;var d=0;while(d!=c){e*=b/++f;c=(d=c)+e}return c}return Math.exp(b)-1};return b},'es6','es3');$jscomp.polyfill('Math.hypot',function(a){if(a){return a}var b=function(d,e,h){d=Number(d);e=Number(e);var b,g,f;var c=Math.max(Math.abs(d),Math.abs(e));for(b=2;b<arguments.length;b++){c=Math.max(c,Math.abs(arguments[b]))}if(c>1.0E100||c<1.0E-100){if(!c){return c}d=d/c;e=e/c;f=d*d+e*e;for(b=2;b<arguments.length;b++){g=Number(arguments[b])/c;f+=g*g}return Math.sqrt(f)*c}else {f=d*d+e*e;for(b=2;b<arguments.length;b++){g=Number(arguments[b]);f+=g*g}return Math.sqrt(f)}};return b},'es6','es3');$jscomp.polyfill('Math.imul',function(a){if(a){return a}var b=function(b,c){b=Number(b);c=Number(c);var f=b>>>16&65535;var d=b&65535;var g=c>>>16&65535;var e=c&65535;var h=f*e+d*g<<16>>>0;return d*e+h|0};return b},'es6','es3');$jscomp.polyfill('Math.log10',function(a){if(a){return a}var b=function(b){return Math.log(b)/Math.LN10};return b},'es6','es3');$jscomp.polyfill('Math.log2',function(a){if(a){return a}var b=function(b){return Math.log(b)/Math.LN2};return b},'es6','es3');$jscomp.polyfill('Math.sign',function(a){if(a){return a}var b=function(b){b=Number(b);return b===0||isNaN(b)?b:b>0?1:-1};return b},'es6','es3');$jscomp.polyfill('Math.sinh',function(a){if(a){return a}var b=Math.exp;var c=function(c){c=Number(c);if(c===0){return c}return (b(c)-b(-c))/2};return c},'es6','es3');$jscomp.polyfill('Math.tanh',function(a){if(a){return a}var b=function(b){b=Number(b);if(b===0){return b}var c=Math.exp(-2*Math.abs(b));var d=(1-c)/(1+c);return b<0?-d:d};return b},'es6','es3');$jscomp.polyfill('Math.trunc',function(a){if(a){return a}var b=function(b){b=Number(b);if(isNaN(b)||b===Infinity||b===-Infinity||b===0){return b}var c=Math.floor(Math.abs(b));return b<0?-c:c};return b},'es6','es3');$jscomp.polyfill('Number.EPSILON',function(a){return Math.pow(2,-52)},'es6','es3');$jscomp.polyfill('Number.MAX_SAFE_INTEGER',function(){return 9.007199254740991E15},'es6','es3');$jscomp.polyfill('Number.MIN_SAFE_INTEGER',function(){return -9.007199254740991E15},'es6','es3');$jscomp.polyfill('Number.isFinite',function(a){if(a){return a}var b=function(b){if(typeof b!=='number'){return !1}return !isNaN(b)&&b!==Infinity&&b!==-Infinity};return b},'es6','es3');$jscomp.polyfill('Number.isInteger',function(a){if(a){return a}var b=function(b){if(!Number.isFinite(b)){return !1}return b===Math.floor(b)};return b},'es6','es3');$jscomp.polyfill('Number.isNaN',function(a){if(a){return a}var b=function(b){return typeof b==='number'&&isNaN(b)};return b},'es6','es3');$jscomp.polyfill('Number.isSafeInteger',function(a){if(a){return a}var b=function(b){return Number.isInteger(b)&&Math.abs(b)<=Number.MAX_SAFE_INTEGER};return b},'es6','es3');$jscomp.polyfill('Number.parseFloat',function(a){return a||parseFloat},'es6','es3');$jscomp.polyfill('Number.parseInt',function(a){return a||parseInt},'es6','es3');$jscomp.assign=typeof Object.assign=='function'?Object.assign:function(d,e){for(var c=1;c<arguments.length;c++){var a=arguments[c];if(!a){continue}for(var b in a){if($jscomp.owns(a,b)){d[b]=a[b]}}}return d};$jscomp.polyfill('Object.assign',function(a){return a||$jscomp.assign},'es6','es3');$jscomp.polyfill('Object.entries',function(a){if(a){return a}var b=function(c){var d=[];for(var b in c){if($jscomp.owns(c,b)){d.push([b,c[b]])}}return d};return b},'es8','es3');$jscomp.polyfill('Object.getOwnPropertySymbols',function(a){if(a){return a}return function(){return []}},'es6','es5');$jscomp.polyfill('Reflect.ownKeys',function(b){if(b){return b}var a='jscomp_symbol_';function isSymbol(c){return c.substring(0,a.length)==a}var c=function(e){var f=[];var c=Object.getOwnPropertyNames(e);var d=Object.getOwnPropertySymbols(e);for(var a=0;a<c.length;a++){(isSymbol(c[a])?d:f).push(c[a])}return f.concat(d)};return c},'es6','es5');$jscomp.polyfill('Object.getOwnPropertyDescriptors',function(a){if(a){return a}var b=function(e){var d={};var c=Reflect.ownKeys(e);for(var b=0;b<c.length;b++){d[c[b]]=Object.getOwnPropertyDescriptor(e,c[b])}return d};return b},'es8','es5');$jscomp.polyfill('Object.setPrototypeOf',function(a){return a||$jscomp.setPrototypeOf},'es6','es5');$jscomp.polyfill('Object.values',function(a){if(a){return a}var b=function(b){var c=[];for(var d in b){if($jscomp.owns(b,d)){c.push(b[d])}}return c};return b},'es8','es3');$jscomp.polyfill('Reflect.apply',function(a){if(a){return a}var c=Function.prototype.apply;var b=function(e,d,b){return c.call(e,d,b)};return b},'es6','es3');$jscomp.objectCreate=$jscomp.ASSUME_ES5||typeof Object.create=='function'?Object.create:function(b){var a=function(){};a.prototype=b;return new a()};$jscomp.construct=function(){function reflectConstructWorks(){function Base(){}function Derived(){}new Base();Reflect.construct(Base,[],Derived);return new Base() instanceof Base}if(typeof Reflect!='undefined'&&Reflect.construct){if(reflectConstructWorks()){return Reflect.construct}var b=Reflect.construct;var a=function(e,d,a){var c=b(e,d);if(a){Reflect.setPrototypeOf(c,a.prototype)}return c};return a}function construct(b,d,a){if(a===undefined){a=b}var f=a.prototype||Object.prototype;var c=$jscomp.objectCreate(f);var e=Function.prototype.apply;var g=e.call(b,c,d);return g||c}return construct}();$jscomp.polyfill('Reflect.construct',function(a){return $jscomp.construct},'es6','es3');$jscomp.polyfill('Reflect.defineProperty',function(a){if(a){return a}var b=function(e,d,c){try{Object.defineProperty(e,d,c);var b=Object.getOwnPropertyDescriptor(e,d);if(!b){return !1}return b.configurable===(c.configurable||!1)&&b.enumerable===(c.enumerable||!1)&&('value' in b?b.value===c.value&&b.writable===(c.writable||!1):b.get===c.get&&b.set===c.set)}catch(f){return !1}};return b},'es6','es5');$jscomp.polyfill('Reflect.deleteProperty',function(a){if(a){return a}var b=function(c,b){if(!$jscomp.owns(c,b)){return !0}try{return delete c[b]}catch(d){return !1}};return b},'es6','es3');$jscomp.polyfill('Reflect.getOwnPropertyDescriptor',function(a){return a||Object.getOwnPropertyDescriptor},'es6','es5');$jscomp.polyfill('Reflect.getPrototypeOf',function(a){return a||Object.getPrototypeOf},'es6','es5');$jscomp.findDescriptor=function(d,c){var a=d;while(a){var b=Reflect.getOwnPropertyDescriptor(a,c);if(b){return b}a=Reflect.getPrototypeOf(a)}return undefined};$jscomp.polyfill('Reflect.get',function(a){if(a){return a}var b=function(d,c,e){if(arguments.length<=2){return d[c]}var b=$jscomp.findDescriptor(d,c);if(b){return b.get?b.get.call(e):b.value}return undefined};return b},'es6','es5');$jscomp.polyfill('Reflect.has',function(a){if(a){return a}var b=function(c,b){return b in c};return b},'es6','es3');$jscomp.polyfill('Reflect.isExtensible',function(a){if(a){return a}if($jscomp.ASSUME_ES5||typeof Object.isExtensible=='function'){return Object.isExtensible}return function(){return !0}},'es6','es3');$jscomp.polyfill('Reflect.preventExtensions',function(a){if(a){return a}if(!($jscomp.ASSUME_ES5||typeof Object.preventExtensions=='function')){return function(){return !1}}var b=function(b){Object.preventExtensions(b);return !Object.isExtensible(b)};return b},'es6','es3');$jscomp.polyfill('Reflect.set',function(a){if(a){return a}var b=function(b,d,e,f){var c=$jscomp.findDescriptor(b,d);if(!c){if(Reflect.isExtensible(b)){b[d]=e;return !0}return !1}if(c.set){c.set.call(arguments.length>3?f:b,e);return !0}else {if(c.writable&&!Object.isFrozen(b)){b[d]=e;return !0}}return !1};return b},'es6','es5');$jscomp.polyfill('Reflect.setPrototypeOf',function(a){if(a){return a}else {if($jscomp.setPrototypeOf){var b=$jscomp.setPrototypeOf;var c=function(c,d){try{b(c,d);return !0}catch(e){return !1}};return c}else {return null}}},'es6','es5');$jscomp.polyfill('Set',function(b){function isConformant(){if($jscomp.ASSUME_NO_NATIVE_SET||!b||typeof b!='function'||!b.prototype.entries||typeof Object.seal!='function'){return !1}try{b=b;var d=Object.seal({x:4});var c=new b($jscomp.makeIterator([d]));if(!c.has(d)||c.size!=1||c.add(d)!=c||c.size!=1||c.add({x:4})!=c||c.size!=2){return !1}var e=c.entries();var a=e.next();if(a.done||a.value[0]!=d||a.value[1]!=d){return !1}a=e.next();if(a.done||a.value[0]==d||a.value[0].x!=4||a.value[1]!=a.value[0]){return !1}return e.next().done}catch(f){return !1}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(b&&$jscomp.ES6_CONFORMANCE){return b}}else {if(isConformant()){return b}}$jscomp.initSymbol();$jscomp.initSymbolIterator();var a=function(a){this.map_=new Map();if(a){var e=$jscomp.makeIterator(a);var c;while(!(c=e.next()).done){var d=c.value;this.add(d)}}this.size=this.map_.size};a.prototype.add=function(a){a=a===0?0:a;this.map_.set(a,a);this.size=this.map_.size;return this};a.prototype['delete']=function(c){var a=this.map_['delete'](c);this.size=this.map_.size;return a};a.prototype.clear=function(){this.map_.clear();this.size=0};a.prototype.has=function(a){return this.map_.has(a)};a.prototype.entries=function(){return this.map_.entries()};a.prototype.values=function(){return this.map_.values()};a.prototype.keys=a.prototype.values;a.prototype[Symbol.iterator]=a.prototype.values;a.prototype.forEach=function(c,a){var d=this;this.map_.forEach(function(e){return c.call(a,e,e,d)})};return a},'es6','es3');$jscomp.checkStringArgs=function(a,c,b){if(a==null){throw new TypeError("The 'this' value for String.prototype."+b+' must not be null or undefined')}if(c instanceof RegExp){throw new TypeError('First argument to String.prototype.'+b+' must not be a regular expression')}return a+''};$jscomp.polyfill('String.prototype.codePointAt',function(a){if(a){return a}var b=function(b){var e=$jscomp.checkStringArgs(this,null,'codePointAt');var f=e.length;b=Number(b)||0;if(!(b>=0&&b<f)){return void 0}b=b|0;var c=e.charCodeAt(b);if(c<55296||c>56319||b+1===f){return c}var d=e.charCodeAt(b+1);if(d<56320||d>57343){return c}return (c-55296)*1024+d+9216};return b},'es6','es3');$jscomp.polyfill('String.prototype.endsWith',function(a){if(a){return a}var b=function(b,c){var d=$jscomp.checkStringArgs(this,b,'endsWith');b=b+'';if(c===void 0){c=d.length}var f=Math.max(0,Math.min(c|0,d.length));var e=b.length;while(e>0&&f>0){if(d[--f]!=b[--e]){return !1}}return e<=0};return b},'es6','es3');$jscomp.polyfill('String.fromCodePoint',function(a){if(a){return a}var b=function(e){var c='';for(var d=0;d<arguments.length;d++){var b=Number(arguments[d]);if(b<0||b>1114111||b!==Math.floor(b)){throw new RangeError('invalid_code_point '+b)}if(b<=65535){c+=String.fromCharCode(b)}else {b-=65536;c+=String.fromCharCode(b>>>10&1023|55296);c+=String.fromCharCode(b&1023|56320)}}return c};return b},'es6','es3');$jscomp.polyfill('String.prototype.includes',function(a){if(a){return a}var b=function(b,c){var d=$jscomp.checkStringArgs(this,b,'includes');return d.indexOf(b,c||0)!==-1};return b},'es6','es3');$jscomp.polyfill('String.prototype.repeat',function(a){if(a){return a}var b=function(b){var c=$jscomp.checkStringArgs(this,null,'repeat');if(b<0||b>1342177279){throw new RangeError('Invalid count value')}b=b|0;var d='';while(b){if(b&1){d+=c}if(b>>>=1){c+=c}}return d};return b},'es6','es3');$jscomp.stringPadding=function(c,a){var b=c!==undefined?String(c):' ';if(!(a>0)||!b){return ''}var d=Math.ceil(a/b.length);return b.repeat(d).substring(0,a)};$jscomp.polyfill('String.prototype.padEnd',function(a){if(a){return a}var b=function(d,c){var b=$jscomp.checkStringArgs(this,null,'padStart');var e=d-b.length;return b+$jscomp.stringPadding(c,e)};return b},'es8','es3');$jscomp.polyfill('String.prototype.padStart',function(a){if(a){return a}var b=function(d,c){var b=$jscomp.checkStringArgs(this,null,'padStart');var e=d-b.length;return $jscomp.stringPadding(c,e)+b};return b},'es8','es3');$jscomp.polyfill('String.prototype.startsWith',function(a){if(a){return a}var b=function(b,g){var c=$jscomp.checkStringArgs(this,b,'startsWith');b=b+'';var h=c.length;var e=b.length;var f=Math.max(0,Math.min(g|0,c.length));var d=0;while(d<e&&f<h){if(c[f++]!=b[d++]){return !1}}return d>=e};return b},'es6','es3');$jscomp.arrayFromIterator=function(c){var b;var a=[];while(!(b=c.next()).done){a.push(b.value)}return a};$jscomp.arrayFromIterable=function(a){if(a instanceof Array){return a}else {return $jscomp.arrayFromIterator($jscomp.makeIterator(a))}};$jscomp.inherits=function(a,b){a.prototype=$jscomp.objectCreate(b.prototype);a.prototype.constructor=a;if($jscomp.setPrototypeOf){var e=$jscomp.setPrototypeOf;e(a,b)}else {for(var c in b){if(c=='prototype'){continue}if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);if(d){Object.defineProperty(a,c,d)}}else {a[c]=b[c]}}}a.superClass_=b.prototype};$jscomp.polyfill('WeakSet',function(a){function isConformant(){if(!a||!Object.seal){return !1}try{var c=Object.seal({});var d=Object.seal({});var b=new a([c]);if(!b.has(c)||b.has(d)){return !1}b['delete'](c);b.add(d);return !b.has(c)&&b.has(d)}catch(e){return !1}}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(a&&$jscomp.ES6_CONFORMANCE){return a}}else {if(isConformant()){return a}}var b=function(b){this.map_=new WeakMap();if(b){$jscomp.initSymbol();$jscomp.initSymbolIterator();var e=$jscomp.makeIterator(b);var c;while(!(c=e.next()).done){var d=c.value;this.add(d)}}};b.prototype.add=function(b){this.map_.set(b,!0);return this};b.prototype.has=function(b){return this.map_.has(b)};b.prototype['delete']=function(b){return this.map_['delete'](b)};return b},'es6','es3');try{if(Array.prototype.values.toString().indexOf('[native code]')==-1){delete Array.prototype.values}}catch(a){}Ext.define('Ext.data.amf.Encoder',{alias:'data.amf.Encoder',config:{format:3},bytes:[],constructor:function(a){this.initConfig(a);this.clear()},clear:function(){this.bytes=[]},applyFormat:function(a){var b={0:{writeUndefined:this.write0Undefined,writeNull:this.write0Null,writeBoolean:this.write0Boolean,writeNumber:this.write0Number,writeString:this.write0String,writeXml:this.write0Xml,writeDate:this.write0Date,writeArray:this.write0Array,writeGenericObject:this.write0GenericObject},3:{writeUndefined:this.write3Undefined,writeNull:this.write3Null,writeBoolean:this.write3Boolean,writeNumber:this.write3Number,writeString:this.write3String,writeXml:this.write3Xml,writeDate:this.write3Date,writeArray:this.write3Array,writeGenericObject:this.write3GenericObject}}[a];if(b){Ext.apply(this,b);return a}else {return}},writeObject:function(a){var b=typeof a;if(b==='undefined'){this.writeUndefined()}else {if(a===null){this.writeNull()}else {if(Ext.isBoolean(a)){this.writeBoolean(a)}else {if(Ext.isString(a)){this.writeString(a)}else {if(b==='number'||a instanceof Number){this.writeNumber(a)}else {if(b==='object'){if(a instanceof Date){this.writeDate(a)}else {if(Ext.isArray(a)){this.writeArray(a)}else {if(this.isXmlDocument(a)){this.writeXml(a)}else {this.writeGenericObject(a)}}}}else {}}}}}}},write3Undefined:function(){this.writeByte(0)},write0Undefined:function(){this.writeByte(6)},write3Null:function(){this.writeByte(1)},write0Null:function(){this.writeByte(5)},write3Boolean:function(a){if(a){this.writeByte(3)}else {this.writeByte(2)}},write0Boolean:function(a){this.writeByte(1);if(a){this.writeByte(1)}else {this.writeByte(0)}},encode29Int:function(e){var b=[],a=e,d,c;if(a===0){return [0]}if(a>2097151){d=a&255;b.unshift(d);a=a>>8}while(a>0){d=a&127;b.unshift(d);a=a>>7}for(c=0;c<b.length-1;c++){b[c]=b[c]|128}return b},write3Number:function(a){var b,c=536870911,d=-268435455;if(a instanceof Number){a=a.valueOf()}if(a%1===0&&a>=d&&a<=c){a=a&c;b=this.encode29Int(a);b.unshift(4);this.writeBytes(b)}else {b=this.encodeDouble(a);b.unshift(5);this.writeBytes(b)}},write0Number:function(a){var b;if(a instanceof Number){a=a.valueOf()}b=this.encodeDouble(a);b.unshift(0);this.writeBytes(b)},encodeUtf8Char:function(a){var c=[],d,e,f,b;if(a<=127){c.push(a)}else {if(a<=2047){e=2}else {if(a<=65535){e=3}else {e=4}}b=128;for(f=1;f<e;f++){d=a&63|128;c.unshift(d);a=a>>6;b=b>>1|128}d=a|b;c.unshift(d)}return c},encodeUtf8String:function(d){var b=[],c,a;for(a=0;a<d.length;a++){c=this.encodeUtf8Char(d.charCodeAt(a));Ext.Array.push(b,c)}return b},encode3Utf8StringLen:function(c){var a=c.length,b=[];if(a<=268435455){a=a<<1;a=a|1;b=this.encode29Int(a)}else {}return b},write3String:function(c){var a,b;if(c===''){this.writeByte(6);this.writeByte(1)}else {a=this.encodeUtf8String(c);b=this.encode3Utf8StringLen(a);this.writeByte(6);this.writeBytes(b);this.writeBytes(a)}},encodeXInt:function(a,d){var c=[],b;for(b=0;b<d;b++){c.unshift(a&255);a=a>>8}return c},write0String:function(d){var a,c,b;if(d===''){this.writeByte(2);this.writeBytes([0,0])}else {a=this.encodeUtf8String(d);if(a.length<=65535){b=2;c=this.encodeXInt(a.length,2)}else {b=12;c=this.encodeXInt(a.length,4)}this.writeByte(b);this.writeBytes(c);this.writeBytes(a)}},write3XmlWithType:function(e,c){var b,a,d;b=this.convertXmlToString(e);if(b===''){this.writeByte(c);this.writeByte(1)}else {a=this.encodeUtf8String(b);d=this.encode3Utf8StringLen(a);this.writeByte(c);this.writeBytes(d);this.writeBytes(a)}},write3XmlDocument:function(a){this.write3XmlWithType(a,7)},write3Xml:function(a){this.write3XmlWithType(a,11)},write0Xml:function(d){var c,a,b;c=this.convertXmlToString(d);this.writeByte(15);a=this.encodeUtf8String(c);b=this.encodeXInt(a.length,4);this.writeBytes(b);this.writeBytes(a)},write3Date:function(a){this.writeByte(8);this.writeBytes(this.encode29Int(1));this.writeBytes(this.encodeDouble(new Number(a)))},write0Date:function(a){this.writeByte(11);this.writeBytes(this.encodeDouble(new Number(a)));this.writeBytes([0,0])},write3Array:function(b){var a;this.writeByte(9);a=b.length;a=a<<1;a=a|1;this.writeBytes(this.encode29Int(a));this.writeByte(1);Ext.each(b,function(a){this.writeObject(a)},this)},write0ObjectProperty:function(a,d){var b,c;if(!(a instanceof String)&&typeof a!=='string'){a=a+''}b=this.encodeUtf8String(a);c=this.encodeXInt(b.length,2);this.writeBytes(c);this.writeBytes(b);this.writeObject(d)},write0Array:function(c){var a,b;this.writeByte(8);b=0;for(a in c){b++}this.writeBytes(this.encodeXInt(b,4));for(a in c){Ext.Array.push(this.write0ObjectProperty(a,c[a]))}this.writeBytes([0,0,9])},write0StrictArray:function(a){var b;this.writeByte(10);b=a.length;this.writeBytes(this.encodeXInt(b,4));Ext.each(a,function(b){this.writeObject(b)},this)},write3ByteArray:function(b){var a;this.writeByte(12);a=b.length;a=a<<1;a=a|1;this.writeBytes(this.encode29Int(a));this.writeBytes(b)},write3GenericObject:function(d){var a,e,b,c;this.writeByte(10);c=11;this.writeByte(c);this.writeByte(1);for(a in d){e=(new String(a)).valueOf();b=this.encodeUtf8String(a);this.writeBytes(this.encode3Utf8StringLen(a));this.writeBytes(b);this.writeObject(d[a])}this.writeByte(1)},write0GenericObject:function(b){var c,d,a;c=!!b.$flexType;d=c?16:3;this.writeByte(d);if(c){this.write0ShortUtf8String(b.$flexType)}for(a in b){if(a!=='$flexType'){Ext.Array.push(this.write0ObjectProperty(a,b[a]))}}this.writeBytes([0,0,9])},writeByte:function(a){Ext.Array.push(this.bytes,a)},writeBytes:function(a){var b;Ext.Array.push(this.bytes,a)},convertXmlToString:function(b){var a;if(window.XMLSerializer){a=(new window.XMLSerializer()).serializeToString(b)}else {a=b.xml}return a},isXmlDocument:function(a){if(window.DOMParser){if(Ext.isDefined(a.doctype)){return !0}}if(Ext.isString(a.xml)){return !0}return !1},encodeDouble:function(a){var l=11,h=52,i=(1<<l-1)-1,k,d,e,j,f,b,g,c=[],n=[127,240,0,0,0,0,0,0],m=[255,240,0,0,0,0,0,0],o=[255,248,0,0,0,0,0,0];if(isNaN(a)){c=o}else {if(a===Infinity){c=n}else {if(a===-Infinity){c=m}else {if(a===0){d=0;e=0;k=1/a===-Infinity?1:0}else {k=a<0;a=Math.abs(a);if(a>=Math.pow(2,1-i)){j=Math.min(Math.floor(Math.log(a)/Math.LN2),i);d=j+i;e=Math.round(a*Math.pow(2,h-j)-Math.pow(2,h))}else {d=0;e=Math.round(a/Math.pow(2,1-i-h))}}b=[];for(f=h;f;f-=1){b.push(e%2?1:0);e=Math.floor(e/2)}for(f=l;f;f-=1){b.push(d%2?1:0);d=Math.floor(d/2)}b.push(k?1:0);b.reverse();g=b.join('');c=[];while(g.length){c.push(parseInt(g.substring(0,8),2));g=g.substring(8)}}}}return c},write0ShortUtf8String:function(c){var a=this.encodeUtf8String(c),b;b=this.encodeXInt(a.length,2);this.writeBytes(b);this.writeBytes(a)},writeAmfPacket:function(c,b){var a;this.writeBytes([0,0]);this.writeBytes(this.encodeXInt(c.length,2));for(a in c){this.writeAmfHeader(c[a].name,c[a].mustUnderstand,c[a].value)}this.writeBytes(this.encodeXInt(b.length,2));for(a in b){this.writeAmfMessage(b[a].targetUri,b[a].responseUri,b[a].body)}},writeAmfHeader:function(c,b,d){var a;this.write0ShortUtf8String(c);a=b?1:0;this.writeByte(a);this.writeBytes(this.encodeXInt(-1,4));this.writeObject(d)},writeAmfMessage:function(b,a,c){this.write0ShortUtf8String(b);this.write0ShortUtf8String(a);this.writeBytes(this.encodeXInt(-1,4));this.write0StrictArray(c)}});Ext.define('Ext.data.amf.Packet',function(){var f=Math.pow(2,-52),g=Math.pow(2,8),a=0,c,d,b,e;return {typeMap:{0:{0:'readDouble',1:'readBoolean',2:'readAmf0String',3:'readAmf0Object',5:'readNull',6:'readUndefined',7:'readReference',8:'readEcmaArray',10:'readStrictArray',11:'readAmf0Date',12:'readLongString',13:'readUnsupported',15:'readAmf0Xml',16:'readTypedObject'},3:{0:'readUndefined',1:'readNull',2:'readFalse',3:'readTrue',4:'readUInt29',5:'readDouble',6:'readAmf3String',7:'readAmf3Xml',8:'readAmf3Date',9:'readAmf3Array',10:'readAmf3Object',11:'readAmf3Xml',12:'readByteArray'}},decode:function(i){var f=this,k=f.headers=[],j=f.messages=[],h,g;a=0;c=f.bytes=i;d=f.strings=[];b=f.objects=[];e=f.traits=[];f.version=f.readUInt(2);for(h=f.readUInt(2);h--;){k.push({name:f.readAmf0String(),mustUnderstand:f.readBoolean(),byteLength:f.readUInt(4),value:f.readValue()});d=f.strings=[];b=f.objects=[];e=f.traits=[]}for(g=f.readUInt(2);g--;){j.push({targetURI:f.readAmf0String(),responseURI:f.readAmf0String(),byteLength:f.readUInt(4),body:f.readValue()});d=f.strings=[];b=f.objects=[];e=f.traits=[]}a=0;c=d=b=e=f.bytes=f.strings=f.objects=f.traits=null;return f},decodeValue:function(g){var f=this;c=f.bytes=g;a=0;f.version=3;d=f.strings=[];b=f.objects=[];e=f.traits=[];return f.readValue()},parseXml:function(b){var a;if(window.DOMParser){a=(new DOMParser()).parseFromString(b,'text/xml')}else {a=new ActiveXObject('Microsoft.XMLDOM');a.loadXML(b)}return a},readAmf0Date:function(){var b=new Date(this.readDouble());a+=2;return b},readAmf0Object:function(d){var f=this,e;d=d||{};b.push(d);while((e=f.readAmf0String())||c[a]!==9){d[e]=f.readValue()}a++;return d},readAmf0String:function(){return this.readUtf8(this.readUInt(2))},readAmf0Xml:function(){return this.parseXml(this.readLongString())},readAmf3Array:function(){var d=this,f=d.readUInt29(),g,e,a,c;if(f&1){g=f>>1;e=d.readAmf3String();if(e){a={};b.push(a);do{a[e]=d.readValue()}while(e=d.readAmf3String());for(c=0;c<g;c++){a[c]=d.readValue()}}else {a=[];b.push(a);for(c=0;c<g;c++){a.push(d.readValue())}}}else {a=b[f>>1]}return a},readAmf3Date:function(){var d=this,c=d.readUInt29(),a;if(c&1){a=new Date(d.readDouble());b.push(a)}else {a=b[c>>1]}return a},readAmf3Object:function(){var h=this,d=h.readUInt29(),i=[],m,j,c,k,g,a,n,l,f;if(d&1){m=d&7;if(m===3){c=h.readAmf3String();k=!!(d&8);j=d>>4;for(f=0;f<j;f++){i.push(h.readAmf3String())}g={className:c,dynamic:k,members:i};e.push(g)}else {if((d&3)===1){g=e[d>>2];c=g.className;k=g.dynamic;i=g.members;j=i.length}else {if(m===7){}}}if(c){l=Ext.ClassManager.getByAlias('amf.'+c);a=l?new l():{$className:c}}else {a={}}b.push(a);for(f=0;f<j;f++){a[i[f]]=h.readValue()}if(k){while(n=h.readAmf3String()){a[n]=h.readValue()}}if(!l&&this.converters[c]){a=this.converters[c](a)}}else {a=b[d>>1]}return a},readAmf3String:function(){var c=this,b=c.readUInt29(),a;if(b&1){a=c.readUtf8(b>>1);if(a){d.push(a)}return a}else {return d[b>>1]}},readAmf3Xml:function(){var d=this,c=d.readUInt29(),a;if(c&1){a=d.parseXml(d.readUtf8(c>>1));b.push(a)}else {a=b[c>>1]}return a},readBoolean:function(){return !!c[a++]},readByteArray:function(){var e=this.readUInt29(),d,f;if(e&1){f=a+(e>>1);d=Array.prototype.slice.call(c,a,f);b.push(d);a=f}else {d=b[e>>1]}return d},readDouble:function(){var e=c[a++],h=c[a++],i=e>>7?-1:1,d=(e&127)<<4|h>>4,b=h&15,j=d?1:0,k=6;while(k--){b=b*g+c[a++]}if(!d){if(!b){return 0}d=1}if(d===2047){return b?NaN:Infinity*i}return i*Math.pow(2,d-1023)*(j+f*b)},readEcmaArray:function(){a+=4;return this.readAmf0Object()},readFalse:function(){return !1},readLongString:function(){return this.readUtf8(this.readUInt(4))},readNull:function(){return null},readReference:function(){return b[this.readUInt(2)]},readStrictArray:function(){var c=this,d=c.readUInt(4),a=[];b.push(a);while(d--){a.push(c.readValue())}return a},readTrue:Ext.returnTrue,readTypedObject:function(){var e=this,a=e.readAmf0String(),b,c,d;b=Ext.ClassManager.getByAlias('amf.'+a);c=b?new b():{$className:a};d=e.readAmf0Object(c);if(!b&&this.converters[a]){d=this.converters[a](c)}return d},readUInt:function(e){var d=1,b;b=c[a++];for(;d<e;++d){b=b<<8|c[a++]}return b},readUInt29:function(){var d=c[a++],b;if(d&128){b=c[a++];d=(d&127)<<7|b&127;if(b&128){b=c[a++];d=d<<7|b&127;if(b&128){b=c[a++];d=d<<8|b}}}return d},readUndefined:Ext.emptyFn,readUnsupported:Ext.emptyFn,readUtf8:function(l){var m=a+l,f=[],i=0,k=65535,h=1,j=[],g=0,e,d,b;e=[f];while(a<m){b=c[a++];if(b>127){if(b>239){d=4;b=b&7}else {if(b>223){d=3;b=b&15}else {d=2;b=b&31}}while(--d){b=b<<6|c[a++]&63}}f.push(b);if(++i===k){e.push(f=[]);i=0;h++}}for(;g<h;g++){j.push(String.fromCharCode.apply(String,e[g]))}return j.join('')},readValue:function(){var b=this,d=c[a++];if(d===17){b.version=3;d=c[a++]}return b[b.typeMap[b.version][d]]()},converters:{'flex.messaging.io.ArrayCollection':function(a){return a.source||[]}}}});Ext.define('Ext.data.amf.Reader',{extend:'Ext.data.reader.Json',alias:'reader.amf',requires:['Ext.data.amf.Packet'],messageIndex:0,responseType:'arraybuffer',read:function(f){var d=this,e=f.responseBytes,b,c,a;if(!e){throw 'AMF Reader cannot process the response because it does not contain '+"binary data. Make sure the Proxy's 'binary' config is true."}b=new Ext.data.amf.Packet();b.decode(e);c=b.messages;if(c.length){a=d.readRecords(c[d.messageIndex].body)}else {a=d.nullResultSet;if(b.invalid){a.success=!1}}return a}});Ext.define('Ext.data.amf.Proxy',{extend:'Ext.data.proxy.Ajax',alias:'proxy.amf',requires:['Ext.data.amf.Reader'],binary:!0,reader:'amf'});Ext.define('Ext.data.amf.RemotingMessage',{alias:'data.amf.remotingmessage',config:{$flexType:'flex.messaging.messages.RemotingMessage',body:[],clientId:'',destination:'',headers:[],messageId:'',operation:'',source:'',timestamp:[],timeToLive:[]},constructor:function(a){this.initConfig(a)},encodeMessage:function(){var b=Ext.create('Ext.data.amf.XmlEncoder'),a;a=Ext.copyTo({},this,'$flexType,body,clientId,destination,headers,messageId,operation,source,timestamp,timeToLive',!0);b.writeObject(a);return b.body}});Ext.define('Ext.data.amf.XmlDecoder',{alias:'data.amf.xmldecoder',statics:{readXml:function(b){var a;if(window.DOMParser){a=(new DOMParser()).parseFromString(b,'text/xml')}else {a=new ActiveXObject('Microsoft.XMLDOM');a.loadXML(b)}return a},readByteArray:function(e){var c=[],d,a,b;b=e.firstChild.nodeValue;for(a=0;a<b.length;a=a+2){d=b.substr(a,2);c.push(parseInt(d,16))}return c},readAMF3Value:function(b){var a=Ext.create('Ext.data.amf.Packet');return a.decodeValue(b)},decodeTidFromFlexUID:function(a){var b=a.substr(0,8);return parseInt(b,16)}},constructor:function(a){this.initConfig(a);this.clear()},clear:function(){this.objectReferences=[];this.traitsReferences=[];this.stringReferences=[]},readAmfxMessage:function(f){var e,d,a,c={},b;this.clear();e=Ext.data.amf.XmlDecoder.readXml(f);d=e.getElementsByTagName('amfx')[0];a=d.getElementsByTagName('body')[0];c.targetURI=a.getAttribute('targetURI');c.responseURI=a.getAttribute('responseURI');for(b=0;b<a.childNodes.length;b++){if(a.childNodes.item(b).nodeType!=1){continue}c.message=this.readValue(a.childNodes.item(b));break}return c},readValue:function(a){var b;if(typeof a.normalize==='function'){a.normalize()}if(a.tagName=='null'){return null}else {if(a.tagName=='true'){return !0}else {if(a.tagName=='false'){return !1}else {if(a.tagName=='string'){return this.readString(a)}else {if(a.tagName=='int'){return parseInt(a.firstChild.nodeValue)}else {if(a.tagName=='double'){return parseFloat(a.firstChild.nodeValue)}else {if(a.tagName=='date'){b=new Date(parseFloat(a.firstChild.nodeValue));this.objectReferences.push(b);return b}else {if(a.tagName=='dictionary'){return this.readDictionary(a)}else {if(a.tagName=='array'){return this.readArray(a)}else {if(a.tagName=='ref'){return this.readObjectRef(a)}else {if(a.tagName=='object'){return this.readObject(a)}else {if(a.tagName=='xml'){return Ext.data.amf.XmlDecoder.readXml(a.firstChild.nodeValue)}else {if(a.tagName=='bytearray'){return Ext.data.amf.XmlDecoder.readAMF3Value(Ext.data.amf.XmlDecoder.readByteArray(a))}}}}}}}}}}}}}return null},readString:function(a){var b;if(a.getAttributeNode('id')){return this.stringReferences[parseInt(a.getAttribute('id'))]}b=(a.firstChild?a.firstChild.nodeValue:'')||'';this.stringReferences.push(b);return b},readTraits:function(a){var d=[],b,c;if(a===null){return null}if(a.getAttribute('externalizable')=='true'){return null}if(a.getAttributeNode('id')){return this.traitsReferences[parseInt(a.getAttributeNode('id').value)]}c=a.childNodes;for(b=0;b<c.length;b++){if(c.item(b).nodeType!=1){continue}d.push(this.readValue(c.item(b)))}this.traitsReferences.push(d);return d},readObjectRef:function(a){var b=parseInt(a.getAttribute('id'));return this.objectReferences[b]},readObject:function(c){var b,i=[],h,e,f,g,j,k,d=null,a;a=c.getAttribute('type');if(a){d=Ext.ClassManager.getByAlias('amfx.'+a)}b=d?new d():a?{$className:a}:{};if(!d&&this.converters[a]){b=this.converters[a](this,c);return b}h=c.getElementsByTagName('traits')[0];i=this.readTraits(h);this.objectReferences.push(b);f=0;for(e=0;e<c.childNodes.length;e++){g=c.childNodes.item(e);if(g.nodeType!=1){continue}if(g.tagName=='traits'){continue}j=i[f];k=this.readValue(g);f=f+1;b[j]=k}return b},readArray:function(f){var b=[],a,h,c,d,i,j,k,e,g;this.objectReferences.push(b);k=parseInt(f.getAttributeNode('length').value);h=0;for(d=0;d<f.childNodes.length;d++){a=f.childNodes.item(d);if(a.nodeType!=1){continue}if(a.tagName=='item'){i=a.getAttributeNode('name').value;e=a.childNodes;for(c=0;c<e.length;c++){g=e.item(c);if(g.nodeType!=1){continue}j=this.readValue(g);break}b[i]=j}else {b[h]=this.readValue(a);h++}}return b},readDictionary:function(f){var e={},a,b,c,g,d,h;h=parseInt(f.getAttribute('length'));this.objectReferences.push(e);a=null;b=null;g=0;for(c=0;c<f.childNodes.length;c++){d=f.childNodes.item(c);if(d.nodeType!=1){continue}if(!a){a=this.readValue(d);continue}b=this.readValue(d);g=g+1;e[a]=b;a=null;b=null}return e},convertObjectWithSourceField:function(d){var a,c,b;for(a=0;a<d.childNodes.length;a++){c=d.childNodes.item(a);if(c.tagName=='bytearray'){b=this.readValue(c);this.objectReferences.push(b);return b}}return null},converters:{'flex.messaging.io.ArrayCollection':function(a,b){return a.convertObjectWithSourceField(b)},'mx.collections.ArrayList':function(a,b){return a.convertObjectWithSourceField(b)},'mx.collections.ArrayCollection':function(a,b){return a.convertObjectWithSourceField(b)}}});Ext.define('Ext.data.amf.XmlEncoder',{alias:'data.amf.xmlencoder',body:'',statics:{generateFlexUID:function(e){var b='',a,d,c;if(e===undefined){e=Ext.Number.randomInt(0,4.294967295E9)}c=(e+4.294967296E9).toString(16).toUpperCase();b=c.substr(c.length-8,8);for(d=0;d<3;d++){b+='-';for(a=0;a<4;a++){b+=Ext.Number.randomInt(0,15).toString(16).toUpperCase()}}b+='-';c=(new Number(new Date())).valueOf().toString(16).toUpperCase();d=0;if(c.length<8){for(a=0;a<c.length-8;a++){d++;b+='0'}}b+=c.substr(-(8-d));for(a=0;a<4;a++){b+=Ext.Number.randomInt(0,15).toString(16).toUpperCase()}return b}},constructor:function(a){this.initConfig(a);this.clear()},clear:function(){this.body=''},encodeUndefined:function(){return this.encodeNull()},writeUndefined:function(){this.write(this.encodeUndefined())},encodeNull:function(){return '<null />'},writeNull:function(){this.write(this.encodeNull())},encodeBoolean:function(b){var a;if(b){a='<true />'}else {a='<false />'}return a},writeBoolean:function(a){this.write(this.encodeBoolean(a))},encodeString:function(b){var a;if(b===''){a='<string />'}else {a='<string>'+b+'</string>'}return a},writeString:function(a){this.write(this.encodeString(a))},encodeInt:function(a){return '<int>'+a.toString()+'</int>'},writeInt:function(a){this.write(this.encodeInt(a))},encodeDouble:function(a){return '<double>'+a.toString()+'</double>'},writeDouble:function(a){this.write(this.encodeDouble(a))},encodeNumber:function(a){var c=536870911,b=-268435455;if(a instanceof Number){a=a.valueOf()}if(a%1===0&&a>=b&&a<=c){return this.encodeInt(a)}else {return this.encodeDouble(a)}},writeNumber:function(a){this.write(this.encodeNumber(a))},encodeDate:function(a){return '<date>'+(new Number(a)).toString()+'</date>'},writeDate:function(a){this.write(this.encodeDate(a))},encodeEcmaElement:function(b,a){var c='<item name="'+b.toString()+'">'+this.encodeObject(a)+'</item>';return c},encodeArray:function(f){var b=[],d,e=[],a,c;for(a in f){if(Ext.isNumeric(a)&&a%1===0){b[a]=this.encodeObject(f[a])}else {e.push(this.encodeEcmaElement(a,f[a]))}}d=b.length;for(a=0;a<b.length;a++){if(b[a]===undefined){d=a;break}}if(d<b.length){for(a=d;a<b.length;a++){if(b[a]!==undefined){e.push(this.encodeEcmaElement(a,b[a]))}}b=b.slice(0,d)}c='<array length="'+b.length+'"';if(e.length>0){c+=' ecma="true"'}c+='>';for(a=0;a<b.length;a++){c+=b[a]}for(a in e){c+=e[a]}c+='</array>';return c},writeArray:function(a){this.write(this.encodeArray(a))},encodeXml:function(b){var a=this.convertXmlToString(b);return '<xml><![CDATA['+a+']]></xml>'},writeXml:function(a){this.write(this.encodeXml(a))},encodeGenericObject:function(e){var d=[],f=[],c=null,b,a;for(b in e){if(b==='$flexType'){c=e[b]}else {d.push(this.encodeString(new String(b)));f.push(this.encodeObject(e[b]))}}if(c){a='<object type="'+c+'">'}else {a='<object>'}if(d.length>0){a+='<traits>';a+=d.join('');a+='</traits>'}else {a+='<traits />'}a+=f.join('');a+='</object>';return a},writeGenericObject:function(a){this.write(this.encodeGenericObject(a))},encodeByteArray:function(c){var a,b,d;if(c.length>0){a='<bytearray>';for(b=0;b<c.length;b++){d=c[b].toString(16).toUpperCase();if(c[b]<16){d='0'+d}a+=d}a+='</bytearray>'}else {a='<bytearray />'}return a},writeByteArray:function(a){this.write(this.encodeByteArray(a))},encodeObject:function(a){var b=typeof a;if(b==='undefined'){return this.encodeUndefined()}else {if(a===null){return this.encodeNull()}else {if(Ext.isBoolean(a)){return this.encodeBoolean(a)}else {if(Ext.isString(a)){return this.encodeString(a)}else {if(b==='number'||a instanceof Number){return this.encodeNumber(a)}else {if(b==='object'){if(a instanceof Date){return this.encodeDate(a)}else {if(Ext.isArray(a)){return this.encodeArray(a)}else {if(this.isXmlDocument(a)){return this.encodeXml(a)}else {return this.encodeGenericObject(a)}}}}else {}}}}}}return null},writeObject:function(a){this.write(this.encodeObject(a))},encodeAmfxRemotingPacket:function(a){var b='<amfx ver="3" xmlns="http://www.macromedia.com/2005/amfx"><body>'+a.encodeMessage()+'</body></amfx>';return b},writeAmfxRemotingPacket:function(a){this.write(this.encodeAmfxRemotingPacket(a))},convertXmlToString:function(b){var a;if(window.XMLSerializer){a=(new window.XMLSerializer()).serializeToString(b)}else {a=b.xml}return a},isXmlDocument:function(a){if(window.DOMParser){if(Ext.isDefined(a.doctype)){return !0}}if(Ext.isString(a.xml)){return !0}return !1},write:function(a){this.body+=a}});Ext.define('Ext.direct.AmfRemotingProvider',{alias:'direct.amfremotingprovider',extend:'Ext.direct.Provider',requires:['Ext.util.MixedCollection','Ext.util.DelayedTask','Ext.direct.Transaction','Ext.direct.RemotingMethod','Ext.data.amf.XmlEncoder','Ext.data.amf.XmlDecoder','Ext.data.amf.Encoder','Ext.data.amf.Packet','Ext.data.amf.RemotingMessage','Ext.direct.ExceptionEvent'],binary:!1,maxRetries:1,timeout:undefined,constructor:function(b){var a=this;a.callParent(arguments);a.namespace=Ext.isString(a.namespace)?Ext.ns(a.namespace):a.namespace||window;a.transactions=new Ext.util.MixedCollection();a.callBuffer=[]},initAPI:function(){var d=this.actions,g=this.namespace,a,b,e,c,h,f;for(a in d){if(d.hasOwnProperty(a)){b=g[a];if(!b){b=g[a]={}}e=d[a];for(c=0,h=e.length;c<h;++c){f=new Ext.direct.RemotingMethod(e[c]);b[f.name]=this.createHandler(a,f)}}}},createHandler:function(c,b){var d=this,a;if(!b.formHandler){a=function(){d.configureRequest(c,b,Array.prototype.slice.call(arguments,0))}}else {a=function(f,a,e){d.configureFormRequest(c,b,f,a,e)}}a.directCfg={action:c,method:b};return a},isConnected:function(){return !!this.connected},connect:function(){var a=this;if(a.url){a.clientId=Ext.data.amf.XmlEncoder.generateFlexUID();a.initAPI();a.connected=!0;a.fireEvent('connect',a);a.DSId=null}else {if(!a.url){}}},disconnect:function(){var a=this;if(a.connected){a.connected=!1;a.fireEvent('disconnect',a)}},runCallback:function(e,b){var c=!!b.status,f=c?'success':'failure',a,d;if(e&&e.callback){a=e.callback;d=Ext.isDefined(b.result)?b.result:b.data;if(Ext.isFunction(a)){a(d,b,c)}else {Ext.callback(a[f],a.scope,[d,b,c]);Ext.callback(a.callback,a.scope,[d,b,c])}}},onData:function(i,j,h){var b=this,d=0,e,g,c,a,f;if(j){g=b.createEvents(h);for(e=g.length;d<e;++d){c=g[d];a=b.getTransaction(c);b.fireEvent('data',b,c);if(a){b.runCallback(a,c,!0);Ext.direct.Manager.removeTransaction(a)}}}else {f=[].concat(i.transaction);for(e=f.length;d<e;++d){a=b.getTransaction(f[d]);if(a&&a.retryCount<b.maxRetries){a.retry()}else {c=new Ext.direct.ExceptionEvent({data:null,transaction:a,code:Ext.direct.Manager.exceptions.TRANSPORT,message:'Unable to connect to the server.',xhr:h});b.fireEvent('data',b,c);if(a){b.runCallback(a,c,!1);Ext.direct.Manager.removeTransaction(a)}}}}},getTransaction:function(a){return a&&a.tid?Ext.direct.Manager.getTransaction(a.tid):null},configureRequest:function(h,c,g){var a=this,d=c.getCallData(g),i=d.data,e=d.callback,f=d.scope,b;b=new Ext.direct.Transaction({provider:a,args:g,action:h,method:c.name,data:i,callback:f&&Ext.isFunction(e)?e.bind(f):e});if(a.fireEvent('beforecall',a,b,c)!==!1){Ext.direct.Manager.addTransaction(b);a.queueTransaction(b);a.fireEvent('call',a,b,c)}},getCallData:function(a){if(this.binary){return {targetUri:a.action+'.'+a.method,responseUri:'/'+a.id,body:a.data||[]}}else {return new Ext.data.amf.RemotingMessage({body:a.data||[],clientId:this.clientId,destination:a.action,headers:{DSEndpoint:this.endpoint,DSId:this.DSId||'nil'},messageId:Ext.data.amf.XmlEncoder.generateFlexUID(a.id),operation:a.method,timestamp:0,timeToLive:0})}},sendRequest:function(d){var a=this,c={url:a.url,callback:a.onData,scope:a,transaction:d,timeout:a.timeout},f=0,g,b,e=[],h=[];if(Ext.isArray(d)){for(g=d.length;f<g;++f){e.push(a.getCallData(d[f]))}}else {e.push(a.getCallData(d))}if(a.binary){b=new Ext.data.amf.Encoder({format:0});b.writeAmfPacket(h,e);c.binaryData=b.bytes;c.binary=!0;c.headers={'Content-Type':'application/x-amf'}}else {b=new Ext.data.amf.XmlEncoder();b.writeAmfxRemotingPacket(e[0]);c.xmlData=b.body}Ext.Ajax.request(c)},queueTransaction:function(c){var a=this,b=!1;if(c.form){a.sendFormRequest(c);return}a.callBuffer.push(c);if(b){if(!a.callTask){a.callTask=new Ext.util.DelayedTask(a.combineAndSend,a)}a.callTask.delay(Ext.isNumber(b)?b:10)}else {a.combineAndSend()}},combineAndSend:function(){var a=this.callBuffer,b=a.length;if(b>0){this.sendRequest(b===1?a[0]:a);this.callBuffer=[]}},configureFormRequest:function(b,c,e,a,d){},sendFormRequest:function(a){},createEvents:function(d){var a=null,e=[],f,c=0,b;try{if(this.binary){b=new Ext.data.amf.Packet();a=b.decode(d.responseBytes)}else {b=new Ext.data.amf.XmlDecoder();a=b.readAmfxMessage(d.responseText)}}catch(g){f=new Ext.direct.ExceptionEvent({data:g,xhr:d,code:Ext.direct.Manager.exceptions.PARSE,message:'Error parsing AMF response: \n\n '+a});return [f]}if(this.binary){for(c=0;c<a.messages.length;c++){e.push(this.createEvent(a.messages[c]))}}else {e.push(this.createEvent(a))}return e},createEvent:function(a){var e=a.targetURI.split('/'),d,f,c,b,g=this;if(g.binary){d=e[1];b=2}else {d=Ext.data.amf.XmlDecoder.decodeTidFromFlexUID(a.message.correlationId);b=1}if(e[b]==='onStatus'){c={tid:d,data:g.binary?a.body:a.message};f=Ext.create('direct.exception',c)}else {if(e[b]==='onResult'){c={tid:d,data:g.binary?a.body:a.message.body};f=Ext.create('direct.rpc',c)}else {}}return f}});