forked from johniak/browser-soap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowser-soap-min.js
1 lines (1 loc) · 44.4 KB
/
browser-soap-min.js
1
!function(t){var e=function(){var I={};if(typeof require==="undefined")I.__sr=function(){};else I.__sr=require;return I.__r=function(t){t=I[t];return null===t.sts&&t.load.call(),t.mod.exports},I.https={sts:1,mod:{exports:I.__sr("https")}},I.http={sts:1,mod:{exports:I.__sr("http")}},I.util={sts:1,mod:{exports:I.__sr("util")}},I.fs={sts:1,mod:{exports:I.__sr("fs")}},I.crypto={sts:1,mod:{exports:I.__sr("crypto")}},I.a={sts:null,mod:{exports:{}},load:function(){var t=I.a.mod;t.exports;I.__sr.resolve,I.a.sts=0,t.exports.decode=function(t,e,n,s){e=e||"&",n=n||"=";var i={};if("string"!=typeof t||0===t.length)return i;var r=/\+/g;t=t.split(e);e=1e3;s&&"number"==typeof s.maxKeys&&(e=s.maxKeys);var o=t.length;0<e&&e<o&&(o=e);for(var a=0;a<o;++a){var p,h=t[a].replace(r,"%20"),c=h.indexOf(n),u=0<=c?(p=h.substr(0,c),h.substr(c+1)):(p=h,""),l=decodeURIComponent(p),c=decodeURIComponent(u);h=i,u=l,Object.prototype.hasOwnProperty.call(h,u)?Array.isArray(i[l])?i[l].push(c):i[l]=[i[l],c]:i[l]=c}return i};function r(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}t.exports.encode=function(n,s,i,t){return s=s||"&",i=i||"=",null===n&&(n=void 0),"object"==typeof n?Object.keys(n).map(function(t){var e=encodeURIComponent(r(t))+i;return Array.isArray(n[t])?n[t].map(function(t){return e+encodeURIComponent(r(t))}).join(s):e+encodeURIComponent(r(n[t]))}).join(s):t?encodeURIComponent(r(t))+i+encodeURIComponent(r(n)):""},I.a.sts=1}.bind(this)},I.b={sts:null,mod:{exports:{}},load:function(){function t(t){var e={"./querystring":"a"}[t];return e?I.__r(e):I.__sr(t)}var e=I.b.mod,n=e.exports;t.resolve=I.__sr.resolve,I.b.sts=0,(n=e.exports).parse=u,n.resolve=function(t,e){return l(s(t,e))},n.resolveObject=s,n.format=l;var m=/^([a-z0-9]+:)/,_=/:[0-9]+$/,f=["/","?",";","#"],d={file:!0,"file:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=t("./querystring");function u(t,e,n){if(t&&"object"==typeof t&&t.href)return t;var s,i={href:t},r=t,t=m.exec(r);if(t&&(t=t[0],i.protocol=t,r=r.substr(t.length)),(n||t||r.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(s="//"===r.substr(0,2))||t&&d[t]||(r=r.substr(2),i.slashes=!0)),!d[t]&&(s||t&&!E[t])){for(var o=-1,a=0,p=f.length;a<p;a++){var h=r.indexOf(f[a]);-1!==h&&(o<0||h<o)&&(o=h)}r=-1!==o?(i.host=r.substr(0,o),r.substr(o)):(i.host=r,"");for(var c=function(t){var e={},n=t.indexOf("@");-1!==n&&(e.auth=t.substr(0,n),t=t.substr(n+1));n=_.exec(t);n&&(n=n[0],e.port=n.substr(1),t=t.substr(0,t.length-n.length));t&&(e.hostname=t);return e}(i.host),u=Object.keys(c),a=0,p=u.length;a<p;a++){var l=u[a];i[l]=c[l]}i.hostname=i.hostname||""}t=r.indexOf("#");-1!==t&&(i.hash=r.substr(t),r=r.slice(0,t));t=r.indexOf("?");return-1!==t?(i.search=r.substr(t),i.query=r.substr(t+1),e&&(i.query=y.parse(i.query)),r=r.slice(0,t)):e&&(i.query={}),r&&(i.pathname=r),i.path=i.pathname+i.search,i}function l(t){"string"==typeof t&&(t=u(t));var e=t.protocol||"",n=void 0!==t.host?t.host:void 0!==t.hostname&&(t.auth?t.auth+"@":"")+t.hostname+(t.port?":"+t.port:""),s=t.pathname||"",i=t.search||t.query&&"?"+("object"==typeof t.query?y.stringify(t.query):String(t.query))||"",r=t.hash||"";return e&&":"!==e.substr(-1)&&(e+=":"),t.slashes||(!e||E[e])&&!1!==n?(n="//"+(n||""),s&&"/"!==s.charAt(0)&&(s="/"+s)):n=n||"",r&&"#"!==r.charAt(0)&&(r="#"+r),i&&"?"!==i.charAt(0)&&(i="?"+i),e+n+s+i+r}function s(t,e){if(!t)return e;if(t=u(l(t),!1,!0),e=u(l(e),!1,!0),t.hash=e.hash,""===e.href)return t;if(e.slashes&&!e.protocol)return e.protocol=t.protocol,e;if(e.protocol&&e.protocol!==t.protocol){if(!E[e.protocol])return e;if(t.protocol=e.protocol,!e.host&&!d[e.protocol]){for(var n=(e.pathname||"").split("/");n.length&&!(e.host=n.shift()););e.host||(e.host=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),e.pathname=n.join("/")}return t.pathname=e.pathname,t.search=e.search,t.query=e.query,t.host=e.host||"",delete t.auth,delete t.hostname,t.port=e.port,t}var s=t.pathname&&"/"===t.pathname.charAt(0),i=void 0!==e.host||e.pathname&&"/"===e.pathname.charAt(0),r=i||s||t.host&&e.pathname,o=r,a=t.pathname&&t.pathname.split("/")||[],n=e.pathname&&e.pathname.split("/")||[],s=t.protocol&&!E[t.protocol]&&void 0!==t.host;if(s&&(delete t.hostname,delete t.auth,delete t.port,t.host&&(""===a[0]?a[0]=t.host:a.unshift(t.host)),delete t.host,e.protocol&&(delete e.hostname,delete e.auth,delete e.port,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),delete e.host),r=r&&(""===n[0]||""===a[0])),i)t.host=(e.host||""===e.host?e:t).host,t.search=e.search,t.query=e.query,a=n;else if(n.length)(a=a||[]).pop(),a=a.concat(n),t.search=e.search,t.query=e.query;else if("search"in e)return s&&(t.host=a.shift()),t.search=e.search,t.query=e.query,t;if(!a.length)return delete t.pathname,t;for(var p=a.slice(-1)[0],i=(t.host||e.host)&&("."===p||".."===p)||""===p,h=0,c=a.length;0<=c;c--)"."==(p=a[c])?a.splice(c,1):".."===p?(a.splice(c,1),h++):h&&(a.splice(c,1),h--);if(!r&&!o)for(;h--;)a.unshift("..");!r||""===a[0]||a[0]&&"/"===a[0].charAt(0)||a.unshift(""),i&&"/"!==a.join("/").substr(-1)&&a.push("");i=""===a[0]||a[0]&&"/"===a[0].charAt(0);return s&&(t.host=i?"":a.shift()),(r=r||t.host&&a.length)&&!i&&a.unshift(""),t.pathname=a.join("/"),t}I.b.sts=1}.bind(this)},I.c={sts:null,mod:{exports:{}},load:function(){var t=I.c.mod;t.exports;I.__sr.resolve,I.c.sts=0;var c={x:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(var t,e=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],n=0;n<e.length;n++)try{t=new ActiveXObject(e[n]);break}catch(t){}return t},send:function(t,e,n,s,i,r){void 0===r&&(r=!0);var o=c.x();o.open(n,t,r),o.onreadystatechange=function(){4==o.readyState&&e(o)};for(var a=Object.keys(i),p=0;p<a.length;p++){var h=a[p];o.setRequestHeader(h,i[h])}o.send(s)}};t.exports=c,I.c.sts=1}.bind(this)},I.d={sts:null,mod:{exports:{}},load:function(){function u(t){var e={"./url":"b","./ajax":"c",https:"https",http:"http"}[t];return e?I.__r(e):I.__sr(t)}var t=I.d.mod.exports;u.resolve=I.__sr.resolve,I.d.sts=0;var l=u("./url"),m=u("./ajax");t.request=function(t,e,s,n,i){if("undefined"!=typeof window){for(var r in h={Accept:"text/html,application/xhtml+xml,application/xml","Content-Type":"application/x-www-form-urlencoded"},n=n||{})h[r]=n[r];m.send(t,function(t){var e={statusCode:t.status},n=Math.floor(t.status/100);s(2===n?null:"Eroor:: "+t.status,e,t.responseText)},e?"POST":"GET",e,h)}else{var o=l.parse(t),a="https:"==o.protocol,p=o.hostname,t=(parseInt(o.port||(a?443:80)),[o.pathname||"/",o.search||"",o.hash||""].join(""),e?"POST":"GET"),h={"User-Agent":"node-soap/0.2.0",Accept:"text/html,application/xhtml+xml,application/xml","Accept-Encoding":"none","Accept-Charset":"utf-8",Connection:"close",Host:p};for(r in"string"==typeof e&&(h["Content-Length"]=e.lenght),n=n||{})h[r]=n[r];var c=o;for(r in c.method=t,c.headers=h,i=i||{})c[r]=i[r];a=u(a?"https":"http").request(c,function(t,e){e="";t.on("data",function(t){e+=t}),t.on("end",function(){s(null,t,e)})});a.on("error",s),a.end(e)}},I.d.sts=1}.bind(this)},I.e={sts:null,mod:{exports:{}},load:function(){var t=I.e.mod;t.exports;I.__sr.resolve,I.e.sts=0,t.exports=function(t,e){if(1!=!!t)throw console.log(e),new Error(e)},I.e.sts=1}.bind(this)},I.f={sts:null,mod:{exports:{}},load:function(){var t=I.f.mod.exports,e=function(t){var e={"./http":"d","./assert":"e","./url":"b"}[t];return e?I.__r(e):I.__sr(t)};e.resolve=I.__sr.resolve,I.f.sts=0;var f=e("./http"),d=e("./assert"),e=(e("./url"),function(t,e){this.wsdl=t,this._initializeServices(e)});e.prototype.setEndpoint=function(t){this.endpoint=t,this._initializeServices(t)},e.prototype.describe=function(){this.wsdl.definitions.types;return this.wsdl.describeServices()},e.prototype.setSecurity=function(t){this.security=t},e.prototype.setSOAPAction=function(t){this.SOAPAction=t},e.prototype._initializeServices=function(t){var e,n=this.wsdl.definitions.services;for(e in n)this[e]=this._defineService(n[e],t)},e.prototype._defineService=function(t,e){var n,s=t.ports,i={};for(n in s)i[n]=this._definePort(s[n],e||s[n].location);return i},e.prototype._definePort=function(t,e){var n,s=e,i=t.binding.methods,r={};for(n in i)r[n]=this._defineMethod(i[n],s),this[n]||(this[n]=r[n]);return r},e.prototype._defineMethod=function(e,n){var i=this;return function(t,s){"function"==typeof t&&(s=t,t={}),i._invoke(e,t,n,function(t,e,n){s(t,e,n)})}},e.prototype._invoke=function(t,arguments,e,i){var n,r=this,o=t.$name,s=t.input,a=t.output,p=t.style,h=this.wsdl.definitions,c=h.$targetNamespace,u="",l="",m={SOAPAction:this.SOAPAction?this.SOAPAction(c,o):(c.lastIndexOf("/")!=c.length-1?c+"/":c)+o,"Content-Type":"text/xml; charset=utf-8"},_={},h=function(t,e){for(var n in t)if(t[n]===e)return n}(h.xmlns,c);r.security&&r.security.addHeaders&&r.security.addHeaders(m),r.security&&r.security.addOptions&&r.security.addOptions(_),s.parts?(d(!p||"rpc"==p,"invalid message definition for document style binding"),l=r.wsdl.objectToRpcXML(o,arguments,h,c),"encoded"===t.inputSoap&&(u='soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ')):l="string"==typeof arguments?arguments:(d(!p||"document"==p,"invalid message definition for rpc style binding"),r.wsdl.objectToDocumentXML(s.$name,arguments,s.targetNSAlias,s.targetNamespace)),n='<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" '+u+this.wsdl.xmlnsInEnvelope+"><soap:Header>"+(r.security?r.security.toXML():"")+"</soap:Header><soap:Body>"+l+"</soap:Body></soap:Envelope>",f.request(e,n,function(t,e,n){if(t)i(t,n?r.wsdl.xmlToObject(n):null,n);else{try{var s=r.wsdl.xmlToObject(n)}catch(t){return i(t,e,n)}e=(e=s.Body[a.$name])||s.Body[o+"Response"];i(null,e,n)}},m,_)},t.Client=e,I.f.sts=1}.bind(this)},I.g={sts:null,mod:{exports:{}},load:function(){function h(t){var e={util:"util",fs:"fs"}[t];return e?I.__r(e):I.__sr(t)}var t=I.g.mod.exports;h.resolve=I.__sr.resolve,I.g.sts=0,function(){var a=function(t){t=p.replace(t,null,null,"\r\n","\n"),t=p.replace(t,null,null,"\r","\n"),this.m_xml=t,this.m_iP=0,this.m_iState=a._STATE_PROLOG,this.m_stack=new e,this._clearAttributes(),this.m_pause=!1,this.m_preInterruptIState=a._STATE_PROLOG,this.m_namespaceList=new Array,this.m_chunkTransitionContinuation=null};a._NONE=0,a._ELM_B=1,a._ELM_E=2,a._ELM_EMP=3,a._ATT=4,a._TEXT=5,a._ENTITY=6,a._PI=7,a._CDATA=8,a._COMMENT=9,a._DTD=10,a._ERROR=11,a._INTERRUPT=12,a._CONT_XML=0,a._CONT_ALT=1,a._ATT_NAME=0,a._ATT_VAL=1,a._STATE_PROLOG=1,a._STATE_DOCUMENT=2,a._STATE_MISC=3,a._errs=new Array,a._errs[a.ERR_CLOSE_PI=0]="PI: missing closing sequence",a._errs[a.ERR_CLOSE_DTD=1]="DTD: missing closing sequence",a._errs[a.ERR_CLOSE_COMMENT=2]="Comment: missing closing sequence",a._errs[a.ERR_CLOSE_CDATA=3]="CDATA: missing closing sequence",a._errs[a.ERR_CLOSE_ELM=4]="Element: missing closing sequence",a._errs[a.ERR_CLOSE_ENTITY=5]="Entity: missing closing sequence",a._errs[a.ERR_PI_TARGET=6]="PI: target is required",a._errs[a.ERR_ELM_EMPTY=7]="Element: cannot be both empty and closing",a._errs[a.ERR_ELM_NAME=8]='Element: name must immediatly follow "<"',a._errs[a.ERR_ELM_LT_NAME=9]='Element: "<" not allowed in element names',a._errs[a.ERR_ATT_VALUES=10]="Attribute: values are required and must be in quotes",a._errs[a.ERR_ATT_LT_NAME=11]='Element: "<" not allowed in attribute names',a._errs[a.ERR_ATT_LT_VALUE=12]='Attribute: "<" not allowed in attribute values',a._errs[a.ERR_ATT_DUP=13]="Attribute: duplicate attributes not allowed",a._errs[a.ERR_ENTITY_UNKNOWN=14]="Entity: unknown entity",a._errs[a.ERR_INFINITELOOP=15]="Infininte loop",a._errs[a.ERR_DOC_STRUCTURE=16]="Document: only comments, processing instructions, or whitespace allowed outside of document element",a._errs[a.ERR_ELM_NESTING=17]="Element: must be nested correctly",a.prototype.continueParsing=function(t){this.m_chunkTransitionContinuation&&(t=this.m_chunkTransitionContinuation+t),t=p.replace(t,null,null,"\r\n","\n"),t=p.replace(t,null,null,"\r","\n"),this.m_xml=t,this.m_iP=0,this.m_iState=a._STATE_DOCUMENT,this.m_pause=!1,this.m_preInterruptIState=a._STATE_PROLOG,this.m_chunkTransitionContinuation=null},a.prototype._addAttribute=function(t,e){this.m_atts[this.m_atts.length]=new Array(t,e)},a.prototype._checkStructure=function(t){if(a._STATE_PROLOG==this.m_iState){if((a._TEXT==t||a._ENTITY==t)&&-1!=p.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd()))return this._setErr(a.ERR_DOC_STRUCTURE);a._ELM_B!=t&&a._ELM_EMP!=t||(this.m_iState=a._STATE_DOCUMENT)}if(a._STATE_DOCUMENT==this.m_iState){if(a._ELM_B!=t&&a._ELM_EMP!=t||this.m_stack.push(this.getName()),a._ELM_E==t||a._ELM_EMP==t){var e=this.m_stack.pop();if(null==e||e!=this.getName())return this._setErr(a.ERR_ELM_NESTING)}if(0==this.m_stack.count())return this.m_iState=a._STATE_MISC,t}if(a._STATE_MISC==this.m_iState){if(a._ELM_B==t||a._ELM_E==t||a._ELM_EMP==t||a.EVT_DTD==t)return this._setErr(a.ERR_DOC_STRUCTURE);if((a._TEXT==t||a._ENTITY==t)&&-1!=p.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd()))return this._setErr(a.ERR_DOC_STRUCTURE)}return t},a.prototype._clearAttributes=function(){this.m_atts=new Array},a.prototype._findAttributeIndex=function(t){for(var e=0;e<this.m_atts.length;e++)if(this.m_atts[e][a._ATT_NAME]==t)return e;return-1},a.prototype.getAttributeCount=function(){return this.m_atts?this.m_atts.length:0},a.prototype.getAttributeName=function(t){return t<0||t>=this.m_atts.length?null:this.m_atts[t][a._ATT_NAME]},a.prototype.getAttributeValue=function(t){return t<0||t>=this.m_atts.length?null:this.m_atts[t][a._ATT_VAL].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")},a.prototype.getAttributeValueByName=function(t){return this.getAttributeValue(this._findAttributeIndex(t))},a.prototype.getColumnNumber=function(){return p.getColumnNumber(this.m_xml,this.m_iP)},a.prototype.getContent=function(){return this.m_cSrc==a._CONT_XML?this.m_xml:this.m_cAlt},a.prototype.getContentBegin=function(){return this.m_cB},a.prototype.getContentEnd=function(){return this.m_cE},a.prototype.getLineNumber=function(){return p.getLineNumber(this.m_xml,this.m_iP)},a.prototype.getName=function(){return this.m_name},a.prototype.pause=function(){this.m_pause=!0},a.prototype.resume=function(){this.m_pause=!1,this.m_iState=this.m_preInterruptIState},a.prototype.next=function(){return this.m_pause?(this.m_preInterruptIState=this.m_iState,a._INTERRUPT):this._checkStructure(this._parse())},a.prototype._parse=function(){if(this.m_iP==this.m_xml.length)return a._NONE;function t(t,e,n){for(var s=0;s<t.length;s++)if(t.charAt(s)!=e.charAt(n+s))return-1;return n}var e=this.m_xml.charAt(this.m_iP);return"<"!==e&&"&"!==e?this._parseText(this.m_iP):this.m_iP==t("<?",this.m_xml,this.m_iP)?this._parsePI(this.m_iP+2):this.m_iP==t("<!DOCTYPE",this.m_xml,this.m_iP)?this._parseDTD(this.m_iP+9):this.m_iP==t("\x3c!--",this.m_xml,this.m_iP)?this._parseComment(this.m_iP+4):this.m_iP==t("<![CDATA[",this.m_xml,this.m_iP)?this._parseCDATA(this.m_iP+9):this.m_iP==t("<",this.m_xml,this.m_iP)?this._parseElement(this.m_iP+1):this.m_iP==t("&",this.m_xml,this.m_iP)?this._parseEntity(this.m_iP+1):this._parseText(this.m_iP)},a.prototype._parsePrefixAndElementName=function(t){return splits=t.split(":",2),{prefix:1===splits.length?"":splits[0],name:1===splits.length?t:splits[1]}},a.prototype._parseNamespacesAndAtts=function(t){that=this;var e=[],n=[];return t.map(function(t){return"xmlns"===t[0].slice(0,5)?e.push({prefix:t[0].slice(6),uri:t[1],scopetag:that.m_name}):n.push(t),"not used"}),this.m_namespaceList=this.m_namespaceList.concat(e),[n,e.map(function(t){return[t.prefix,t.uri]})]},a.prototype._getContextualNamespace=function(t){if(""!==t)for(n in this.m_namespaceList)if((n=this.m_namespaceList[n]).prefix===t)return n.uri;for(var e=this.m_namespaceList.length-1;0<=e;e--){var n=this.m_namespaceList[e];if(""===n.prefix)return n.uri}return""},a.prototype._removeExpiredNamesapces=function(e){var n=[];this.m_namespaceList.map(function(t){t.scopetag!==e&&n.push(t)}),this.m_namespaceList=n},a.prototype._parseAttribute=function(t,e){var n,s,i,r;return this.m_cAlt="",-1==(n=p.indexOfNonWhitespace(this.m_xml,t,e))||e<=n?n:-1==(i=this.m_xml.indexOf("=",n))||e<i?this._setErr(a.ERR_ATT_VALUES):(r=p.lastIndexOfNonWhitespace(this.m_xml,n,i),-1==(t=p.indexOfNonWhitespace(this.m_xml,i+1,e))||e<t?this._setErr(a.ERR_ATT_VALUES):(i=this.m_xml.charAt(t),-1==p.QUOTES.indexOf(i)||-1==(s=this.m_xml.indexOf(i,t+1))||e<s?this._setErr(a.ERR_ATT_VALUES):(r=this.m_xml.substring(n,r+1),t=this.m_xml.substring(t+1,s),-1!=r.indexOf("<")?this._setErr(a.ERR_ATT_LT_NAME):-1!=t.indexOf("<")?this._setErr(a.ERR_ATT_LT_VALUE):(t=p.replace(t,null,null,"\n"," "),t=p.replace(t,null,null,"\t"," "),iRet=this._replaceEntities(t),iRet==a._ERROR?iRet:(t=this.m_cAlt,-1!=this._findAttributeIndex(r)?this._setErr(a.ERR_ATT_DUP):(this._addAttribute(r,t),this.m_iP=s+2,a._ATT))))))},a.prototype._parseCDATA=function(t){var e=this.m_xml.indexOf("]]>",t);return-1==e?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-9),a._INTERRUPT):(this._setContent(a._CONT_XML,t,e),this.m_iP=e+3,a._CDATA)},a.prototype._parseComment=function(t){var e=this.m_xml.indexOf("--\x3e",t);return-1==e?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-4),a._INTERRUPT):(this._setContent(a._CONT_XML,t,e),this.m_iP=e+3,a._COMMENT)},a.prototype._parseDTD=function(t){var e,n,s,i=this.m_xml.indexOf(">",t);if(-1==i)return this.m_chunkTransitionContinuation=this.m_xml.slice(t-9),a._INTERRUPT;for(e=-1!=(n=this.m_xml.indexOf("[",t))&&n<i?"]>":">";;){if(i==s)return this._setErr(a.ERR_INFINITELOOP);if(s=i,-1==(i=this.m_xml.indexOf(e,t)))return this._setErr(a.ERR_CLOSE_DTD);if("]]>"!=this.m_xml.substring(i-1,i+2))break}return this.m_iP=i+e.length,a._DTD},a.prototype._parseElement=function(t){var e,n,s,i,r,o;if(util=h("util"),n=e=this.m_xml.indexOf(">",t),-1==e)return this.m_chunkTransitionContinuation=this.m_xml.slice(t-1),a._INTERRUPT;if("/"==this.m_xml.charAt(t)?(i=a._ELM_E,t++):i=a._ELM_B,"/"==this.m_xml.charAt(e-1)){if(i==a._ELM_E)return this._setErr(a.ERR_ELM_EMPTY);i=a._ELM_EMP,n--}if(n=p.lastIndexOfNonWhitespace(this.m_xml,t,n),e-t!=1&&p.indexOfNonWhitespace(this.m_xml,t,n)!=t)return this._setErr(a.ERR_ELM_NAME);if(this._clearAttributes(),-1==(r=p.indexOfWhitespace(this.m_xml,t,n)))r=n+1;else for(this.m_iP=r;this.m_iP<n;){if(this.m_iP==o)return this._setErr(a.ERR_INFINITELOOP);if(o=this.m_iP,(s=this._parseAttribute(this.m_iP,n))==a._ERROR)return s}return-1!=(r=this.m_xml.substring(t,r)).indexOf("<")?this._setErr(a.ERR_ELM_LT_NAME):(this.m_name=r,this.m_iP=e+1,i)},a.prototype._parseEntity=function(t){var e=this.m_xml.indexOf(";",t);return-1==e?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-1),a._INTERRUPT):(this.m_iP=e+1,this._replaceEntity(this.m_xml,t,e))},a.prototype._parsePI=function(t){var e,n,s,i=this.m_xml.indexOf("?>",t);return-1==i?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-2),a._INTERRUPT):-1==(e=p.indexOfNonWhitespace(this.m_xml,t,i))?this._setErr(a.ERR_PI_TARGET):(-1==(n=p.indexOfWhitespace(this.m_xml,e,i))&&(n=i),-1==(s=p.indexOfNonWhitespace(this.m_xml,n,i))&&(s=i),-1==(t=p.lastIndexOfNonWhitespace(this.m_xml,s,i))&&(t=i-1),this.m_name=this.m_xml.substring(e,n),this._setContent(a._CONT_XML,s,t+1),this.m_iP=i+2,a._PI)},a.prototype._parseText=function(t){for(var e,n=t;n<this.m_xml.length&&("<"!==(e=this.m_xml.charAt(n))&&"&"!==e);++n);return this._setContent(a._CONT_XML,t,n),this.m_iP=n,a._TEXT},a.prototype._replaceEntities=function(t,e,n){if(p.isEmpty(t))return"";e=e||0,n=n||t.length;for(var s="",i=t.indexOf("&",e),r=e;0<i&&i<n;){if(s+=t.substring(r,i),0==(r=t.indexOf(";",i)+1)||n<r)return this._setErr(a.ERR_CLOSE_ENTITY);if(iRet=this._replaceEntity(t,i+1,r-1),iRet==a._ERROR)return iRet;s+=this.m_cAlt,i=t.indexOf("&",r)}return r!=n&&(s+=t.substring(r,n)),this._setContent(a._CONT_ALT,s),a._ENTITY},a.prototype._replaceEntity=function(t,e,n){if(p.isEmpty(t))return-1;switch(e=e||0,n=n||t.length,t.substring(e,n)){case"amp":strEnt="&";break;case"lt":strEnt="<";break;case"gt":strEnt=">";break;case"apos":strEnt="'";break;case"quot":strEnt='"';break;case"nbsp":strEnt="";break;case"lt":strEnt="<";break;case"gt":strEnt=">";break;case"amp":strEnt="&";break;case"cent":strEnt="¢";break;case"pound":strEnt="£";break;case"yen":strEnt="¥";break;case"euro":strEnt="€";break;case"sect":strEnt="§";break;case"copy":strEnt="©";break;case"reg":strEnt="®";break;default:strEnt="#"==t.charAt(e)?String.fromCharCode(parseInt(t.substring(e+1,n))):" "}return this._setContent(a._CONT_ALT,strEnt),a._ENTITY},a.prototype._setContent=function(t){var e=arguments;a._CONT_XML==t?(this.m_cAlt=null,this.m_cB=e[1],this.m_cE=e[2]):(this.m_cAlt=e[1],this.m_cB=0,this.m_cE=e[1].length),this.m_cSrc=t},a.prototype._setErr=function(t){t=a._errs[t];return this.m_cAlt=t,this.m_cB=0,this.m_cE=t.length,this.m_cSrc=a._CONT_ALT,a._ERROR};function r(t){function e(){}var n=new function(){};e.prototype.onStartDocument=function(t){n.onStartDocument=t},e.prototype.onEndDocument=function(t){n.onEndDocument=t},e.prototype.onStartElementNS=function(t){n.onStartElementNS=t},e.prototype.onEndElementNS=function(t){n.onEndElementNS=t},e.prototype.onCharacters=function(t){n.onCharacters=t},e.prototype.onCdata=function(t){n.onCdata=t},e.prototype.onComment=function(t){n.onComment=t},e.prototype.onWarning=function(t){n.onWarning=t},e.prototype.onError=function(t){n.onError=t},t(new e),this.m_hndDoc=n,this.m_hndErr=n,this.m_hndLex=n,this.m_interrupted=!1}r.DOC_B=1,r.DOC_E=2,r.ELM_B=3,r.ELM_E=4,r.CHARS=5,r.PI=6,r.CD_B=7,r.CD_E=8,r.CMNT=9,r.DTD_B=10,r.DTD_E=11,r.prototype.parseFile=function(t){var e=h("fs"),n=this;e.readFile(t,function(t,e){n.parseString(e)})},r.prototype.parseString=function(t){util=h("util");var e=this,n=!0,n=e.m_parser?(e.m_parser.continueParsing(t),!0):(e.m_parser=new a(t),!1);e.m_bErr=!1,e.m_bErr||n||e._fireEvent(r.DOC_B),e._parseLoop(),e.m_bErr||e.m_interrupted||e._fireEvent(r.DOC_E),e.m_xml=null,e.m_iP=0,e.m_interrupted=!1},r.prototype.pause=function(){this.m_parser.pause()},r.prototype.resume=function(){this.m_parser.resume(),this.m_interrupted=!1;var t=this;setTimeout(function(){t._parseLoop(),t.m_bErr||t.m_interrupted||t._fireEvent(r.DOC_E)},0)},r.prototype.setDocumentHandler=function(t){this.m_hndDoc=t},r.prototype.setErrorHandler=function(t){this.m_hndErr=t},r.prototype.setLexicalHandler=function(t){this.m_hndLex=t},r.prototype.getColumnNumber=function(){return this.m_parser.getColumnNumber()},r.prototype.getLineNumber=function(){return this.m_parser.getLineNumber()},r.prototype.getMessage=function(){return this.m_strErrMsg},r.prototype.getPublicId=function(){return null},r.prototype.getSystemId=function(){return null},r.prototype.getLength=function(){return this.m_parser.getAttributeCount()},r.prototype.getName=function(t){return this.m_parser.getAttributeName(t)},r.prototype.getValue=function(t){return this.m_parser.getAttributeValue(t)},r.prototype.getValueByName=function(t){return this.m_parser.getAttributeValueByName(t)},r.prototype._fireError=function(t){this.m_strErrMsg=t,this.m_bErr=!0,this.m_hndErr&&this.m_hndErr.onError&&this.m_hndErr.onError(this.m_strErrMsg)},r.prototype._fireEvent=function(t){var e,n,s=arguments,i=s.length-1;this.m_bErr||(r.DOC_B==t?(n="onStartDocument",e=this.m_hndDoc):r.DOC_E==t?(n="onEndDocument",e=this.m_hndDoc):r.ELM_B==t?(n="onStartElementNS",e=this.m_hndDoc):r.ELM_E==t?(n="onEndElementNS",e=this.m_hndDoc):r.CHARS==t?(n="onCharacters",e=this.m_hndDoc):r.PI==t?(n="processingInstruction",e=this.m_hndDoc):r.CD_B==t?(n="onCdata",e=this.m_hndLex):r.CD_E==t?(n="onEndCDATA",e=this.m_hndLex):r.CMNT==t&&(n="onComment",e=this.m_hndLex),e&&e[n]&&(0==i?e[n]():1==i?e[n](s[1]):2==i?e[n](s[1],s[2]):3==i?e[n](s[1],s[2],s[3]):4==i?e[n](s[1],s[2],s[3],s[4]):5==i?e[n](s[1],s[2],s[3],s[4],s[5]):6==i&&e[n](s[1],s[2],s[3],s[4],s[5],s[6])))},r.prototype._parseLoop=function(t){var e;for(t=this.m_parser;!this.m_bErr;)if((e=t.next())==a._ELM_B){theatts=this.m_parser.m_atts,nameobject=t._parsePrefixAndElementName(t.getName()),theattsandnamespace=t._parseNamespacesAndAtts(theatts);var n=t._getContextualNamespace(nameobject.prefix);this._fireEvent(r.ELM_B,nameobject.name,theattsandnamespace[0],""===nameobject.prefix?null:nameobject.prefix,""===n?null:n,theattsandnamespace[1])}else if(e==a._ELM_E){nameobject=t._parsePrefixAndElementName(t.getName());n=t._getContextualNamespace(nameobject.prefix);t._removeExpiredNamesapces(t.getName()),this._fireEvent(r.ELM_E,nameobject.name,""===nameobject.prefix?null:nameobject.prefix,""===n?null:n)}else if(e==a._ELM_EMP){theatts=this.m_parser.m_atts,nameobject=t._parsePrefixAndElementName(t.getName()),theattsandnamespace=t._parseNamespacesAndAtts(theatts);n=t._getContextualNamespace(nameobject.prefix);this._fireEvent(r.ELM_B,nameobject.name,theattsandnamespace[0],""===nameobject.prefix?null:nameobject.prefix,""===n?null:n,theattsandnamespace[1],!0),t._removeExpiredNamesapces(t.getName()),this._fireEvent(r.ELM_E,nameobject.name,""===nameobject.prefix?null:nameobject.prefix,""===n?null:n,!0)}else if(e==a._TEXT)this._fireEvent(r.CHARS,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(e==a._ENTITY)this._fireEvent(r.CHARS,t.getContent(),t.getContentBegin(),t.getContentEnd()-t.getContentBegin());else if(e==a._PI)this._fireEvent(r.PI,t.getName(),t.getContent().substring(t.getContentBegin(),t.getContentEnd()));else if(e==a._CDATA)this._fireEvent(r.CD_B,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(e==a._COMMENT)this._fireEvent(r.CMNT,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(e!=a._DTD)if(e==a._ERROR)this._fireError(t.getContent());else{if(e==a._INTERRUPT)return void(this.m_interrupted=!0);if(e==a._NONE)return}};var p=function(){};p.WHITESPACE=" \t\n\r",p.QUOTES="\"'",p.getColumnNumber=function(t,e){if(p.isEmpty(t))return-1;e=e||t.length;t=t.substring(0,e).split("\n"),t[t.length-1];return t.length--,e-t.join("\n").length},p.getLineNumber=function(t,e){return p.isEmpty(t)?-1:(e=e||t.length,t.substring(0,e).split("\n").length)},p.indexOfNonWhitespace=function(t,e,n){if(p.isEmpty(t))return-1;e=e||0,n=n||t.length;for(var s=e;s<n;s++)if(-1==p.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},p.indexOfWhitespace=function(t,e,n){if(p.isEmpty(t))return-1;e=e||0,n=n||t.length;for(var s=e;s<n;s++)if(-1!=p.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},p.isEmpty=function(t){return null==t||0==t.length},p.lastIndexOfNonWhitespace=function(t,e,n){if(p.isEmpty(t))return-1;e=e||0;for(var s=(n=n||t.length)-1;e<=s;s--)if(-1==p.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},p.replace=function(t,e,n,s,i){return p.isEmpty(t)?"":(e=e||0,n=n||t.length,t.toString().substring(e,n).split(s).join(i))};var e=function(){this.m_arr=new Array};e.prototype.clear=function(){this.m_arr=new Array},e.prototype.count=function(){return this.m_arr.length},e.prototype.destroy=function(){this.m_arr=null},e.prototype.peek=function(){return 0==this.m_arr.length?null:this.m_arr[this.m_arr.length-1]},e.prototype.pop=function(){if(0==this.m_arr.length)return null;var t=this.m_arr[this.m_arr.length-1];return this.m_arr.length--,t},e.prototype.push=function(t){this.m_arr[this.m_arr.length]=t},t.SaxParser=r}(),I.g.sts=1}.bind(this)},I.h={sts:null,mod:{exports:{}},load:function(){var t=I.h.mod.exports,e=function(t){var e={"node-xml":"g","./http":"d","./url":"b","./assert":"e"}[t];return e?I.__r(e):I.__sr(t)};e.resolve=I.__sr.resolve,I.h.sts=0;var _=e("node-xml"),n=e("./http"),o=e("./url"),h=e("./assert"),p={string:1,boolean:1,decimal:1,float:1,double:1,anyType:1,byte:1,int:1,long:1,short:1,unsignedByte:1,unsignedInt:1,unsignedLong:1,unsignedShort:1,duration:0,dateTime:0,time:0,date:0,gYearMonth:0,gYear:0,gMonthDay:0,gDay:0,gMonth:0,hexBinary:0,base64Binary:0,anyURI:0,QName:0,NOTATION:0};function f(t){var e=null!=t?t.indexOf(":"):-1;return e<0?{namespace:null,name:t}:{namespace:t.substring(0,e),name:t.substring(e+1)}}function c(t){return"string"==typeof t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):t}var a=/^[\s\xA0]+/,d=/[\s\xA0]+$/;var u=function(t,e){var n,s=f(t);for(n in this.nsName=t,this.namespace=s.namespace,this.name=s.name,this.children=[],this.xmlns={},e){var i=/^xmlns:?(.*)$/.exec(n);i?this.xmlns[i[1]]=e[n]:this["$"+n]=e[n]}};u.prototype.deleteFixedAttrs=function(){this.children&&0===this.children.length&&delete this.children,this.xmlns&&0===Object.keys(this.xmlns).length&&delete this.xmlns,delete this.nsName,delete this.namespace,delete this.name},u.prototype.allowedChildren=[],u.prototype.startElement=function(t,e,n){var s;this.allowedChildren&&((s=this.allowedChildren[f(e).name])?t.push(new s(e,n)):this.unexpected(e))},u.prototype.endElement=function(t,e){this.nsName===e&&(t.length<2||(e=t[t.length-2],this!==t[0]&&(function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}(t[0].xmlns,this.xmlns),e.children.push(this),e.addChild(this)),t.pop()))},u.prototype.addChild=function(t){},u.prototype.unexpected=function(t){throw new Error("Found unexpected element ("+t+") inside "+this.nsName)},u.prototype.description=function(t){return this.$name||this.name},u.prototype.init=function(){},u.createSubClass=function(){function t(){e.apply(this,arguments),this.init()}var e=this;return t.prototype.__proto__=e.prototype,t};var s,i=u.createSubClass(),r=u.createSubClass(),l=u.createSubClass(),m=u.createSubClass(),E=u.createSubClass(),y=u.createSubClass(),g=u.createSubClass(),x=u.createSubClass(),T=u.createSubClass(),v=u.createSubClass(),b=u.createSubClass(),C=u.createSubClass(),A=u.createSubClass(),S=u.createSubClass(),R=u.createSubClass(),e=u.createSubClass(),N=u.createSubClass(),O=u.createSubClass(),w={types:[C,"schema"],schema:[b,"element complexType simpleType include import"],element:[i,"annotation complexType"],simpleType:[m,"restriction"],restriction:[E,"enumeration"],enumeration:[y,""],complexType:[g,"annotation sequence all"],sequence:[x,"element"],all:[T,"element"],service:[N,"port documentation"],port:[e,"address"],binding:[R,"_binding SecuritySpec operation"],portType:[S,"operation"],message:[v,"part documentation"],operation:[A,"documentation input output fault _operation"],input:[r,"body SecuritySpecRef documentation header"],output:[l,"body SecuritySpecRef documentation header"],fault:[u,"_fault"],definitions:[O,"types message portType binding service"]};for(s in w){var L=w[s];L[0].prototype.allowedChildren=function(t){var t=t.split(" "),e={};return t.forEach(function(t){e[t.replace(/^_/,"")]=(w[t]||[u])[0]}),e}(L[1])}v.prototype.init=function(){this.element=null,this.parts=null},b.prototype.init=function(){this.complexTypes={},this.types={},this.elements={},this.includes=[]},C.prototype.init=function(){this.schemas={}},A.prototype.init=function(){this.input=null,this.output=null,this.inputSoap=null,this.outputSoap=null,this.style="",this.soapAction=""},S.prototype.init=function(){this.methods={}},R.prototype.init=function(){this.transport="",this.style="",this.methods={}},e.prototype.init=function(){this.location=null},N.prototype.init=function(){this.ports={}},O.prototype.init=function(){"definitions"!==this.name&&this.unexpected(nsName),this.messages={},this.portTypes={},this.bindings={},this.services={},this.schemas={}},b.prototype.addChild=function(t){var e;t.$name in p||("include"===t.name||"import"===t.name?(e=t.$schemaLocation||t.$location)&&this.includes.push({namespace:t.$namespace||t.$targetNamespace||this.$targetNamespace,location:e}):"complexType"===t.name?this.complexTypes[t.$name]=t:"element"===t.name?this.elements[t.$name]=t:t.$name&&(this.types[t.$name]=t),this.children.pop())},C.prototype.addChild=function(t){h(t instanceof b),t.$targetNamespace?this.schemas[t.$targetNamespace]=t:this.schemas[t.includes[0].namespace]=t},r.prototype.addChild=function(t){"body"===t.name&&(this.use=t.$use,"encoded"===this.use&&(this.encodingStyle=t.$encodingStyle),this.children.pop())},l.prototype.addChild=function(t){"body"===t.name&&(this.use=t.$use,"encoded"===this.use&&(this.encodingStyle=t.$encodingStyle),this.children.pop())},A.prototype.addChild=function(t){"operation"===t.name&&(this.soapAction=t.$soapAction||"",this.style=t.$style||"",this.children.pop())},R.prototype.addChild=function(t){"binding"===t.name&&(this.transport=t.$transport,this.style=t.$style,this.children.pop())},e.prototype.addChild=function(t){"address"===t.name&&void 0!==t.$location&&(this.location=t.$location)},O.prototype.addChild=function(t){var e=this;t instanceof C?e.schemas=t.schemas:t instanceof v?e.messages[t.$name]=t:t instanceof S?e.portTypes[t.$name]=t:t instanceof R?"http://schemas.xmlsoap.org/soap/http"!==t.transport&&"http://www.w3.org/2003/05/soap/bindings/HTTP/"!==t.transport||(e.bindings[t.$name]=t):t instanceof N?e.services[t.$name]=t:h(!1,"Invalid child type"),this.children.pop()},v.prototype.postProcess=function(t){var e,n=null,s=this.children||[];for(r in s)if("part"===(e=s[r]).name){n=e;break}if(n){if(n.$element){delete this.parts;var i=(o=f(n.$element)).namespace;this.element=t.schemas[t.xmlns[i]].elements[o.name],this.element.targetNSAlias=i,this.element.targetNamespace=t.xmlns[i],this.children.splice(0,1)}else{this.parts={},delete this.element;for(var r=0;n=this.children[r];r++){h("part"===n.name,"Expected part element");var o=f(n.$type),i=t.xmlns[o.namespace],a=o.name,p=t.schemas[i];this.parts[n.$name]=void 0!==p?t.schemas[i].types[a]||t.schemas[i].complexTypes[a]:n.$type,this.parts[n.$name].namespace=o.namespace,this.parts[n.$name].xmlns=i,this.children.splice(r--,1)}}this.deleteFixedAttrs()}},A.prototype.postProcess=function(t,e){for(var n,s,i=this.children,r=0;n=i[r];r++)"input"!==n.name&&"output"!==n.name||("binding"!==e?(s=f(n.$message).name,(s=t.messages[s]).postProcess(t),s.element?(t.messages[s.element.$name]=s,this[n.name]=s.element):this[n.name]=s):this[n.name]=n,i.splice(r--,1));this.deleteFixedAttrs()},S.prototype.postProcess=function(t){var e=this.children;if(void 0!==e){for(var n,s=0;n=e[s];s++)"operation"==n.name&&(n.postProcess(t,"portType"),this.methods[n.$name]=n,e.splice(s--,1));delete this.$name,this.deleteFixedAttrs()}},R.prototype.postProcess=function(t){var e=f(this.$type).name,e=t.portTypes[e],n=this.style,s=this.children;e.postProcess(t),this.methods=e.methods;for(var i,r,o=0;i=s[o];o++)"operation"==i.name&&(i.postProcess(t,"binding"),s.splice(o--,1),i.style||(i.style=n),(r=this.methods[i.$name]).style=i.style,r.soapAction=i.soapAction,r.inputSoap=i.input||null,r.outputSoap=i.output||null,r.inputSoap&&r.inputSoap.deleteFixedAttrs(),r.outputSoap&&r.outputSoap.deleteFixedAttrs());delete this.$name,delete this.$type,this.deleteFixedAttrs()},N.prototype.postProcess=function(t){for(var e,n,s=this.children,i=t.bindings,r=0;e=s[r];r++)"port"==e.name&&((n=i[f(e.$binding).name])&&(n.postProcess(t),this.ports[e.$name]={location:e.location,binding:n},s.splice(r--,1)));delete this.$name,this.deleteFixedAttrs()},m.prototype.description=function(t){for(var e,n=this.children,s=0;e=n[s];s++)if(e instanceof E)return this.$name+"|"+e.description();return{}},E.prototype.description=function(){return(this.$base?this.$base+"|":"")+this.children.map(function(t){return t.description()}).join(",")},y.prototype.description=function(){return this.$value},g.prototype.description=function(t){for(var e,n=this.children,s=0;e=n[s];s++)if(e instanceof x||e instanceof T)return e.description(t);return{}},i.prototype.description=function(t){var e={},n=this.$name;if(this.$minOccurs!==this.$maxOccurs&&(n+="[]"),this.$type){var s=f(this.$type).name,i=t.xmlns[f(this.$type).namespace],i=(i=t.schemas[i])&&(i.complexTypes[s]||i.types[s]);e[n]=!i||s in p?this.$type:i.description(t)}else{var r=this.children;e[n]={};for(var o,a=0;o=r[a];a++)o instanceof g&&(e[n]=o.description(t))}return e},T.prototype.description=x.prototype.description=function(t){for(var e,n=this.children,s={},i=0;e=n[i];i++){var r,o=e.description(t);for(r in o)s[r]=o[r]}return s},v.prototype.description=function(t){if(this.element)return this.element&&this.element.description(t);t={};return t[this.$name]=this.parts,t},S.prototype.description=function(t){var e,n={};for(e in this.methods){var s=this.methods[e];n[e]=s.description(t)}return n},A.prototype.description=function(t){var e=this.input.description(t),t=this.output.description(t);return{input:e&&e[Object.keys(e)[0]],output:t&&t[Object.keys(t)[0]]}},R.prototype.description=function(t){var e,n={};for(e in this.methods){var s=this.methods[e];n[e]=s.description(t)}return n},N.prototype.description=function(t){var e,n={};for(e in this.ports){var s=this.ports[e];n[e]=s.binding.description(t)}return n};function P(t,e,n){var s,l=this;if(this.uri=e,this.callback=function(){},this.options=n||{},"string"==typeof t)s=this._fromXML;else{if("object"!=typeof t)throw new Error("WSDL constructor takes either an XML string or service definition");s=this._fromServices}setTimeout(function(){s.call(l,t),l.processIncludes(function(t){l.definitions.deleteFixedAttrs();var e=l.services=l.definitions.services;if(e)for(var n in e)e[n].postProcess(l.definitions);var s=l.definitions.complexTypes;if(s)for(var n in s)s[n].deleteFixedAttrs();var i,r=l.definitions.bindings;for(i in r){var o=r[i];if("document"===o.style){var a,p=o.methods,h=o.topElements={};for(a in p){var c=p[a].input.$name,u=p[a].output.$name;h[c]={methodName:a,outputName:u}}}}l.xmlnsInEnvelope=l._xmlnsMap(),l.callback(t,l)})},0)}function M(s,i,r){var o;return"function"==typeof i&&(r=i,i={}),n.request(s,null,function(t,e,n){t?r(t):e&&200==e.statusCode?(o=new P(n,s,i)).onReady(r):r(new Error("Invalid WSDL URL: "+s))}),o}P.prototype.onReady=function(t){t&&(this.callback=t)},P.prototype._processNextInclude=function(n,s){var i=this,r=n.shift();if(!r)return s();M(o.resolve(i.uri,r.location),function(t,e){i.definitions.schemas[r.namespace||e.definitions.$targetNamespace]=e.definitions,i._processNextInclude(n,function(t){s(t)})})},P.prototype.processIncludes=function(t){var e,n=this.definitions.schemas,s=[];for(e in n)var i=n[e],s=s.concat(i.includes||[]);this._processNextInclude(s,t)},P.prototype.describeServices=function(){var t,e={};for(t in this.services){var n=this.services[t];e[t]=n.description(this.definitions)}return e},P.prototype.toXML=function(){return this.xml||""},P.prototype.xmlToObject=function(t){var e,h,n,c=this,s=new _.SaxParser(function(t){e=t}),u=null,i={},l=[{name:null,object:i,schema:{Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}}}],m={};for(n in e.onStartElementNS(function(t,n,e,s,i){t=e?e+":"+t:t;n=n.reduce(function(t,e,n){return t[e[0]]=e[1],t},{}),i.forEach(function(t){var e=t[0],t=t[1];n["xmlns"+(e?":":"")+e]=t});var r=f(t).name,o=l[l.length-1],a=o.schema,p=r;u||"Body"!==o.name||"Fault"===r||((e=c.definitions.messages[r])||(i=!1,/Response$/.test(r)?r=r.replace(/Response$/,""):/Request$/.test(r)?(i=!0,r=r.replace(/Request$/,"")):/Solicit$/.test(r)&&(i=!0,r=r.replace(/Solicit$/,"")),t=(t=c.definitions.portTypes)[Object.keys(t)[0]],r=(i?t.methods[r].input:t.methods[r].output).$name,e=c.definitions.messages[r],c.definitions.messages[p]=c.definitions.messages[r]),a=e.description(c.definitions),u=p),n.href&&(h=n.href.substr(1),m[h]||(m[h]={hrefs:[],obj:null}),m[h].hrefs.push({par:o.object,key:r})),(h=n.id)&&(m[h]||(m[h]={hrefs:[],obj:null})),a&&a[r+"[]"]&&(r+="[]"),l.push({name:p,object:{},schema:a&&a[r],id:n.id})}),e.onEndElementNS(function(t,e,n){t=e?e+":"+t:t;var s=l.pop(),i=s.object,r=l[l.length-1],e=r.object,r=r.schema,t=f(t).name;r&&r[t+"[]"]&&"string"!=typeof r[t+"[]"]?(e[t]||(e[t]=[]),e[t].push(i)):t in e?(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(i)):e[t]=i,s.id&&(m[s.id].obj=i)}),e.onCharacters(function(t){var e,n;(t=t.replace(a,"").replace(d,"")).length&&(t="int"===(n=f((e=l[l.length-1]).schema).name)?parseInt(t,10):"dateTime"===n?new Date(t):"string"!=typeof e.object?t:e.object+t,e.object=t)}),s.parseString(t),m){var r=m[n],o=r.obj;r.hrefs.forEach(function(t){t.par[t.key]=o})}return i.Envelope.Body.Fault,i.Envelope},P.prototype.objectToDocumentXML=function(t,e,n,s){var i={};return i[t]=e,this.objectToXML(i,null,n,s)},P.prototype.objectToRpcXML=function(t,e,n,s){var i,r,o=[],a=this.definitions,n=n||function(t,e){for(var n in t)if(t[n]===e)return n}(a.xmlns,s),s=s||a.xmlns[n];for(i in o.push(["<",n,":",t,">"].join("")),e)"_xmlns"!=i&&(r=e[i],o.push(["<",n,":",i,">"].join("")),o.push("object"==typeof r?this.objectToXML(r):c(r)),o.push(["</",n,":",i,">"].join("")));return o.push(["</",n,":",t,">"].join("")),o.join("")},P.prototype.objectToXML=function(t,e,n,s){var i=[],r="",o=n?n+":":"";if(Array.isArray(t))for(var a,p=0;a=t[p];p++)0<p&&(i.push(["</",o,e,">"].join("")),i.push(["<",o,e,r,">"].join(""))),i.push(this.objectToXML(a,e));else if("object"==typeof t)for(var e in t){var h=t[e];i.push(["<",o,e,r,">"].join("")),i.push(this.objectToXML(h,e,n)),i.push(["</",o,e,">"].join(""))}else t&&i.push(c(t));return i.join("")},P.prototype._parse=function(t){var e,o=this,n=new _.SaxParser(function(t){e=t}),a=[],p=null;return e.onStartElementNS(function(e,n,t,s,i){e=t?t+":"+e:e;n=n.reduce(function(t,e,n){return t[e[0]]=e[1],t},{}),i.forEach(function(t){var e=t[0],t=t[1];n["xmlns"+(e?":":"")+e]=t});var r=a[a.length-1];if(r)try{r.startElement(a,e,n)}catch(t){if(o.options.strict)throw t;a.push(new u(e,n))}else{i=f(e).name;if("definitions"===i)p=new O(e,n);else{if("schema"!==i)throw new Error("Unexpected root element of WSDL or include");p=new b(e,n)}a.push(p)}}),e.onEndElementNS(function(t,e,n){t=e?e+":"+t:t;e=a[a.length-1];h(e,"Unmatched close tag: "+t),e.endElement(a,t)}),e.onWarning(function(t){console.log("<WARNING>"+t+"</WARNING>")}),e.onError(function(t){console.log("<ERROR>"+JSON.stringify(t)+"</ERROR>")}),n.parseString(t),p},P.prototype._fromXML=function(t){this.definitions=this._parse(t),this.xml=t},P.prototype._fromServices=function(t){},P.prototype._xmlnsMap=function(){var t,e=this.definitions.xmlns,n="";for(t in e)if(""!==t){var s=e[t];switch(s){case"http://xml.apache.org/xml-soap":case"http://schemas.xmlsoap.org/wsdl/":case"http://schemas.xmlsoap.org/wsdl/soap/":case"http://schemas.xmlsoap.org/soap/encoding/":case"http://www.w3.org/2001/XMLSchema":continue}~s.indexOf("http://schemas.xmlsoap.org/")||~s.indexOf("http://www.w3.org/")||~s.indexOf("http://xml.apache.org/")||(n+=" xmlns:"+t+'="'+s+'"')}return n},t.open_wsdl=M,t.WSDL=P,I.h.sts=1}.bind(this)},I.i={sts:null,mod:{exports:{}},load:function(){var t=I.i.mod.exports,e=function(t){var e={"./client":"f","./wsdl":"h",crypto:"crypto"}[t];return e?I.__r(e):I.__sr(t)};e.resolve=I.__sr.resolve,I.i.sts=0;var i=e("./client").Client,r=e("./wsdl").open_wsdl,o=e("crypto"),e=e("./wsdl").WSDL,a={};function n(t,e){this._username=t,this._password=e}function s(t,e,n){this._username=t,this._password=e,this._passwordType=n||"PasswordText"}n.prototype.addHeaders=function(t){t.Authorization="Basic "+btoa(this._username+":"+this._password)},n.prototype.toXML=function(){return""};function p(t,e,n){var s=o.createHash("sha1"),t=btoa(t);return s.update(t+e+n),s.digest("base64")}s.prototype.toXML=function(){function t(t){function e(t){return t<10?"0"+t:t}return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z"}var e=new Date,n=t(e),s=t(new Date(e.getTime()+6e5)),e=o.createHash("sha1");e.update(n+Math.random());e=e.digest("base64");return'<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsu:Timestamp wsu:Id="Timestamp-'+n+'"><wsu:Created>'+n+"</wsu:Created><wsu:Expires>"+s+'</wsu:Expires></wsu:Timestamp><wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-'+n+'"><wsse:Username>'+this._username+"</wsse:Username>"+("PasswordText"===this._passwordType?"<wsse:Password>"+this._password+"</wsse:Password>":'<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">'+p(e,n,this._password)+"</wsse:Password>")+'<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+e+"</wsse:Nonce><wsu:Created>"+n+"</wsu:Created></wsse:UsernameToken></wsse:Security>"},t.BasicAuthSecurity=n,t.WSSecurity=s,t.createClient=function(t,e,n,s){"function"==typeof e&&(s=n,n=e,e={}),s=e.endpoint||s,function(n,t,s){"function"==typeof t&&(s=t,t={});var e=a[n];e?s(null,e):r(n,t,function(t,e){return t?s(t):(a[n]=e,void s(null,e))})}(t,e,function(t,e){n(t,e&&new i(e,s))})},t.passwordDigest=p,t.WSDL=e,I.i.sts=1}.bind(this)},I.j={sts:null,mod:{exports:{}},load:function(){function t(t){var e={"./lib/soap":"i"}[t];return e?I.__r(e):I.__sr(t)}var e=I.j.mod;e.exports;t.resolve=I.__sr.resolve,I.j.sts=0,e.exports=t("./lib/soap"),I.j.sts=1}.bind(this)},I.__r("j")}.bind(t)();t["browser-soap"]=e,"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=e)}(this);