@tbisoftware/phone 2.0.6 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"phone.d.ts","sourceRoot":"","sources":["../../src/components/phone.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,UAAU,CAAC;AAwV7D,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,UAAU,2CAW9G"}
1
+ {"version":3,"file":"phone.d.ts","sourceRoot":"","sources":["../../src/components/phone.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,UAAU,CAAC;AA8W7D,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,UAAU,2CAW9G"}
@@ -1,4 +1,9 @@
1
1
  import type { PhoneConfig, PhoneStatus, CallHistoryEntry } from '../types';
2
+ interface IncomingCallInfo {
3
+ session: any;
4
+ callerNumber: string;
5
+ callerName?: string;
6
+ }
2
7
  interface PhoneContextValue {
3
8
  status: PhoneStatus;
4
9
  callNumber: string;
@@ -7,8 +12,13 @@ interface PhoneContextValue {
7
12
  currentCallDuration: number;
8
13
  startCall: (number: string) => void;
9
14
  endCall: () => void;
15
+ answerCall: () => void;
16
+ rejectCall: () => void;
10
17
  isReady: boolean;
11
18
  connectionStatus: 'connecting' | 'connected' | 'disconnected' | 'failed';
19
+ isInitialized: boolean;
20
+ initialize: () => void;
21
+ incomingCall: IncomingCallInfo | null;
12
22
  }
13
23
  interface PhoneProviderProps {
14
24
  config: PhoneConfig;
@@ -16,8 +26,9 @@ interface PhoneProviderProps {
16
26
  onCallStart?: (number: string) => void;
17
27
  onCallEnd?: (number: string, duration: number, status: 'completed' | 'failed') => void;
18
28
  onStatusChange?: (status: PhoneStatus) => void;
29
+ onIncomingCall?: (callerNumber: string, callerName?: string) => void;
19
30
  }
20
- export declare function PhoneProvider({ config, children, onCallStart, onCallEnd, onStatusChange }: PhoneProviderProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function PhoneProvider({ config, children, onCallStart, onCallEnd, onStatusChange, onIncomingCall }: PhoneProviderProps): import("react/jsx-runtime").JSX.Element;
21
32
  export declare function usePhone(): PhoneContextValue;
22
33
  export {};
23
34
  //# sourceMappingURL=PhoneContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneContext.d.ts","sourceRoot":"","sources":["../../src/context/PhoneContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA0J3E,UAAU,iBAAiB;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;CAC5E;AAID,UAAU,kBAAkB;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,KAAK,IAAI,CAAC;IACvF,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACjB,EAAE,kBAAkB,2CAsSpB;AAED,wBAAgB,QAAQ,sBAMvB"}
1
+ {"version":3,"file":"PhoneContext.d.ts","sourceRoot":"","sources":["../../src/context/PhoneContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAoL3E,UAAU,gBAAgB;IACtB,OAAO,EAAE,GAAG,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,iBAAiB;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;IACzE,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACzC;AAID,UAAU,kBAAkB;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,KAAK,IAAI,CAAC;IACvF,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxE;AAED,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,cAAc,EACjB,EAAE,kBAAkB,2CAyYpB;AAED,wBAAgB,QAAQ,sBAMvB"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-Br8w8pI3.cjs");exports.PhoneManager=e.PhoneManager;exports.cn=e.cn;exports.defaultLabels=e.defaultLabels;exports.formatDuration=e.formatDuration;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-1EBiLrV_.cjs");exports.PhoneManager=e.PhoneManager;exports.cn=e.cn;exports.defaultLabels=e.defaultLabels;exports.formatDuration=e.formatDuration;
@@ -1,4 +1,4 @@
1
- import { P as o, c as r, d as s, f } from "../index-TymkBND5.js";
1
+ import { P as o, c as r, d as s, f } from "../index-8z_LWKp3.js";
2
2
  export {
3
3
  o as PhoneManager,
4
4
  r as cn,
@@ -1,4 +1,4 @@
1
- "use strict";function $l(...O){return O.filter(Boolean).join(" ")}function kl(O){const y=Math.floor(O/3600),i=Math.floor(O%3600/60),_=O%60;return y>0?`${y.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}:${_.toString().padStart(2,"0")}`:`${i.toString().padStart(2,"0")}:${_.toString().padStart(2,"0")}`}const ql={calling:"Llamando",waitingResponse:"Esperando respuesta...",cancel:"Cancelar",hangUp:"Colgar",callEnded:"Llamada finalizada",duration:"Duración",inactive:"Inactivo",inCall:"En llamada",placeholder:"Número a llamar",callHistory:"Historial de llamadas",noCallsRegistered:"No hay llamadas registradas",callsRegistered:"llamada(s) registrada(s)",noCalls:"No hay llamadas",startingCall:"Iniciando llamada a",callInProgress:"Ya hay una llamada en curso"};function Gl(O){return O&&O.__esModule&&Object.prototype.hasOwnProperty.call(O,"default")?O.default:O}const Bl="JsSIP",Wl="3.11.1",zn={title:Bl,version:Wl};var Mt,un;function ie(){if(un)return Mt;un=1;const O=zn;return Mt={USER_AGENT:`${O.title} ${O.version}`,SIP:"sip",SIPS:"sips",causes:{CONNECTION_ERROR:"Connection Error",REQUEST_TIMEOUT:"Request Timeout",SIP_FAILURE_CODE:"SIP Failure Code",INTERNAL_ERROR:"Internal Error",BUSY:"Busy",REJECTED:"Rejected",REDIRECTED:"Redirected",UNAVAILABLE:"Unavailable",NOT_FOUND:"Not Found",ADDRESS_INCOMPLETE:"Address Incomplete",INCOMPATIBLE_SDP:"Incompatible SDP",MISSING_SDP:"Missing SDP",AUTHENTICATION_ERROR:"Authentication Error",BYE:"Terminated",WEBRTC_ERROR:"WebRTC Error",CANCELED:"Canceled",NO_ANSWER:"No Answer",EXPIRES:"Expires",NO_ACK:"No ACK",DIALOG_ERROR:"Dialog Error",USER_DENIED_MEDIA_ACCESS:"User Denied Media Access",BAD_MEDIA_DESCRIPTION:"Bad Media Description",RTP_TIMEOUT:"RTP Timeout"},SIP_ERROR_CAUSES:{REDIRECTED:[300,301,302,305,380],BUSY:[486,600],REJECTED:[403,603],NOT_FOUND:[404,604],UNAVAILABLE:[480,410,408,430],ADDRESS_INCOMPLETE:[484,424],INCOMPATIBLE_SDP:[488,606],AUTHENTICATION_ERROR:[401,407]},ACK:"ACK",BYE:"BYE",CANCEL:"CANCEL",INFO:"INFO",INVITE:"INVITE",MESSAGE:"MESSAGE",NOTIFY:"NOTIFY",OPTIONS:"OPTIONS",REGISTER:"REGISTER",REFER:"REFER",UPDATE:"UPDATE",SUBSCRIBE:"SUBSCRIBE",DTMF_TRANSPORT:{INFO:"INFO",RFC2833:"RFC2833"},REASON_PHRASE:{100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",424:"Bad Location Information",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"JsSIP Internal Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"},ALLOWED_METHODS:"INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY",ACCEPTED_BODY_TYPES:"application/sdp, application/dtmf-relay",MAX_FORWARDS:69,SESSION_EXPIRES:90,MIN_SESSION_EXPIRES:60,CONNECTION_RECOVERY_MAX_INTERVAL:30,CONNECTION_RECOVERY_MIN_INTERVAL:2},Mt}var Ht,cn;function Re(){if(cn)return Ht;cn=1;class O extends Error{constructor(t,h){super(),this.code=1,this.name="CONFIGURATION_ERROR",this.parameter=t,this.value=h,this.message=this.value?`Invalid value ${JSON.stringify(this.value)} for parameter "${this.parameter}"`:`Missing parameter: ${this.parameter}`}}class y extends Error{constructor(t){super(),this.code=2,this.name="INVALID_STATE_ERROR",this.status=t,this.message=`Invalid status: ${t}`}}class i extends Error{constructor(t){super(),this.code=3,this.name="NOT_SUPPORTED_ERROR",this.message=t}}class _ extends Error{constructor(t){super(),this.code=4,this.name="NOT_READY_ERROR",this.message=t}}return Ht={ConfigurationError:O,InvalidStateError:y,NotSupportedError:i,NotReadyError:_},Ht}var ne={},Ft,fn;function Ts(){if(fn)return Ft;fn=1;const O=ye(),y=ge();return Ft=class Yn{static parse(_){if(_=y.parse(_,"Name_Addr_Header"),_!==-1)return _}constructor(_,E,t){if(!_||!(_ instanceof O))throw new TypeError('missing or invalid "uri" parameter');this._uri=_,this._parameters={},this.display_name=E;for(const h in t)Object.prototype.hasOwnProperty.call(t,h)&&this.setParam(h,t[h])}get uri(){return this._uri}get display_name(){return this._display_name}set display_name(_){this._display_name=_===0?"0":_}setParam(_,E){_&&(this._parameters[_.toLowerCase()]=typeof E>"u"||E===null?null:E.toString())}getParam(_){if(_)return this._parameters[_.toLowerCase()]}hasParam(_){if(_)return this._parameters.hasOwnProperty(_.toLowerCase())&&!0||!1}deleteParam(_){if(_=_.toLowerCase(),this._parameters.hasOwnProperty(_)){const E=this._parameters[_];return delete this._parameters[_],E}}clearParams(){this._parameters={}}clone(){return new Yn(this._uri.clone(),this._display_name,JSON.parse(JSON.stringify(this._parameters)))}_quote(_){return _.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}toString(){let _=this._display_name?`"${this._quote(this._display_name)}" `:"";_+=`<${this._uri.toString()}>`;for(const E in this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,E)&&(_+=`;${E}`,this._parameters[E]!==null&&(_+=`=${this._parameters[E]}`));return _}},Ft}var $t,hn;function ge(){return hn||(hn=1,$t=(function(){function O(i){return'"'+i.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var y={parse:function(i,_){var E={CRLF:g,DIGIT:c,ALPHA:R,HEXDIG:x,WSP:S,OCTET:N,DQUOTE:k,SP:C,HTAB:I,alphanum:H,reserved:F,unreserved:o,mark:f,escaped:T,LWS:p,SWS:A,HCOLON:D,TEXT_UTF8_TRIM:v,TEXT_UTF8char:w,UTF8_NONASCII:U,UTF8_CONT:M,LHEX:ee,token:B,token_nodot:ae,separators:fe,word:ce,STAR:Y,SLASH:he,EQUAL:J,LPAREN:we,RPAREN:be,RAQUOT:Se,LAQUOT:Ee,COMMA:Q,SEMI:z,COLON:Ne,LDQUOT:Ae,RDQUOT:Ve,comment:j,ctext:V,quoted_string:K,quoted_string_clean:X,qdtext:se,quoted_pair:re,SIP_URI_noparams:Z,SIP_URI:Te,uri_scheme:de,uri_scheme_sips:vs,uri_scheme_sip:Ss,userinfo:je,user:Es,user_unreserved:ht,password:As,hostport:Ke,host:Pe,hostname:dt,domainlabel:_t,toplabel:Rs,IPv6reference:pt,IPv6address:mt,h16:q,ls32:_e,IPv4address:Le,dec_octet:Me,port:ys,uri_parameters:Is,uri_parameter:gt,transport_param:ws,user_param:bs,method_param:Ns,ttl_param:Os,maddr_param:Ds,lr_param:xs,other_param:Us,pname:Ps,pvalue:Ls,paramchar:He,param_unreserved:Ms,headers:Hs,header:ze,hname:Fs,hvalue:$s,hnv_unreserved:Fe,Request_Response:tl,Request_Line:ks,Request_URI:qs,absoluteURI:Tt,hier_part:Gs,net_path:Bs,abs_path:Ye,opaque_part:Ws,uric:$e,uric_no_slash:Vs,path_segments:js,segment:Je,param:Ct,pchar:ke,scheme:Ks,authority:zs,srvr:Ys,reg_name:Js,query:Xs,SIP_Version:vt,INVITEm:Qs,ACKm:Zs,OPTIONSm:er,BYEm:tr,CANCELm:sr,REGISTERm:rr,SUBSCRIBEm:nr,NOTIFYm:lr,REFERm:ir,Method:Xe,Status_Line:ar,Status_Code:or,extension_code:ur,Reason_Phrase:cr,Allow_Events:sl,Call_ID:rl,Contact:nl,contact_param:Qe,name_addr:Oe,display_name:Ze,contact_params:St,c_p_q:fr,c_p_expires:hr,delta_seconds:De,qvalue:dr,generic_param:le,gen_value:_r,Content_Disposition:ll,disp_type:pr,disp_param:Et,handling_param:mr,Content_Encoding:il,Content_Length:al,Content_Type:ol,media_type:gr,m_type:Tr,discrete_type:Cr,composite_type:vr,extension_token:et,x_token:Sr,m_subtype:Er,m_parameter:At,m_value:Ar,CSeq:ul,CSeq_value:Rr,Expires:cl,Event:fl,event_type:qe,From:hl,from_param:Rt,tag_param:yt,Max_Forwards:dl,Min_Expires:_l,Name_Addr_Header:pl,Proxy_Authenticate:ml,challenge:It,other_challenge:yr,auth_param:Ge,digest_cln:tt,realm:Ir,realm_value:wr,domain:br,URI:st,nonce:Nr,nonce_value:Or,opaque:Dr,stale:xr,algorithm:Ur,qop_options:Pr,qop_value:rt,Proxy_Require:gl,Record_Route:Tl,rec_route:nt,Reason:Cl,reason_param:wt,reason_cause:Lr,Require:vl,Route:Sl,route_param:lt,Subscription_State:El,substate_value:Mr,subexp_params:bt,event_reason_value:Hr,Subject:Al,Supported:Rl,To:yl,to_param:Nt,Via:Il,via_param:it,via_params:Ot,via_ttl:Fr,via_maddr:$r,via_received:kr,via_branch:qr,response_port:Gr,rport:Br,sent_protocol:Wr,protocol_name:Vr,transport:jr,sent_by:Kr,via_host:zr,via_port:Yr,ttl:Dt,WWW_Authenticate:wl,Session_Expires:bl,s_e_expires:Jr,s_e_params:xt,s_e_refresher:Xr,extension_header:Nl,header_value:Qr,message_body:Ol,uuid_URI:Dl,uuid:Zr,hex4:Ce,hex8:en,hex12:tn,Refer_To:xl,Replaces:Ul,call_id:sn,replaces_param:Ut,to_tag:rn,from_tag:nn,early_flag:ln};if(_!==void 0){if(E[_]===void 0)throw new Error("Invalid rule name: "+O(_)+".")}else _="CRLF";var t=0,h=0,d=[];function l(e){t<h||(t>h&&(h=t,d=[]),d.push(e))}function g(){var e;return i.substr(t,2)===`\r
1
+ "use strict";function $l(...O){return O.filter(Boolean).join(" ")}function kl(O){const y=Math.floor(O/3600),i=Math.floor(O%3600/60),_=O%60;return y>0?`${y.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}:${_.toString().padStart(2,"0")}`:`${i.toString().padStart(2,"0")}:${_.toString().padStart(2,"0")}`}const ql={calling:"Llamando",waitingResponse:"Esperando respuesta...",cancel:"Cancelar",hangUp:"Colgar",callEnded:"Llamada finalizada",duration:"Duración",inactive:"Inactivo",inCall:"En llamada",placeholder:"Número a llamar",callHistory:"Historial de llamadas",noCallsRegistered:"No hay llamadas registradas",callsRegistered:"llamada(s) registrada(s)",noCalls:"No hay llamadas",startingCall:"Iniciando llamada a",callInProgress:"Ya hay una llamada en curso",turnOn:"Encender teléfono",incomingCall:"Llamada entrante",answer:"Contestar",reject:"Rechazar"};function Gl(O){return O&&O.__esModule&&Object.prototype.hasOwnProperty.call(O,"default")?O.default:O}const Bl="JsSIP",Wl="3.11.1",zn={title:Bl,version:Wl};var Mt,un;function ie(){if(un)return Mt;un=1;const O=zn;return Mt={USER_AGENT:`${O.title} ${O.version}`,SIP:"sip",SIPS:"sips",causes:{CONNECTION_ERROR:"Connection Error",REQUEST_TIMEOUT:"Request Timeout",SIP_FAILURE_CODE:"SIP Failure Code",INTERNAL_ERROR:"Internal Error",BUSY:"Busy",REJECTED:"Rejected",REDIRECTED:"Redirected",UNAVAILABLE:"Unavailable",NOT_FOUND:"Not Found",ADDRESS_INCOMPLETE:"Address Incomplete",INCOMPATIBLE_SDP:"Incompatible SDP",MISSING_SDP:"Missing SDP",AUTHENTICATION_ERROR:"Authentication Error",BYE:"Terminated",WEBRTC_ERROR:"WebRTC Error",CANCELED:"Canceled",NO_ANSWER:"No Answer",EXPIRES:"Expires",NO_ACK:"No ACK",DIALOG_ERROR:"Dialog Error",USER_DENIED_MEDIA_ACCESS:"User Denied Media Access",BAD_MEDIA_DESCRIPTION:"Bad Media Description",RTP_TIMEOUT:"RTP Timeout"},SIP_ERROR_CAUSES:{REDIRECTED:[300,301,302,305,380],BUSY:[486,600],REJECTED:[403,603],NOT_FOUND:[404,604],UNAVAILABLE:[480,410,408,430],ADDRESS_INCOMPLETE:[484,424],INCOMPATIBLE_SDP:[488,606],AUTHENTICATION_ERROR:[401,407]},ACK:"ACK",BYE:"BYE",CANCEL:"CANCEL",INFO:"INFO",INVITE:"INVITE",MESSAGE:"MESSAGE",NOTIFY:"NOTIFY",OPTIONS:"OPTIONS",REGISTER:"REGISTER",REFER:"REFER",UPDATE:"UPDATE",SUBSCRIBE:"SUBSCRIBE",DTMF_TRANSPORT:{INFO:"INFO",RFC2833:"RFC2833"},REASON_PHRASE:{100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",424:"Bad Location Information",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"JsSIP Internal Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"},ALLOWED_METHODS:"INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY",ACCEPTED_BODY_TYPES:"application/sdp, application/dtmf-relay",MAX_FORWARDS:69,SESSION_EXPIRES:90,MIN_SESSION_EXPIRES:60,CONNECTION_RECOVERY_MAX_INTERVAL:30,CONNECTION_RECOVERY_MIN_INTERVAL:2},Mt}var Ht,cn;function Re(){if(cn)return Ht;cn=1;class O extends Error{constructor(t,h){super(),this.code=1,this.name="CONFIGURATION_ERROR",this.parameter=t,this.value=h,this.message=this.value?`Invalid value ${JSON.stringify(this.value)} for parameter "${this.parameter}"`:`Missing parameter: ${this.parameter}`}}class y extends Error{constructor(t){super(),this.code=2,this.name="INVALID_STATE_ERROR",this.status=t,this.message=`Invalid status: ${t}`}}class i extends Error{constructor(t){super(),this.code=3,this.name="NOT_SUPPORTED_ERROR",this.message=t}}class _ extends Error{constructor(t){super(),this.code=4,this.name="NOT_READY_ERROR",this.message=t}}return Ht={ConfigurationError:O,InvalidStateError:y,NotSupportedError:i,NotReadyError:_},Ht}var ne={},Ft,fn;function Ts(){if(fn)return Ft;fn=1;const O=ye(),y=ge();return Ft=class Yn{static parse(_){if(_=y.parse(_,"Name_Addr_Header"),_!==-1)return _}constructor(_,E,t){if(!_||!(_ instanceof O))throw new TypeError('missing or invalid "uri" parameter');this._uri=_,this._parameters={},this.display_name=E;for(const h in t)Object.prototype.hasOwnProperty.call(t,h)&&this.setParam(h,t[h])}get uri(){return this._uri}get display_name(){return this._display_name}set display_name(_){this._display_name=_===0?"0":_}setParam(_,E){_&&(this._parameters[_.toLowerCase()]=typeof E>"u"||E===null?null:E.toString())}getParam(_){if(_)return this._parameters[_.toLowerCase()]}hasParam(_){if(_)return this._parameters.hasOwnProperty(_.toLowerCase())&&!0||!1}deleteParam(_){if(_=_.toLowerCase(),this._parameters.hasOwnProperty(_)){const E=this._parameters[_];return delete this._parameters[_],E}}clearParams(){this._parameters={}}clone(){return new Yn(this._uri.clone(),this._display_name,JSON.parse(JSON.stringify(this._parameters)))}_quote(_){return _.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}toString(){let _=this._display_name?`"${this._quote(this._display_name)}" `:"";_+=`<${this._uri.toString()}>`;for(const E in this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,E)&&(_+=`;${E}`,this._parameters[E]!==null&&(_+=`=${this._parameters[E]}`));return _}},Ft}var $t,hn;function ge(){return hn||(hn=1,$t=(function(){function O(i){return'"'+i.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var y={parse:function(i,_){var E={CRLF:g,DIGIT:c,ALPHA:R,HEXDIG:x,WSP:S,OCTET:N,DQUOTE:k,SP:C,HTAB:I,alphanum:H,reserved:F,unreserved:o,mark:f,escaped:T,LWS:p,SWS:A,HCOLON:D,TEXT_UTF8_TRIM:v,TEXT_UTF8char:w,UTF8_NONASCII:U,UTF8_CONT:M,LHEX:ee,token:B,token_nodot:ae,separators:fe,word:ce,STAR:Y,SLASH:he,EQUAL:J,LPAREN:we,RPAREN:be,RAQUOT:Se,LAQUOT:Ee,COMMA:Q,SEMI:z,COLON:Ne,LDQUOT:Ae,RDQUOT:Ve,comment:j,ctext:V,quoted_string:K,quoted_string_clean:X,qdtext:se,quoted_pair:re,SIP_URI_noparams:Z,SIP_URI:Te,uri_scheme:de,uri_scheme_sips:vs,uri_scheme_sip:Ss,userinfo:je,user:Es,user_unreserved:ht,password:As,hostport:Ke,host:Pe,hostname:dt,domainlabel:_t,toplabel:Rs,IPv6reference:pt,IPv6address:mt,h16:q,ls32:_e,IPv4address:Le,dec_octet:Me,port:ys,uri_parameters:Is,uri_parameter:gt,transport_param:ws,user_param:bs,method_param:Ns,ttl_param:Os,maddr_param:Ds,lr_param:xs,other_param:Us,pname:Ps,pvalue:Ls,paramchar:He,param_unreserved:Ms,headers:Hs,header:ze,hname:Fs,hvalue:$s,hnv_unreserved:Fe,Request_Response:tl,Request_Line:ks,Request_URI:qs,absoluteURI:Tt,hier_part:Gs,net_path:Bs,abs_path:Ye,opaque_part:Ws,uric:$e,uric_no_slash:Vs,path_segments:js,segment:Je,param:Ct,pchar:ke,scheme:Ks,authority:zs,srvr:Ys,reg_name:Js,query:Xs,SIP_Version:vt,INVITEm:Qs,ACKm:Zs,OPTIONSm:er,BYEm:tr,CANCELm:sr,REGISTERm:rr,SUBSCRIBEm:nr,NOTIFYm:lr,REFERm:ir,Method:Xe,Status_Line:ar,Status_Code:or,extension_code:ur,Reason_Phrase:cr,Allow_Events:sl,Call_ID:rl,Contact:nl,contact_param:Qe,name_addr:Oe,display_name:Ze,contact_params:St,c_p_q:fr,c_p_expires:hr,delta_seconds:De,qvalue:dr,generic_param:le,gen_value:_r,Content_Disposition:ll,disp_type:pr,disp_param:Et,handling_param:mr,Content_Encoding:il,Content_Length:al,Content_Type:ol,media_type:gr,m_type:Tr,discrete_type:Cr,composite_type:vr,extension_token:et,x_token:Sr,m_subtype:Er,m_parameter:At,m_value:Ar,CSeq:ul,CSeq_value:Rr,Expires:cl,Event:fl,event_type:qe,From:hl,from_param:Rt,tag_param:yt,Max_Forwards:dl,Min_Expires:_l,Name_Addr_Header:pl,Proxy_Authenticate:ml,challenge:It,other_challenge:yr,auth_param:Ge,digest_cln:tt,realm:Ir,realm_value:wr,domain:br,URI:st,nonce:Nr,nonce_value:Or,opaque:Dr,stale:xr,algorithm:Ur,qop_options:Pr,qop_value:rt,Proxy_Require:gl,Record_Route:Tl,rec_route:nt,Reason:Cl,reason_param:wt,reason_cause:Lr,Require:vl,Route:Sl,route_param:lt,Subscription_State:El,substate_value:Mr,subexp_params:bt,event_reason_value:Hr,Subject:Al,Supported:Rl,To:yl,to_param:Nt,Via:Il,via_param:it,via_params:Ot,via_ttl:Fr,via_maddr:$r,via_received:kr,via_branch:qr,response_port:Gr,rport:Br,sent_protocol:Wr,protocol_name:Vr,transport:jr,sent_by:Kr,via_host:zr,via_port:Yr,ttl:Dt,WWW_Authenticate:wl,Session_Expires:bl,s_e_expires:Jr,s_e_params:xt,s_e_refresher:Xr,extension_header:Nl,header_value:Qr,message_body:Ol,uuid_URI:Dl,uuid:Zr,hex4:Ce,hex8:en,hex12:tn,Refer_To:xl,Replaces:Ul,call_id:sn,replaces_param:Ut,to_tag:rn,from_tag:nn,early_flag:ln};if(_!==void 0){if(E[_]===void 0)throw new Error("Invalid rule name: "+O(_)+".")}else _="CRLF";var t=0,h=0,d=[];function l(e){t<h||(t>h&&(h=t,d=[]),d.push(e))}function g(){var e;return i.substr(t,2)===`\r
2
2
  `?(e=`\r
3
3
  `,t+=2):(e=null,l('"\\r\\n"')),e}function c(){var e;return/^[0-9]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[0-9]")),e}function R(){var e;return/^[a-zA-Z]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[a-zA-Z]")),e}function x(){var e;return/^[0-9a-fA-F]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[0-9a-fA-F]")),e}function S(){var e;return e=C(),e===null&&(e=I()),e}function N(){var e;return/^[\0-\xFF]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[\\0-\\xFF]")),e}function k(){var e;return/^["]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l('["]')),e}function C(){var e;return i.charCodeAt(t)===32?(e=" ",t++):(e=null,l('" "')),e}function I(){var e;return i.charCodeAt(t)===9?(e=" ",t++):(e=null,l('"\\t"')),e}function H(){var e;return/^[a-zA-Z0-9]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[a-zA-Z0-9]")),e}function F(){var e;return i.charCodeAt(t)===59?(e=";",t++):(e=null,l('";"')),e===null&&(i.charCodeAt(t)===47?(e="/",t++):(e=null,l('"/"')),e===null&&(i.charCodeAt(t)===63?(e="?",t++):(e=null,l('"?"')),e===null&&(i.charCodeAt(t)===58?(e=":",t++):(e=null,l('":"')),e===null&&(i.charCodeAt(t)===64?(e="@",t++):(e=null,l('"@"')),e===null&&(i.charCodeAt(t)===38?(e="&",t++):(e=null,l('"&"')),e===null&&(i.charCodeAt(t)===61?(e="=",t++):(e=null,l('"="')),e===null&&(i.charCodeAt(t)===43?(e="+",t++):(e=null,l('"+"')),e===null&&(i.charCodeAt(t)===36?(e="$",t++):(e=null,l('"$"')),e===null&&(i.charCodeAt(t)===44?(e=",",t++):(e=null,l('","'))))))))))),e}function o(){var e;return e=H(),e===null&&(e=f()),e}function f(){var e;return i.charCodeAt(t)===45?(e="-",t++):(e=null,l('"-"')),e===null&&(i.charCodeAt(t)===95?(e="_",t++):(e=null,l('"_"')),e===null&&(i.charCodeAt(t)===46?(e=".",t++):(e=null,l('"."')),e===null&&(i.charCodeAt(t)===33?(e="!",t++):(e=null,l('"!"')),e===null&&(i.charCodeAt(t)===126?(e="~",t++):(e=null,l('"~"')),e===null&&(i.charCodeAt(t)===42?(e="*",t++):(e=null,l('"*"')),e===null&&(i.charCodeAt(t)===39?(e="'",t++):(e=null,l(`"'"`)),e===null&&(i.charCodeAt(t)===40?(e="(",t++):(e=null,l('"("')),e===null&&(i.charCodeAt(t)===41?(e=")",t++):(e=null,l('")"')))))))))),e}function T(){var e,s,r,n,a;return n=t,a=t,i.charCodeAt(t)===37?(e="%",t++):(e=null,l('"%"')),e!==null?(s=x(),s!==null?(r=x(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){return m.join("")})(n,e)),e===null&&(t=n),e}function p(){var e,s,r,n,a,u;for(n=t,a=t,u=t,e=[],s=S();s!==null;)e.push(s),s=S();if(e!==null?(s=g(),s!==null?e=[e,s]:(e=null,t=u)):(e=null,t=u),e=e!==null?e:"",e!==null){if(r=S(),r!==null)for(s=[];r!==null;)s.push(r),r=S();else s=null;s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e!==null&&(e=(function(m){return" "})()),e===null&&(t=n),e}function A(){var e;return e=p(),e=e!==null?e:"",e}function D(){var e,s,r,n,a;for(n=t,a=t,e=[],s=C(),s===null&&(s=I());s!==null;)e.push(s),s=C(),s===null&&(s=I());return e!==null?(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return":"})()),e===null&&(t=n),e}function v(){var e,s,r,n,a,u,m;if(a=t,u=t,s=w(),s!==null)for(e=[];s!==null;)e.push(s),s=w();else e=null;if(e!==null){for(s=[],m=t,r=[],n=p();n!==null;)r.push(n),n=p();for(r!==null?(n=w(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;){for(s.push(r),m=t,r=[],n=p();n!==null;)r.push(n),n=p();r!==null?(n=w(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m)}s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P){return i.substring(t,P)})(a)),e===null&&(t=a),e}function w(){var e;return/^[!-~]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[!-~]")),e===null&&(e=U()),e}function U(){var e;return/^[\x80-\uFFFF]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[\\x80-\\uFFFF]")),e}function M(){var e;return/^[\x80-\xBF]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[\\x80-\\xBF]")),e}function ee(){var e;return e=c(),e===null&&(/^[a-f]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[a-f]"))),e}function B(){var e,s,r;if(r=t,s=H(),s===null&&(i.charCodeAt(t)===45?(s="-",t++):(s=null,l('"-"')),s===null&&(i.charCodeAt(t)===46?(s=".",t++):(s=null,l('"."')),s===null&&(i.charCodeAt(t)===33?(s="!",t++):(s=null,l('"!"')),s===null&&(i.charCodeAt(t)===37?(s="%",t++):(s=null,l('"%"')),s===null&&(i.charCodeAt(t)===42?(s="*",t++):(s=null,l('"*"')),s===null&&(i.charCodeAt(t)===95?(s="_",t++):(s=null,l('"_"')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')),s===null&&(i.charCodeAt(t)===96?(s="`",t++):(s=null,l('"`"')),s===null&&(i.charCodeAt(t)===39?(s="'",t++):(s=null,l(`"'"`)),s===null&&(i.charCodeAt(t)===126?(s="~",t++):(s=null,l('"~"')))))))))))),s!==null)for(e=[];s!==null;)e.push(s),s=H(),s===null&&(i.charCodeAt(t)===45?(s="-",t++):(s=null,l('"-"')),s===null&&(i.charCodeAt(t)===46?(s=".",t++):(s=null,l('"."')),s===null&&(i.charCodeAt(t)===33?(s="!",t++):(s=null,l('"!"')),s===null&&(i.charCodeAt(t)===37?(s="%",t++):(s=null,l('"%"')),s===null&&(i.charCodeAt(t)===42?(s="*",t++):(s=null,l('"*"')),s===null&&(i.charCodeAt(t)===95?(s="_",t++):(s=null,l('"_"')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')),s===null&&(i.charCodeAt(t)===96?(s="`",t++):(s=null,l('"`"')),s===null&&(i.charCodeAt(t)===39?(s="'",t++):(s=null,l(`"'"`)),s===null&&(i.charCodeAt(t)===126?(s="~",t++):(s=null,l('"~"'))))))))))));else e=null;return e!==null&&(e=(function(n){return i.substring(t,n)})(r)),e===null&&(t=r),e}function ae(){var e,s,r;if(r=t,s=H(),s===null&&(i.charCodeAt(t)===45?(s="-",t++):(s=null,l('"-"')),s===null&&(i.charCodeAt(t)===33?(s="!",t++):(s=null,l('"!"')),s===null&&(i.charCodeAt(t)===37?(s="%",t++):(s=null,l('"%"')),s===null&&(i.charCodeAt(t)===42?(s="*",t++):(s=null,l('"*"')),s===null&&(i.charCodeAt(t)===95?(s="_",t++):(s=null,l('"_"')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')),s===null&&(i.charCodeAt(t)===96?(s="`",t++):(s=null,l('"`"')),s===null&&(i.charCodeAt(t)===39?(s="'",t++):(s=null,l(`"'"`)),s===null&&(i.charCodeAt(t)===126?(s="~",t++):(s=null,l('"~"'))))))))))),s!==null)for(e=[];s!==null;)e.push(s),s=H(),s===null&&(i.charCodeAt(t)===45?(s="-",t++):(s=null,l('"-"')),s===null&&(i.charCodeAt(t)===33?(s="!",t++):(s=null,l('"!"')),s===null&&(i.charCodeAt(t)===37?(s="%",t++):(s=null,l('"%"')),s===null&&(i.charCodeAt(t)===42?(s="*",t++):(s=null,l('"*"')),s===null&&(i.charCodeAt(t)===95?(s="_",t++):(s=null,l('"_"')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')),s===null&&(i.charCodeAt(t)===96?(s="`",t++):(s=null,l('"`"')),s===null&&(i.charCodeAt(t)===39?(s="'",t++):(s=null,l(`"'"`)),s===null&&(i.charCodeAt(t)===126?(s="~",t++):(s=null,l('"~"')))))))))));else e=null;return e!==null&&(e=(function(n){return i.substring(t,n)})(r)),e===null&&(t=r),e}function fe(){var e;return i.charCodeAt(t)===40?(e="(",t++):(e=null,l('"("')),e===null&&(i.charCodeAt(t)===41?(e=")",t++):(e=null,l('")"')),e===null&&(i.charCodeAt(t)===60?(e="<",t++):(e=null,l('"<"')),e===null&&(i.charCodeAt(t)===62?(e=">",t++):(e=null,l('">"')),e===null&&(i.charCodeAt(t)===64?(e="@",t++):(e=null,l('"@"')),e===null&&(i.charCodeAt(t)===44?(e=",",t++):(e=null,l('","')),e===null&&(i.charCodeAt(t)===59?(e=";",t++):(e=null,l('";"')),e===null&&(i.charCodeAt(t)===58?(e=":",t++):(e=null,l('":"')),e===null&&(i.charCodeAt(t)===92?(e="\\",t++):(e=null,l('"\\\\"')),e===null&&(e=k(),e===null&&(i.charCodeAt(t)===47?(e="/",t++):(e=null,l('"/"')),e===null&&(i.charCodeAt(t)===91?(e="[",t++):(e=null,l('"["')),e===null&&(i.charCodeAt(t)===93?(e="]",t++):(e=null,l('"]"')),e===null&&(i.charCodeAt(t)===63?(e="?",t++):(e=null,l('"?"')),e===null&&(i.charCodeAt(t)===61?(e="=",t++):(e=null,l('"="')),e===null&&(i.charCodeAt(t)===123?(e="{",t++):(e=null,l('"{"')),e===null&&(i.charCodeAt(t)===125?(e="}",t++):(e=null,l('"}"')),e===null&&(e=C(),e===null&&(e=I())))))))))))))))))),e}function ce(){var e,s,r;if(r=t,s=H(),s===null&&(i.charCodeAt(t)===45?(s="-",t++):(s=null,l('"-"')),s===null&&(i.charCodeAt(t)===46?(s=".",t++):(s=null,l('"."')),s===null&&(i.charCodeAt(t)===33?(s="!",t++):(s=null,l('"!"')),s===null&&(i.charCodeAt(t)===37?(s="%",t++):(s=null,l('"%"')),s===null&&(i.charCodeAt(t)===42?(s="*",t++):(s=null,l('"*"')),s===null&&(i.charCodeAt(t)===95?(s="_",t++):(s=null,l('"_"')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')),s===null&&(i.charCodeAt(t)===96?(s="`",t++):(s=null,l('"`"')),s===null&&(i.charCodeAt(t)===39?(s="'",t++):(s=null,l(`"'"`)),s===null&&(i.charCodeAt(t)===126?(s="~",t++):(s=null,l('"~"')),s===null&&(i.charCodeAt(t)===40?(s="(",t++):(s=null,l('"("')),s===null&&(i.charCodeAt(t)===41?(s=")",t++):(s=null,l('")"')),s===null&&(i.charCodeAt(t)===60?(s="<",t++):(s=null,l('"<"')),s===null&&(i.charCodeAt(t)===62?(s=">",t++):(s=null,l('">"')),s===null&&(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s===null&&(i.charCodeAt(t)===92?(s="\\",t++):(s=null,l('"\\\\"')),s===null&&(s=k(),s===null&&(i.charCodeAt(t)===47?(s="/",t++):(s=null,l('"/"')),s===null&&(i.charCodeAt(t)===91?(s="[",t++):(s=null,l('"["')),s===null&&(i.charCodeAt(t)===93?(s="]",t++):(s=null,l('"]"')),s===null&&(i.charCodeAt(t)===63?(s="?",t++):(s=null,l('"?"')),s===null&&(i.charCodeAt(t)===123?(s="{",t++):(s=null,l('"{"')),s===null&&(i.charCodeAt(t)===125?(s="}",t++):(s=null,l('"}"'))))))))))))))))))))))))),s!==null)for(e=[];s!==null;)e.push(s),s=H(),s===null&&(i.charCodeAt(t)===45?(s="-",t++):(s=null,l('"-"')),s===null&&(i.charCodeAt(t)===46?(s=".",t++):(s=null,l('"."')),s===null&&(i.charCodeAt(t)===33?(s="!",t++):(s=null,l('"!"')),s===null&&(i.charCodeAt(t)===37?(s="%",t++):(s=null,l('"%"')),s===null&&(i.charCodeAt(t)===42?(s="*",t++):(s=null,l('"*"')),s===null&&(i.charCodeAt(t)===95?(s="_",t++):(s=null,l('"_"')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')),s===null&&(i.charCodeAt(t)===96?(s="`",t++):(s=null,l('"`"')),s===null&&(i.charCodeAt(t)===39?(s="'",t++):(s=null,l(`"'"`)),s===null&&(i.charCodeAt(t)===126?(s="~",t++):(s=null,l('"~"')),s===null&&(i.charCodeAt(t)===40?(s="(",t++):(s=null,l('"("')),s===null&&(i.charCodeAt(t)===41?(s=")",t++):(s=null,l('")"')),s===null&&(i.charCodeAt(t)===60?(s="<",t++):(s=null,l('"<"')),s===null&&(i.charCodeAt(t)===62?(s=">",t++):(s=null,l('">"')),s===null&&(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s===null&&(i.charCodeAt(t)===92?(s="\\",t++):(s=null,l('"\\\\"')),s===null&&(s=k(),s===null&&(i.charCodeAt(t)===47?(s="/",t++):(s=null,l('"/"')),s===null&&(i.charCodeAt(t)===91?(s="[",t++):(s=null,l('"["')),s===null&&(i.charCodeAt(t)===93?(s="]",t++):(s=null,l('"]"')),s===null&&(i.charCodeAt(t)===63?(s="?",t++):(s=null,l('"?"')),s===null&&(i.charCodeAt(t)===123?(s="{",t++):(s=null,l('"{"')),s===null&&(i.charCodeAt(t)===125?(s="}",t++):(s=null,l('"}"')))))))))))))))))))))))));else e=null;return e!==null&&(e=(function(n){return i.substring(t,n)})(r)),e===null&&(t=r),e}function Y(){var e,s,r,n,a;return n=t,a=t,e=A(),e!==null?(i.charCodeAt(t)===42?(s="*",t++):(s=null,l('"*"')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return"*"})()),e===null&&(t=n),e}function he(){var e,s,r,n,a;return n=t,a=t,e=A(),e!==null?(i.charCodeAt(t)===47?(s="/",t++):(s=null,l('"/"')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return"/"})()),e===null&&(t=n),e}function J(){var e,s,r,n,a;return n=t,a=t,e=A(),e!==null?(i.charCodeAt(t)===61?(s="=",t++):(s=null,l('"="')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return"="})()),e===null&&(t=n),e}function we(){var e,s,r,n,a;return n=t,a=t,e=A(),e!==null?(i.charCodeAt(t)===40?(s="(",t++):(s=null,l('"("')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return"("})()),e===null&&(t=n),e}function be(){var e,s,r,n,a;return n=t,a=t,e=A(),e!==null?(i.charCodeAt(t)===41?(s=")",t++):(s=null,l('")"')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return")"})()),e===null&&(t=n),e}function Se(){var e,s,r,n;return r=t,n=t,i.charCodeAt(t)===62?(e=">",t++):(e=null,l('">"')),e!==null?(s=A(),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a){return">"})()),e===null&&(t=r),e}function Ee(){var e,s,r,n;return r=t,n=t,e=A(),e!==null?(i.charCodeAt(t)===60?(s="<",t++):(s=null,l('"<"')),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a){return"<"})()),e===null&&(t=r),e}function Q(){var e,s,r,n,a;return n=t,a=t,e=A(),e!==null?(i.charCodeAt(t)===44?(s=",",t++):(s=null,l('","')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return","})()),e===null&&(t=n),e}function z(){var e,s,r,n,a;return n=t,a=t,e=A(),e!==null?(i.charCodeAt(t)===59?(s=";",t++):(s=null,l('";"')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return";"})()),e===null&&(t=n),e}function Ne(){var e,s,r,n,a;return n=t,a=t,e=A(),e!==null?(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=A(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return":"})()),e===null&&(t=n),e}function Ae(){var e,s,r,n;return r=t,n=t,e=A(),e!==null?(s=k(),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a){return'"'})()),e===null&&(t=r),e}function Ve(){var e,s,r,n;return r=t,n=t,e=k(),e!==null?(s=A(),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a){return'"'})()),e===null&&(t=r),e}function j(){var e,s,r,n;if(n=t,e=we(),e!==null){for(s=[],r=V(),r===null&&(r=re(),r===null&&(r=j()));r!==null;)s.push(r),r=V(),r===null&&(r=re(),r===null&&(r=j()));s!==null?(r=be(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)}else e=null,t=n;return e}function V(){var e;return/^[!-']/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[!-']")),e===null&&(/^[*-[]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[*-[]")),e===null&&(/^[\]-~]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[\\]-~]")),e===null&&(e=U(),e===null&&(e=p())))),e}function K(){var e,s,r,n,a,u;if(a=t,u=t,e=A(),e!==null)if(s=k(),s!==null){for(r=[],n=se(),n===null&&(n=re());n!==null;)r.push(n),n=se(),n===null&&(n=re());r!==null?(n=k(),n!==null?e=[e,s,r,n]:(e=null,t=u)):(e=null,t=u)}else e=null,t=u;else e=null,t=u;return e!==null&&(e=(function(m){return i.substring(t,m)})(a)),e===null&&(t=a),e}function X(){var e,s,r,n,a,u;if(a=t,u=t,e=A(),e!==null)if(s=k(),s!==null){for(r=[],n=se(),n===null&&(n=re());n!==null;)r.push(n),n=se(),n===null&&(n=re());r!==null?(n=k(),n!==null?e=[e,s,r,n]:(e=null,t=u)):(e=null,t=u)}else e=null,t=u;else e=null,t=u;return e!==null&&(e=(function(m){var P=i.substring(t,m).trim();return P.substring(1,P.length-1).replace(/\\([\x00-\x09\x0b-\x0c\x0e-\x7f])/g,"$1")})(a)),e===null&&(t=a),e}function se(){var e;return e=p(),e===null&&(i.charCodeAt(t)===33?(e="!",t++):(e=null,l('"!"')),e===null&&(/^[#-[]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[#-[]")),e===null&&(/^[\]-~]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[\\]-~]")),e===null&&(e=U())))),e}function re(){var e,s,r;return r=t,i.charCodeAt(t)===92?(e="\\",t++):(e=null,l('"\\\\"')),e!==null?(/^[\0-\t]/.test(i.charAt(t))?(s=i.charAt(t),t++):(s=null,l("[\\0-\\t]")),s===null&&(/^[\x0B-\f]/.test(i.charAt(t))?(s=i.charAt(t),t++):(s=null,l("[\\x0B-\\f]")),s===null&&(/^[\x0E-]/.test(i.charAt(t))?(s=i.charAt(t),t++):(s=null,l("[\\x0E-]")))),s!==null?e=[e,s]:(e=null,t=r)):(e=null,t=r),e}function Z(){var e,s,r,n,a,u;return a=t,u=t,e=de(),e!==null?(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=je(),r=r!==null?r:"",r!==null?(n=Ke(),n!==null?e=[e,s,r,n]:(e=null,t=u)):(e=null,t=u)):(e=null,t=u)):(e=null,t=u),e!==null&&(e=(function(m){try{b.uri=new an(b.scheme,b.user,b.host,b.port),delete b.scheme,delete b.user,delete b.host,delete b.host_type,delete b.port}catch{b=-1}})()),e===null&&(t=a),e}function Te(){var e,s,r,n,a,u,m,P;return m=t,P=t,e=de(),e!==null?(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=je(),r=r!==null?r:"",r!==null?(n=Ke(),n!==null?(a=Is(),a!==null?(u=Hs(),u=u!==null?u:"",u!==null?e=[e,s,r,n,a,u]:(e=null,t=P)):(e=null,t=P)):(e=null,t=P)):(e=null,t=P)):(e=null,t=P)):(e=null,t=P),e!==null&&(e=(function($){try{b.uri=new an(b.scheme,b.user,b.host,b.port,b.uri_params,b.uri_headers),delete b.scheme,delete b.user,delete b.host,delete b.host_type,delete b.port,delete b.uri_params,_==="SIP_URI"&&(b=b.uri)}catch{b=-1}})()),e===null&&(t=m),e}function de(){var e;return e=vs(),e===null&&(e=Ss()),e}function vs(){var e,s;return s=t,i.substr(t,4).toLowerCase()==="sips"?(e=i.substr(t,4),t+=4):(e=null,l('"sips"')),e!==null&&(e=(function(r,n){b.scheme=n.toLowerCase()})(s,e)),e===null&&(t=s),e}function Ss(){var e,s;return s=t,i.substr(t,3).toLowerCase()==="sip"?(e=i.substr(t,3),t+=3):(e=null,l('"sip"')),e!==null&&(e=(function(r,n){b.scheme=n.toLowerCase()})(s,e)),e===null&&(t=s),e}function je(){var e,s,r,n,a,u;return n=t,a=t,e=Es(),e!==null?(u=t,i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=As(),r!==null?s=[s,r]:(s=null,t=u)):(s=null,t=u),s=s!==null?s:"",s!==null?(i.charCodeAt(t)===64?(r="@",t++):(r=null,l('"@"')),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(m){b.user=decodeURIComponent(i.substring(t-1,m))})(n)),e===null&&(t=n),e}function Es(){var e,s;if(s=o(),s===null&&(s=T(),s===null&&(s=ht())),s!==null)for(e=[];s!==null;)e.push(s),s=o(),s===null&&(s=T(),s===null&&(s=ht()));else e=null;return e}function ht(){var e;return i.charCodeAt(t)===38?(e="&",t++):(e=null,l('"&"')),e===null&&(i.charCodeAt(t)===61?(e="=",t++):(e=null,l('"="')),e===null&&(i.charCodeAt(t)===43?(e="+",t++):(e=null,l('"+"')),e===null&&(i.charCodeAt(t)===36?(e="$",t++):(e=null,l('"$"')),e===null&&(i.charCodeAt(t)===44?(e=",",t++):(e=null,l('","')),e===null&&(i.charCodeAt(t)===59?(e=";",t++):(e=null,l('";"')),e===null&&(i.charCodeAt(t)===63?(e="?",t++):(e=null,l('"?"')),e===null&&(i.charCodeAt(t)===47?(e="/",t++):(e=null,l('"/"'))))))))),e}function As(){var e,s,r;for(r=t,e=[],s=o(),s===null&&(s=T(),s===null&&(i.charCodeAt(t)===38?(s="&",t++):(s=null,l('"&"')),s===null&&(i.charCodeAt(t)===61?(s="=",t++):(s=null,l('"="')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')),s===null&&(i.charCodeAt(t)===36?(s="$",t++):(s=null,l('"$"')),s===null&&(i.charCodeAt(t)===44?(s=",",t++):(s=null,l('","'))))))));s!==null;)e.push(s),s=o(),s===null&&(s=T(),s===null&&(i.charCodeAt(t)===38?(s="&",t++):(s=null,l('"&"')),s===null&&(i.charCodeAt(t)===61?(s="=",t++):(s=null,l('"="')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')),s===null&&(i.charCodeAt(t)===36?(s="$",t++):(s=null,l('"$"')),s===null&&(i.charCodeAt(t)===44?(s=",",t++):(s=null,l('","'))))))));return e!==null&&(e=(function(n){b.password=i.substring(t,n)})(r)),e===null&&(t=r),e}function Ke(){var e,s,r,n,a;return n=t,e=Pe(),e!==null?(a=t,i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=ys(),r!==null?s=[s,r]:(s=null,t=a)):(s=null,t=a),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e}function Pe(){var e,s;return s=t,e=dt(),e===null&&(e=Le(),e===null&&(e=pt())),e!==null&&(e=(function(r){return b.host=i.substring(t,r).toLowerCase(),b.host})(s)),e===null&&(t=s),e}function dt(){var e,s,r,n,a,u;for(n=t,a=t,e=[],u=t,s=_t(),s!==null?(i.charCodeAt(t)===46?(r=".",t++):(r=null,l('"."')),r!==null?s=[s,r]:(s=null,t=u)):(s=null,t=u);s!==null;)e.push(s),u=t,s=_t(),s!==null?(i.charCodeAt(t)===46?(r=".",t++):(r=null,l('"."')),r!==null?s=[s,r]:(s=null,t=u)):(s=null,t=u);return e!==null?(s=Rs(),s!==null?(i.charCodeAt(t)===46?(r=".",t++):(r=null,l('"."')),r=r!==null?r:"",r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(m){return b.host_type="domain",i.substring(t,m)})(n)),e===null&&(t=n),e}function _t(){var e,s,r,n;if(n=t,e=H(),e!==null){for(s=[],r=H(),r===null&&(i.charCodeAt(t)===45?(r="-",t++):(r=null,l('"-"')),r===null&&(i.charCodeAt(t)===95?(r="_",t++):(r=null,l('"_"'))));r!==null;)s.push(r),r=H(),r===null&&(i.charCodeAt(t)===45?(r="-",t++):(r=null,l('"-"')),r===null&&(i.charCodeAt(t)===95?(r="_",t++):(r=null,l('"_"'))));s!==null?e=[e,s]:(e=null,t=n)}else e=null,t=n;return e}function Rs(){var e,s,r,n;if(n=t,e=R(),e!==null){for(s=[],r=H(),r===null&&(i.charCodeAt(t)===45?(r="-",t++):(r=null,l('"-"')),r===null&&(i.charCodeAt(t)===95?(r="_",t++):(r=null,l('"_"'))));r!==null;)s.push(r),r=H(),r===null&&(i.charCodeAt(t)===45?(r="-",t++):(r=null,l('"-"')),r===null&&(i.charCodeAt(t)===95?(r="_",t++):(r=null,l('"_"'))));s!==null?e=[e,s]:(e=null,t=n)}else e=null,t=n;return e}function pt(){var e,s,r,n,a;return n=t,a=t,i.charCodeAt(t)===91?(e="[",t++):(e=null,l('"["')),e!==null?(s=mt(),s!==null?(i.charCodeAt(t)===93?(r="]",t++):(r=null,l('"]"')),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u){return b.host_type="IPv6",i.substring(t,u)})(n)),e===null&&(t=n),e}function mt(){var e,s,r,n,a,u,m,P,$,W,te,me,at,Lt,L,G;return Lt=t,L=t,e=q(),e!==null?(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=q(),r!==null?(i.charCodeAt(t)===58?(n=":",t++):(n=null,l('":"')),n!==null?(a=q(),a!==null?(i.charCodeAt(t)===58?(u=":",t++):(u=null,l('":"')),u!==null?(m=q(),m!==null?(i.charCodeAt(t)===58?(P=":",t++):(P=null,l('":"')),P!==null?($=q(),$!==null?(i.charCodeAt(t)===58?(W=":",t++):(W=null,l('":"')),W!==null?(te=q(),te!==null?(i.charCodeAt(t)===58?(me=":",t++):(me=null,l('":"')),me!==null?(at=_e(),at!==null?e=[e,s,r,n,a,u,m,P,$,W,te,me,at]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,i.substr(t,2)==="::"?(e="::",t+=2):(e=null,l('"::"')),e!==null?(s=q(),s!==null?(i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?(i.charCodeAt(t)===58?(a=":",t++):(a=null,l('":"')),a!==null?(u=q(),u!==null?(i.charCodeAt(t)===58?(m=":",t++):(m=null,l('":"')),m!==null?(P=q(),P!==null?(i.charCodeAt(t)===58?($=":",t++):($=null,l('":"')),$!==null?(W=q(),W!==null?(i.charCodeAt(t)===58?(te=":",t++):(te=null,l('":"')),te!==null?(me=_e(),me!==null?e=[e,s,r,n,a,u,m,P,$,W,te,me]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,i.substr(t,2)==="::"?(e="::",t+=2):(e=null,l('"::"')),e!==null?(s=q(),s!==null?(i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?(i.charCodeAt(t)===58?(a=":",t++):(a=null,l('":"')),a!==null?(u=q(),u!==null?(i.charCodeAt(t)===58?(m=":",t++):(m=null,l('":"')),m!==null?(P=q(),P!==null?(i.charCodeAt(t)===58?($=":",t++):($=null,l('":"')),$!==null?(W=_e(),W!==null?e=[e,s,r,n,a,u,m,P,$,W]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,i.substr(t,2)==="::"?(e="::",t+=2):(e=null,l('"::"')),e!==null?(s=q(),s!==null?(i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?(i.charCodeAt(t)===58?(a=":",t++):(a=null,l('":"')),a!==null?(u=q(),u!==null?(i.charCodeAt(t)===58?(m=":",t++):(m=null,l('":"')),m!==null?(P=_e(),P!==null?e=[e,s,r,n,a,u,m,P]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,i.substr(t,2)==="::"?(e="::",t+=2):(e=null,l('"::"')),e!==null?(s=q(),s!==null?(i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?(i.charCodeAt(t)===58?(a=":",t++):(a=null,l('":"')),a!==null?(u=_e(),u!==null?e=[e,s,r,n,a,u]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,i.substr(t,2)==="::"?(e="::",t+=2):(e=null,l('"::"')),e!==null?(s=q(),s!==null?(i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=_e(),n!==null?e=[e,s,r,n]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,i.substr(t,2)==="::"?(e="::",t+=2):(e=null,l('"::"')),e!==null?(s=_e(),s!==null?e=[e,s]:(e=null,t=L)):(e=null,t=L),e===null&&(L=t,i.substr(t,2)==="::"?(e="::",t+=2):(e=null,l('"::"')),e!==null?(s=q(),s!==null?e=[e,s]:(e=null,t=L)):(e=null,t=L),e===null&&(L=t,e=q(),e!==null?(i.substr(t,2)==="::"?(s="::",t+=2):(s=null,l('"::"')),s!==null?(r=q(),r!==null?(i.charCodeAt(t)===58?(n=":",t++):(n=null,l('":"')),n!==null?(a=q(),a!==null?(i.charCodeAt(t)===58?(u=":",t++):(u=null,l('":"')),u!==null?(m=q(),m!==null?(i.charCodeAt(t)===58?(P=":",t++):(P=null,l('":"')),P!==null?($=q(),$!==null?(i.charCodeAt(t)===58?(W=":",t++):(W=null,l('":"')),W!==null?(te=_e(),te!==null?e=[e,s,r,n,a,u,m,P,$,W,te]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,e=q(),e!==null?(G=t,i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=q(),r!==null?s=[s,r]:(s=null,t=G)):(s=null,t=G),s=s!==null?s:"",s!==null?(i.substr(t,2)==="::"?(r="::",t+=2):(r=null,l('"::"')),r!==null?(n=q(),n!==null?(i.charCodeAt(t)===58?(a=":",t++):(a=null,l('":"')),a!==null?(u=q(),u!==null?(i.charCodeAt(t)===58?(m=":",t++):(m=null,l('":"')),m!==null?(P=q(),P!==null?(i.charCodeAt(t)===58?($=":",t++):($=null,l('":"')),$!==null?(W=_e(),W!==null?e=[e,s,r,n,a,u,m,P,$,W]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,e=q(),e!==null?(G=t,i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=q(),r!==null?s=[s,r]:(s=null,t=G)):(s=null,t=G),s=s!==null?s:"",s!==null?(G=t,i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?r=[r,n]:(r=null,t=G)):(r=null,t=G),r=r!==null?r:"",r!==null?(i.substr(t,2)==="::"?(n="::",t+=2):(n=null,l('"::"')),n!==null?(a=q(),a!==null?(i.charCodeAt(t)===58?(u=":",t++):(u=null,l('":"')),u!==null?(m=q(),m!==null?(i.charCodeAt(t)===58?(P=":",t++):(P=null,l('":"')),P!==null?($=_e(),$!==null?e=[e,s,r,n,a,u,m,P,$]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,e=q(),e!==null?(G=t,i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=q(),r!==null?s=[s,r]:(s=null,t=G)):(s=null,t=G),s=s!==null?s:"",s!==null?(G=t,i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?r=[r,n]:(r=null,t=G)):(r=null,t=G),r=r!==null?r:"",r!==null?(G=t,i.charCodeAt(t)===58?(n=":",t++):(n=null,l('":"')),n!==null?(a=q(),a!==null?n=[n,a]:(n=null,t=G)):(n=null,t=G),n=n!==null?n:"",n!==null?(i.substr(t,2)==="::"?(a="::",t+=2):(a=null,l('"::"')),a!==null?(u=q(),u!==null?(i.charCodeAt(t)===58?(m=":",t++):(m=null,l('":"')),m!==null?(P=_e(),P!==null?e=[e,s,r,n,a,u,m,P]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,e=q(),e!==null?(G=t,i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=q(),r!==null?s=[s,r]:(s=null,t=G)):(s=null,t=G),s=s!==null?s:"",s!==null?(G=t,i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?r=[r,n]:(r=null,t=G)):(r=null,t=G),r=r!==null?r:"",r!==null?(G=t,i.charCodeAt(t)===58?(n=":",t++):(n=null,l('":"')),n!==null?(a=q(),a!==null?n=[n,a]:(n=null,t=G)):(n=null,t=G),n=n!==null?n:"",n!==null?(G=t,i.charCodeAt(t)===58?(a=":",t++):(a=null,l('":"')),a!==null?(u=q(),u!==null?a=[a,u]:(a=null,t=G)):(a=null,t=G),a=a!==null?a:"",a!==null?(i.substr(t,2)==="::"?(u="::",t+=2):(u=null,l('"::"')),u!==null?(m=_e(),m!==null?e=[e,s,r,n,a,u,m]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,e=q(),e!==null?(G=t,i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=q(),r!==null?s=[s,r]:(s=null,t=G)):(s=null,t=G),s=s!==null?s:"",s!==null?(G=t,i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?r=[r,n]:(r=null,t=G)):(r=null,t=G),r=r!==null?r:"",r!==null?(G=t,i.charCodeAt(t)===58?(n=":",t++):(n=null,l('":"')),n!==null?(a=q(),a!==null?n=[n,a]:(n=null,t=G)):(n=null,t=G),n=n!==null?n:"",n!==null?(G=t,i.charCodeAt(t)===58?(a=":",t++):(a=null,l('":"')),a!==null?(u=q(),u!==null?a=[a,u]:(a=null,t=G)):(a=null,t=G),a=a!==null?a:"",a!==null?(G=t,i.charCodeAt(t)===58?(u=":",t++):(u=null,l('":"')),u!==null?(m=q(),m!==null?u=[u,m]:(u=null,t=G)):(u=null,t=G),u=u!==null?u:"",u!==null?(i.substr(t,2)==="::"?(m="::",t+=2):(m=null,l('"::"')),m!==null?(P=q(),P!==null?e=[e,s,r,n,a,u,m,P]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L),e===null&&(L=t,e=q(),e!==null?(G=t,i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=q(),r!==null?s=[s,r]:(s=null,t=G)):(s=null,t=G),s=s!==null?s:"",s!==null?(G=t,i.charCodeAt(t)===58?(r=":",t++):(r=null,l('":"')),r!==null?(n=q(),n!==null?r=[r,n]:(r=null,t=G)):(r=null,t=G),r=r!==null?r:"",r!==null?(G=t,i.charCodeAt(t)===58?(n=":",t++):(n=null,l('":"')),n!==null?(a=q(),a!==null?n=[n,a]:(n=null,t=G)):(n=null,t=G),n=n!==null?n:"",n!==null?(G=t,i.charCodeAt(t)===58?(a=":",t++):(a=null,l('":"')),a!==null?(u=q(),u!==null?a=[a,u]:(a=null,t=G)):(a=null,t=G),a=a!==null?a:"",a!==null?(G=t,i.charCodeAt(t)===58?(u=":",t++):(u=null,l('":"')),u!==null?(m=q(),m!==null?u=[u,m]:(u=null,t=G)):(u=null,t=G),u=u!==null?u:"",u!==null?(G=t,i.charCodeAt(t)===58?(m=":",t++):(m=null,l('":"')),m!==null?(P=q(),P!==null?m=[m,P]:(m=null,t=G)):(m=null,t=G),m=m!==null?m:"",m!==null?(i.substr(t,2)==="::"?(P="::",t+=2):(P=null,l('"::"')),P!==null?e=[e,s,r,n,a,u,m,P]:(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L)):(e=null,t=L))))))))))))))),e!==null&&(e=(function(Fl){return b.host_type="IPv6",i.substring(t,Fl)})(Lt)),e===null&&(t=Lt),e}function q(){var e,s,r,n,a;return a=t,e=x(),e!==null?(s=x(),s=s!==null?s:"",s!==null?(r=x(),r=r!==null?r:"",r!==null?(n=x(),n=n!==null?n:"",n!==null?e=[e,s,r,n]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e}function _e(){var e,s,r,n;return n=t,e=q(),e!==null?(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=q(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e===null&&(e=Le()),e}function Le(){var e,s,r,n,a,u,m,P,$;return P=t,$=t,e=Me(),e!==null?(i.charCodeAt(t)===46?(s=".",t++):(s=null,l('"."')),s!==null?(r=Me(),r!==null?(i.charCodeAt(t)===46?(n=".",t++):(n=null,l('"."')),n!==null?(a=Me(),a!==null?(i.charCodeAt(t)===46?(u=".",t++):(u=null,l('"."')),u!==null?(m=Me(),m!==null?e=[e,s,r,n,a,u,m]:(e=null,t=$)):(e=null,t=$)):(e=null,t=$)):(e=null,t=$)):(e=null,t=$)):(e=null,t=$)):(e=null,t=$),e!==null&&(e=(function(W){return b.host_type="IPv4",i.substring(t,W)})(P)),e===null&&(t=P),e}function Me(){var e,s,r,n;return n=t,i.substr(t,2)==="25"?(e="25",t+=2):(e=null,l('"25"')),e!==null?(/^[0-5]/.test(i.charAt(t))?(s=i.charAt(t),t++):(s=null,l("[0-5]")),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e===null&&(n=t,i.charCodeAt(t)===50?(e="2",t++):(e=null,l('"2"')),e!==null?(/^[0-4]/.test(i.charAt(t))?(s=i.charAt(t),t++):(s=null,l("[0-4]")),s!==null?(r=c(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e===null&&(n=t,i.charCodeAt(t)===49?(e="1",t++):(e=null,l('"1"')),e!==null?(s=c(),s!==null?(r=c(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e===null&&(n=t,/^[1-9]/.test(i.charAt(t))?(e=i.charAt(t),t++):(e=null,l("[1-9]")),e!==null?(s=c(),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e===null&&(e=c())))),e}function ys(){var e,s,r,n,a,u,m;return u=t,m=t,e=c(),e=e!==null?e:"",e!==null?(s=c(),s=s!==null?s:"",s!==null?(r=c(),r=r!==null?r:"",r!==null?(n=c(),n=n!==null?n:"",n!==null?(a=c(),a=a!==null?a:"",a!==null?e=[e,s,r,n,a]:(e=null,t=m)):(e=null,t=m)):(e=null,t=m)):(e=null,t=m)):(e=null,t=m),e!==null&&(e=(function(P,$){return $=parseInt($.join("")),b.port=$,$})(u,e)),e===null&&(t=u),e}function Is(){var e,s,r,n;for(e=[],n=t,i.charCodeAt(t)===59?(s=";",t++):(s=null,l('";"')),s!==null?(r=gt(),r!==null?s=[s,r]:(s=null,t=n)):(s=null,t=n);s!==null;)e.push(s),n=t,i.charCodeAt(t)===59?(s=";",t++):(s=null,l('";"')),s!==null?(r=gt(),r!==null?s=[s,r]:(s=null,t=n)):(s=null,t=n);return e}function gt(){var e;return e=ws(),e===null&&(e=bs(),e===null&&(e=Ns(),e===null&&(e=Os(),e===null&&(e=Ds(),e===null&&(e=xs(),e===null&&(e=Us())))))),e}function ws(){var e,s,r,n;return r=t,n=t,i.substr(t,10).toLowerCase()==="transport="?(e=i.substr(t,10),t+=10):(e=null,l('"transport="')),e!==null?(i.substr(t,3).toLowerCase()==="udp"?(s=i.substr(t,3),t+=3):(s=null,l('"udp"')),s===null&&(i.substr(t,3).toLowerCase()==="tcp"?(s=i.substr(t,3),t+=3):(s=null,l('"tcp"')),s===null&&(i.substr(t,4).toLowerCase()==="sctp"?(s=i.substr(t,4),t+=4):(s=null,l('"sctp"')),s===null&&(i.substr(t,3).toLowerCase()==="tls"?(s=i.substr(t,3),t+=3):(s=null,l('"tls"')),s===null&&(s=B())))),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a,u){b.uri_params||(b.uri_params={}),b.uri_params.transport=u.toLowerCase()})(r,e[1])),e===null&&(t=r),e}function bs(){var e,s,r,n;return r=t,n=t,i.substr(t,5).toLowerCase()==="user="?(e=i.substr(t,5),t+=5):(e=null,l('"user="')),e!==null?(i.substr(t,5).toLowerCase()==="phone"?(s=i.substr(t,5),t+=5):(s=null,l('"phone"')),s===null&&(i.substr(t,2).toLowerCase()==="ip"?(s=i.substr(t,2),t+=2):(s=null,l('"ip"')),s===null&&(s=B())),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a,u){b.uri_params||(b.uri_params={}),b.uri_params.user=u.toLowerCase()})(r,e[1])),e===null&&(t=r),e}function Ns(){var e,s,r,n;return r=t,n=t,i.substr(t,7).toLowerCase()==="method="?(e=i.substr(t,7),t+=7):(e=null,l('"method="')),e!==null?(s=Xe(),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a,u){b.uri_params||(b.uri_params={}),b.uri_params.method=u})(r,e[1])),e===null&&(t=r),e}function Os(){var e,s,r,n;return r=t,n=t,i.substr(t,4).toLowerCase()==="ttl="?(e=i.substr(t,4),t+=4):(e=null,l('"ttl="')),e!==null?(s=Dt(),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a,u){b.params||(b.params={}),b.params.ttl=u})(r,e[1])),e===null&&(t=r),e}function Ds(){var e,s,r,n;return r=t,n=t,i.substr(t,6).toLowerCase()==="maddr="?(e=i.substr(t,6),t+=6):(e=null,l('"maddr="')),e!==null?(s=Pe(),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e!==null&&(e=(function(a,u){b.uri_params||(b.uri_params={}),b.uri_params.maddr=u})(r,e[1])),e===null&&(t=r),e}function xs(){var e,s,r,n,a,u;return n=t,a=t,i.substr(t,2).toLowerCase()==="lr"?(e=i.substr(t,2),t+=2):(e=null,l('"lr"')),e!==null?(u=t,i.charCodeAt(t)===61?(s="=",t++):(s=null,l('"="')),s!==null?(r=B(),r!==null?s=[s,r]:(s=null,t=u)):(s=null,t=u),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(m){b.uri_params||(b.uri_params={}),b.uri_params.lr=void 0})()),e===null&&(t=n),e}function Us(){var e,s,r,n,a,u;return n=t,a=t,e=Ps(),e!==null?(u=t,i.charCodeAt(t)===61?(s="=",t++):(s=null,l('"="')),s!==null?(r=Ls(),r!==null?s=[s,r]:(s=null,t=u)):(s=null,t=u),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(m,P,$){b.uri_params||(b.uri_params={}),typeof $>"u"?$=void 0:$=$[1],b.uri_params[P.toLowerCase()]=$})(n,e[0],e[1])),e===null&&(t=n),e}function Ps(){var e,s,r;if(r=t,s=He(),s!==null)for(e=[];s!==null;)e.push(s),s=He();else e=null;return e!==null&&(e=(function(n,a){return a.join("")})(r,e)),e===null&&(t=r),e}function Ls(){var e,s,r;if(r=t,s=He(),s!==null)for(e=[];s!==null;)e.push(s),s=He();else e=null;return e!==null&&(e=(function(n,a){return a.join("")})(r,e)),e===null&&(t=r),e}function He(){var e;return e=Ms(),e===null&&(e=o(),e===null&&(e=T())),e}function Ms(){var e;return i.charCodeAt(t)===91?(e="[",t++):(e=null,l('"["')),e===null&&(i.charCodeAt(t)===93?(e="]",t++):(e=null,l('"]"')),e===null&&(i.charCodeAt(t)===47?(e="/",t++):(e=null,l('"/"')),e===null&&(i.charCodeAt(t)===58?(e=":",t++):(e=null,l('":"')),e===null&&(i.charCodeAt(t)===38?(e="&",t++):(e=null,l('"&"')),e===null&&(i.charCodeAt(t)===43?(e="+",t++):(e=null,l('"+"')),e===null&&(i.charCodeAt(t)===36?(e="$",t++):(e=null,l('"$"')))))))),e}function Hs(){var e,s,r,n,a,u,m;if(u=t,i.charCodeAt(t)===63?(e="?",t++):(e=null,l('"?"')),e!==null)if(s=ze(),s!==null){for(r=[],m=t,i.charCodeAt(t)===38?(n="&",t++):(n=null,l('"&"')),n!==null?(a=ze(),a!==null?n=[n,a]:(n=null,t=m)):(n=null,t=m);n!==null;)r.push(n),m=t,i.charCodeAt(t)===38?(n="&",t++):(n=null,l('"&"')),n!==null?(a=ze(),a!==null?n=[n,a]:(n=null,t=m)):(n=null,t=m);r!==null?e=[e,s,r]:(e=null,t=u)}else e=null,t=u;else e=null,t=u;return e}function ze(){var e,s,r,n,a;return n=t,a=t,e=Fs(),e!==null?(i.charCodeAt(t)===61?(s="=",t++):(s=null,l('"="')),s!==null?(r=$s(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m,P){m=m.join("").toLowerCase(),P=P.join(""),b.uri_headers||(b.uri_headers={}),b.uri_headers[m]?b.uri_headers[m].push(P):b.uri_headers[m]=[P]})(n,e[0],e[2])),e===null&&(t=n),e}function Fs(){var e,s;if(s=Fe(),s===null&&(s=o(),s===null&&(s=T())),s!==null)for(e=[];s!==null;)e.push(s),s=Fe(),s===null&&(s=o(),s===null&&(s=T()));else e=null;return e}function $s(){var e,s;for(e=[],s=Fe(),s===null&&(s=o(),s===null&&(s=T()));s!==null;)e.push(s),s=Fe(),s===null&&(s=o(),s===null&&(s=T()));return e}function Fe(){var e;return i.charCodeAt(t)===91?(e="[",t++):(e=null,l('"["')),e===null&&(i.charCodeAt(t)===93?(e="]",t++):(e=null,l('"]"')),e===null&&(i.charCodeAt(t)===47?(e="/",t++):(e=null,l('"/"')),e===null&&(i.charCodeAt(t)===63?(e="?",t++):(e=null,l('"?"')),e===null&&(i.charCodeAt(t)===58?(e=":",t++):(e=null,l('":"')),e===null&&(i.charCodeAt(t)===43?(e="+",t++):(e=null,l('"+"')),e===null&&(i.charCodeAt(t)===36?(e="$",t++):(e=null,l('"$"')))))))),e}function tl(){var e;return e=ar(),e===null&&(e=ks()),e}function ks(){var e,s,r,n,a,u;return u=t,e=Xe(),e!==null?(s=C(),s!==null?(r=qs(),r!==null?(n=C(),n!==null?(a=vt(),a!==null?e=[e,s,r,n,a]:(e=null,t=u)):(e=null,t=u)):(e=null,t=u)):(e=null,t=u)):(e=null,t=u),e}function qs(){var e;return e=Te(),e===null&&(e=Tt()),e}function Tt(){var e,s,r,n;return n=t,e=Ks(),e!==null?(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s!==null?(r=Gs(),r===null&&(r=Ws()),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function Gs(){var e,s,r,n,a;return n=t,e=Bs(),e===null&&(e=Ye()),e!==null?(a=t,i.charCodeAt(t)===63?(s="?",t++):(s=null,l('"?"')),s!==null?(r=Xs(),r!==null?s=[s,r]:(s=null,t=a)):(s=null,t=a),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e}function Bs(){var e,s,r,n;return n=t,i.substr(t,2)==="//"?(e="//",t+=2):(e=null,l('"//"')),e!==null?(s=zs(),s!==null?(r=Ye(),r=r!==null?r:"",r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function Ye(){var e,s,r;return r=t,i.charCodeAt(t)===47?(e="/",t++):(e=null,l('"/"')),e!==null?(s=js(),s!==null?e=[e,s]:(e=null,t=r)):(e=null,t=r),e}function Ws(){var e,s,r,n;if(n=t,e=Vs(),e!==null){for(s=[],r=$e();r!==null;)s.push(r),r=$e();s!==null?e=[e,s]:(e=null,t=n)}else e=null,t=n;return e}function $e(){var e;return e=F(),e===null&&(e=o(),e===null&&(e=T())),e}function Vs(){var e;return e=o(),e===null&&(e=T(),e===null&&(i.charCodeAt(t)===59?(e=";",t++):(e=null,l('";"')),e===null&&(i.charCodeAt(t)===63?(e="?",t++):(e=null,l('"?"')),e===null&&(i.charCodeAt(t)===58?(e=":",t++):(e=null,l('":"')),e===null&&(i.charCodeAt(t)===64?(e="@",t++):(e=null,l('"@"')),e===null&&(i.charCodeAt(t)===38?(e="&",t++):(e=null,l('"&"')),e===null&&(i.charCodeAt(t)===61?(e="=",t++):(e=null,l('"="')),e===null&&(i.charCodeAt(t)===43?(e="+",t++):(e=null,l('"+"')),e===null&&(i.charCodeAt(t)===36?(e="$",t++):(e=null,l('"$"')),e===null&&(i.charCodeAt(t)===44?(e=",",t++):(e=null,l('","')))))))))))),e}function js(){var e,s,r,n,a,u;if(a=t,e=Je(),e!==null){for(s=[],u=t,i.charCodeAt(t)===47?(r="/",t++):(r=null,l('"/"')),r!==null?(n=Je(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,i.charCodeAt(t)===47?(r="/",t++):(r=null,l('"/"')),r!==null?(n=Je(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function Je(){var e,s,r,n,a,u;for(a=t,e=[],s=ke();s!==null;)e.push(s),s=ke();if(e!==null){for(s=[],u=t,i.charCodeAt(t)===59?(r=";",t++):(r=null,l('";"')),r!==null?(n=Ct(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,i.charCodeAt(t)===59?(r=";",t++):(r=null,l('";"')),r!==null?(n=Ct(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function Ct(){var e,s;for(e=[],s=ke();s!==null;)e.push(s),s=ke();return e}function ke(){var e;return e=o(),e===null&&(e=T(),e===null&&(i.charCodeAt(t)===58?(e=":",t++):(e=null,l('":"')),e===null&&(i.charCodeAt(t)===64?(e="@",t++):(e=null,l('"@"')),e===null&&(i.charCodeAt(t)===38?(e="&",t++):(e=null,l('"&"')),e===null&&(i.charCodeAt(t)===61?(e="=",t++):(e=null,l('"="')),e===null&&(i.charCodeAt(t)===43?(e="+",t++):(e=null,l('"+"')),e===null&&(i.charCodeAt(t)===36?(e="$",t++):(e=null,l('"$"')),e===null&&(i.charCodeAt(t)===44?(e=",",t++):(e=null,l('","')))))))))),e}function Ks(){var e,s,r,n,a;if(n=t,a=t,e=R(),e!==null){for(s=[],r=R(),r===null&&(r=c(),r===null&&(i.charCodeAt(t)===43?(r="+",t++):(r=null,l('"+"')),r===null&&(i.charCodeAt(t)===45?(r="-",t++):(r=null,l('"-"')),r===null&&(i.charCodeAt(t)===46?(r=".",t++):(r=null,l('"."'))))));r!==null;)s.push(r),r=R(),r===null&&(r=c(),r===null&&(i.charCodeAt(t)===43?(r="+",t++):(r=null,l('"+"')),r===null&&(i.charCodeAt(t)===45?(r="-",t++):(r=null,l('"-"')),r===null&&(i.charCodeAt(t)===46?(r=".",t++):(r=null,l('"."'))))));s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e!==null&&(e=(function(u){b.scheme=i.substring(t,u)})(n)),e===null&&(t=n),e}function zs(){var e;return e=Ys(),e===null&&(e=Js()),e}function Ys(){var e,s,r,n;return r=t,n=t,e=je(),e!==null?(i.charCodeAt(t)===64?(s="@",t++):(s=null,l('"@"')),s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e=e!==null?e:"",e!==null?(s=Ke(),s!==null?e=[e,s]:(e=null,t=r)):(e=null,t=r),e=e!==null?e:"",e}function Js(){var e,s;if(s=o(),s===null&&(s=T(),s===null&&(i.charCodeAt(t)===36?(s="$",t++):(s=null,l('"$"')),s===null&&(i.charCodeAt(t)===44?(s=",",t++):(s=null,l('","')),s===null&&(i.charCodeAt(t)===59?(s=";",t++):(s=null,l('";"')),s===null&&(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s===null&&(i.charCodeAt(t)===64?(s="@",t++):(s=null,l('"@"')),s===null&&(i.charCodeAt(t)===38?(s="&",t++):(s=null,l('"&"')),s===null&&(i.charCodeAt(t)===61?(s="=",t++):(s=null,l('"="')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"'))))))))))),s!==null)for(e=[];s!==null;)e.push(s),s=o(),s===null&&(s=T(),s===null&&(i.charCodeAt(t)===36?(s="$",t++):(s=null,l('"$"')),s===null&&(i.charCodeAt(t)===44?(s=",",t++):(s=null,l('","')),s===null&&(i.charCodeAt(t)===59?(s=";",t++):(s=null,l('";"')),s===null&&(i.charCodeAt(t)===58?(s=":",t++):(s=null,l('":"')),s===null&&(i.charCodeAt(t)===64?(s="@",t++):(s=null,l('"@"')),s===null&&(i.charCodeAt(t)===38?(s="&",t++):(s=null,l('"&"')),s===null&&(i.charCodeAt(t)===61?(s="=",t++):(s=null,l('"="')),s===null&&(i.charCodeAt(t)===43?(s="+",t++):(s=null,l('"+"')))))))))));else e=null;return e}function Xs(){var e,s;for(e=[],s=$e();s!==null;)e.push(s),s=$e();return e}function vt(){var e,s,r,n,a,u,m,P;if(m=t,P=t,i.substr(t,3).toLowerCase()==="sip"?(e=i.substr(t,3),t+=3):(e=null,l('"SIP"')),e!==null)if(i.charCodeAt(t)===47?(s="/",t++):(s=null,l('"/"')),s!==null){if(n=c(),n!==null)for(r=[];n!==null;)r.push(n),n=c();else r=null;if(r!==null)if(i.charCodeAt(t)===46?(n=".",t++):(n=null,l('"."')),n!==null){if(u=c(),u!==null)for(a=[];u!==null;)a.push(u),u=c();else a=null;a!==null?e=[e,s,r,n,a]:(e=null,t=P)}else e=null,t=P;else e=null,t=P}else e=null,t=P;else e=null,t=P;return e!==null&&(e=(function($){b.sip_version=i.substring(t,$)})(m)),e===null&&(t=m),e}function Qs(){var e;return i.substr(t,6)==="INVITE"?(e="INVITE",t+=6):(e=null,l('"INVITE"')),e}function Zs(){var e;return i.substr(t,3)==="ACK"?(e="ACK",t+=3):(e=null,l('"ACK"')),e}function er(){var e;return i.substr(t,7)==="OPTIONS"?(e="OPTIONS",t+=7):(e=null,l('"OPTIONS"')),e}function tr(){var e;return i.substr(t,3)==="BYE"?(e="BYE",t+=3):(e=null,l('"BYE"')),e}function sr(){var e;return i.substr(t,6)==="CANCEL"?(e="CANCEL",t+=6):(e=null,l('"CANCEL"')),e}function rr(){var e;return i.substr(t,8)==="REGISTER"?(e="REGISTER",t+=8):(e=null,l('"REGISTER"')),e}function nr(){var e;return i.substr(t,9)==="SUBSCRIBE"?(e="SUBSCRIBE",t+=9):(e=null,l('"SUBSCRIBE"')),e}function lr(){var e;return i.substr(t,6)==="NOTIFY"?(e="NOTIFY",t+=6):(e=null,l('"NOTIFY"')),e}function ir(){var e;return i.substr(t,5)==="REFER"?(e="REFER",t+=5):(e=null,l('"REFER"')),e}function Xe(){var e,s;return s=t,e=Qs(),e===null&&(e=Zs(),e===null&&(e=er(),e===null&&(e=tr(),e===null&&(e=sr(),e===null&&(e=rr(),e===null&&(e=nr(),e===null&&(e=lr(),e===null&&(e=ir(),e===null&&(e=B()))))))))),e!==null&&(e=(function(r){return b.method=i.substring(t,r),b.method})(s)),e===null&&(t=s),e}function ar(){var e,s,r,n,a,u;return u=t,e=vt(),e!==null?(s=C(),s!==null?(r=or(),r!==null?(n=C(),n!==null?(a=cr(),a!==null?e=[e,s,r,n,a]:(e=null,t=u)):(e=null,t=u)):(e=null,t=u)):(e=null,t=u)):(e=null,t=u),e}function or(){var e,s;return s=t,e=ur(),e!==null&&(e=(function(r,n){b.status_code=parseInt(n.join(""))})(s,e)),e===null&&(t=s),e}function ur(){var e,s,r,n;return n=t,e=c(),e!==null?(s=c(),s!==null?(r=c(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function cr(){var e,s,r;for(r=t,e=[],s=F(),s===null&&(s=o(),s===null&&(s=T(),s===null&&(s=U(),s===null&&(s=M(),s===null&&(s=C(),s===null&&(s=I()))))));s!==null;)e.push(s),s=F(),s===null&&(s=o(),s===null&&(s=T(),s===null&&(s=U(),s===null&&(s=M(),s===null&&(s=C(),s===null&&(s=I()))))));return e!==null&&(e=(function(n){b.reason_phrase=i.substring(t,n)})(r)),e===null&&(t=r),e}function sl(){var e,s,r,n,a,u;if(a=t,e=qe(),e!==null){for(s=[],u=t,r=Q(),r!==null?(n=qe(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=Q(),r!==null?(n=qe(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function rl(){var e,s,r,n,a,u;return n=t,a=t,e=ce(),e!==null?(u=t,i.charCodeAt(t)===64?(s="@",t++):(s=null,l('"@"')),s!==null?(r=ce(),r!==null?s=[s,r]:(s=null,t=u)):(s=null,t=u),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(m){b=i.substring(t,m)})(n)),e===null&&(t=n),e}function nl(){var e,s,r,n,a,u,m;if(a=t,e=Y(),e===null)if(u=t,e=Qe(),e!==null){for(s=[],m=t,r=Q(),r!==null?(n=Qe(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=Q(),r!==null?(n=Qe(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P){var $,W;for(W=b.multi_header.length,$=0;$<W;$++)if(b.multi_header[$].parsed===null){b=null;break}b!==null?b=b.multi_header:b=-1})()),e===null&&(t=a),e}function Qe(){var e,s,r,n,a,u,m;if(a=t,u=t,e=Z(),e===null&&(e=Oe()),e!==null){for(s=[],m=t,r=z(),r!==null?(n=St(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=z(),r!==null?(n=St(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P){var $;b.multi_header||(b.multi_header=[]);try{$=new Ue(b.uri,b.display_name,b.params),delete b.uri,delete b.display_name,delete b.params}catch{$=null}b.multi_header.push({possition:t,offset:P,parsed:$})})(a)),e===null&&(t=a),e}function Oe(){var e,s,r,n,a;return a=t,e=Ze(),e=e!==null?e:"",e!==null?(s=Ee(),s!==null?(r=Te(),r!==null?(n=Se(),n!==null?e=[e,s,r,n]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e}function Ze(){var e,s,r,n,a,u,m;if(a=t,u=t,e=B(),e!==null){for(s=[],m=t,r=p(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=p(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e===null&&(e=X()),e!==null&&(e=(function(P,$){typeof $=="string"?b.display_name=$:b.display_name=$[1].reduce(function(W,te){return W+te[0]+te[1]},$[0])})(a,e)),e===null&&(t=a),e}function St(){var e;return e=fr(),e===null&&(e=hr(),e===null&&(e=le())),e}function fr(){var e,s,r,n,a;return n=t,a=t,i.substr(t,1).toLowerCase()==="q"?(e=i.substr(t,1),t++):(e=null,l('"q"')),e!==null?(s=J(),s!==null?(r=dr(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.params||(b.params={}),b.params.q=m})(n,e[2])),e===null&&(t=n),e}function hr(){var e,s,r,n,a;return n=t,a=t,i.substr(t,7).toLowerCase()==="expires"?(e=i.substr(t,7),t+=7):(e=null,l('"expires"')),e!==null?(s=J(),s!==null?(r=De(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.params||(b.params={}),b.params.expires=m})(n,e[2])),e===null&&(t=n),e}function De(){var e,s,r;if(r=t,s=c(),s!==null)for(e=[];s!==null;)e.push(s),s=c();else e=null;return e!==null&&(e=(function(n,a){return parseInt(a.join(""))})(r,e)),e===null&&(t=r),e}function dr(){var e,s,r,n,a,u,m,P;return u=t,m=t,i.charCodeAt(t)===48?(e="0",t++):(e=null,l('"0"')),e!==null?(P=t,i.charCodeAt(t)===46?(s=".",t++):(s=null,l('"."')),s!==null?(r=c(),r=r!==null?r:"",r!==null?(n=c(),n=n!==null?n:"",n!==null?(a=c(),a=a!==null?a:"",a!==null?s=[s,r,n,a]:(s=null,t=P)):(s=null,t=P)):(s=null,t=P)):(s=null,t=P),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=m)):(e=null,t=m),e!==null&&(e=(function($){return parseFloat(i.substring(t,$))})(u)),e===null&&(t=u),e}function le(){var e,s,r,n,a,u;return n=t,a=t,e=B(),e!==null?(u=t,s=J(),s!==null?(r=_r(),r!==null?s=[s,r]:(s=null,t=u)):(s=null,t=u),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(m,P,$){b.params||(b.params={}),typeof $>"u"?$=void 0:$=$[1],b.params[P.toLowerCase()]=$})(n,e[0],e[1])),e===null&&(t=n),e}function _r(){var e;return e=B(),e===null&&(e=Pe(),e===null&&(e=K())),e}function ll(){var e,s,r,n,a,u;if(a=t,e=pr(),e!==null){for(s=[],u=t,r=z(),r!==null?(n=Et(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=z(),r!==null?(n=Et(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function pr(){var e;return i.substr(t,6).toLowerCase()==="render"?(e=i.substr(t,6),t+=6):(e=null,l('"render"')),e===null&&(i.substr(t,7).toLowerCase()==="session"?(e=i.substr(t,7),t+=7):(e=null,l('"session"')),e===null&&(i.substr(t,4).toLowerCase()==="icon"?(e=i.substr(t,4),t+=4):(e=null,l('"icon"')),e===null&&(i.substr(t,5).toLowerCase()==="alert"?(e=i.substr(t,5),t+=5):(e=null,l('"alert"')),e===null&&(e=B())))),e}function Et(){var e;return e=mr(),e===null&&(e=le()),e}function mr(){var e,s,r,n;return n=t,i.substr(t,8).toLowerCase()==="handling"?(e=i.substr(t,8),t+=8):(e=null,l('"handling"')),e!==null?(s=J(),s!==null?(i.substr(t,8).toLowerCase()==="optional"?(r=i.substr(t,8),t+=8):(r=null,l('"optional"')),r===null&&(i.substr(t,8).toLowerCase()==="required"?(r=i.substr(t,8),t+=8):(r=null,l('"required"')),r===null&&(r=B())),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function il(){var e,s,r,n,a,u;if(a=t,e=B(),e!==null){for(s=[],u=t,r=Q(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=Q(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function al(){var e,s,r;if(r=t,s=c(),s!==null)for(e=[];s!==null;)e.push(s),s=c();else e=null;return e!==null&&(e=(function(n,a){b=parseInt(a.join(""))})(r,e)),e===null&&(t=r),e}function ol(){var e,s;return s=t,e=gr(),e!==null&&(e=(function(r){b=i.substring(t,r)})(s)),e===null&&(t=s),e}function gr(){var e,s,r,n,a,u,m,P;if(m=t,e=Tr(),e!==null)if(s=he(),s!==null)if(r=Er(),r!==null){for(n=[],P=t,a=z(),a!==null?(u=At(),u!==null?a=[a,u]:(a=null,t=P)):(a=null,t=P);a!==null;)n.push(a),P=t,a=z(),a!==null?(u=At(),u!==null?a=[a,u]:(a=null,t=P)):(a=null,t=P);n!==null?e=[e,s,r,n]:(e=null,t=m)}else e=null,t=m;else e=null,t=m;else e=null,t=m;return e}function Tr(){var e;return e=Cr(),e===null&&(e=vr()),e}function Cr(){var e;return i.substr(t,4).toLowerCase()==="text"?(e=i.substr(t,4),t+=4):(e=null,l('"text"')),e===null&&(i.substr(t,5).toLowerCase()==="image"?(e=i.substr(t,5),t+=5):(e=null,l('"image"')),e===null&&(i.substr(t,5).toLowerCase()==="audio"?(e=i.substr(t,5),t+=5):(e=null,l('"audio"')),e===null&&(i.substr(t,5).toLowerCase()==="video"?(e=i.substr(t,5),t+=5):(e=null,l('"video"')),e===null&&(i.substr(t,11).toLowerCase()==="application"?(e=i.substr(t,11),t+=11):(e=null,l('"application"')),e===null&&(e=et()))))),e}function vr(){var e;return i.substr(t,7).toLowerCase()==="message"?(e=i.substr(t,7),t+=7):(e=null,l('"message"')),e===null&&(i.substr(t,9).toLowerCase()==="multipart"?(e=i.substr(t,9),t+=9):(e=null,l('"multipart"')),e===null&&(e=et())),e}function et(){var e;return e=B(),e===null&&(e=Sr()),e}function Sr(){var e,s,r;return r=t,i.substr(t,2).toLowerCase()==="x-"?(e=i.substr(t,2),t+=2):(e=null,l('"x-"')),e!==null?(s=B(),s!==null?e=[e,s]:(e=null,t=r)):(e=null,t=r),e}function Er(){var e;return e=et(),e===null&&(e=B()),e}function At(){var e,s,r,n;return n=t,e=B(),e!==null?(s=J(),s!==null?(r=Ar(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function Ar(){var e;return e=B(),e===null&&(e=K()),e}function ul(){var e,s,r,n;return n=t,e=Rr(),e!==null?(s=p(),s!==null?(r=Xe(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function Rr(){var e,s,r;if(r=t,s=c(),s!==null)for(e=[];s!==null;)e.push(s),s=c();else e=null;return e!==null&&(e=(function(n,a){b.value=parseInt(a.join(""))})(r,e)),e===null&&(t=r),e}function cl(){var e,s;return s=t,e=De(),e!==null&&(e=(function(r,n){b=n})(s,e)),e===null&&(t=s),e}function fl(){var e,s,r,n,a,u,m;if(a=t,u=t,e=qe(),e!==null){for(s=[],m=t,r=z(),r!==null?(n=le(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=z(),r!==null?(n=le(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P,$){b.event=$.join("").toLowerCase()})(a,e[0])),e===null&&(t=a),e}function qe(){var e,s,r,n,a,u;if(a=t,e=ae(),e!==null){for(s=[],u=t,i.charCodeAt(t)===46?(r=".",t++):(r=null,l('"."')),r!==null?(n=ae(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,i.charCodeAt(t)===46?(r=".",t++):(r=null,l('"."')),r!==null?(n=ae(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function hl(){var e,s,r,n,a,u,m;if(a=t,u=t,e=Z(),e===null&&(e=Oe()),e!==null){for(s=[],m=t,r=z(),r!==null?(n=Rt(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=z(),r!==null?(n=Rt(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P){var $=b.tag;try{b=new Ue(b.uri,b.display_name,b.params),$&&b.setParam("tag",$)}catch{b=-1}})()),e===null&&(t=a),e}function Rt(){var e;return e=yt(),e===null&&(e=le()),e}function yt(){var e,s,r,n,a;return n=t,a=t,i.substr(t,3).toLowerCase()==="tag"?(e=i.substr(t,3),t+=3):(e=null,l('"tag"')),e!==null?(s=J(),s!==null?(r=B(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.tag=m})(n,e[2])),e===null&&(t=n),e}function dl(){var e,s,r;if(r=t,s=c(),s!==null)for(e=[];s!==null;)e.push(s),s=c();else e=null;return e!==null&&(e=(function(n,a){b=parseInt(a.join(""))})(r,e)),e===null&&(t=r),e}function _l(){var e,s;return s=t,e=De(),e!==null&&(e=(function(r,n){b=n})(s,e)),e===null&&(t=s),e}function pl(){var e,s,r,n,a,u,m,P,$,W;for(P=t,$=t,e=[],s=Ze();s!==null;)e.push(s),s=Ze();if(e!==null)if(s=Ee(),s!==null)if(r=Te(),r!==null)if(n=Se(),n!==null){for(a=[],W=t,u=z(),u!==null?(m=le(),m!==null?u=[u,m]:(u=null,t=W)):(u=null,t=W);u!==null;)a.push(u),W=t,u=z(),u!==null?(m=le(),m!==null?u=[u,m]:(u=null,t=W)):(u=null,t=W);a!==null?e=[e,s,r,n,a]:(e=null,t=$)}else e=null,t=$;else e=null,t=$;else e=null,t=$;else e=null,t=$;return e!==null&&(e=(function(te){try{b=new Ue(b.uri,b.display_name,b.params)}catch{b=-1}})()),e===null&&(t=P),e}function ml(){var e;return e=It(),e}function It(){var e,s,r,n,a,u,m,P;if(m=t,i.substr(t,6).toLowerCase()==="digest"?(e=i.substr(t,6),t+=6):(e=null,l('"Digest"')),e!==null)if(s=p(),s!==null)if(r=tt(),r!==null){for(n=[],P=t,a=Q(),a!==null?(u=tt(),u!==null?a=[a,u]:(a=null,t=P)):(a=null,t=P);a!==null;)n.push(a),P=t,a=Q(),a!==null?(u=tt(),u!==null?a=[a,u]:(a=null,t=P)):(a=null,t=P);n!==null?e=[e,s,r,n]:(e=null,t=m)}else e=null,t=m;else e=null,t=m;else e=null,t=m;return e===null&&(e=yr()),e}function yr(){var e,s,r,n,a,u,m,P;if(m=t,e=B(),e!==null)if(s=p(),s!==null)if(r=Ge(),r!==null){for(n=[],P=t,a=Q(),a!==null?(u=Ge(),u!==null?a=[a,u]:(a=null,t=P)):(a=null,t=P);a!==null;)n.push(a),P=t,a=Q(),a!==null?(u=Ge(),u!==null?a=[a,u]:(a=null,t=P)):(a=null,t=P);n!==null?e=[e,s,r,n]:(e=null,t=m)}else e=null,t=m;else e=null,t=m;else e=null,t=m;return e}function Ge(){var e,s,r,n;return n=t,e=B(),e!==null?(s=J(),s!==null?(r=B(),r===null&&(r=K()),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function tt(){var e;return e=Ir(),e===null&&(e=br(),e===null&&(e=Nr(),e===null&&(e=Dr(),e===null&&(e=xr(),e===null&&(e=Ur(),e===null&&(e=Pr(),e===null&&(e=Ge()))))))),e}function Ir(){var e,s,r,n;return n=t,i.substr(t,5).toLowerCase()==="realm"?(e=i.substr(t,5),t+=5):(e=null,l('"realm"')),e!==null?(s=J(),s!==null?(r=wr(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function wr(){var e,s;return s=t,e=X(),e!==null&&(e=(function(r,n){b.realm=n})(s,e)),e===null&&(t=s),e}function br(){var e,s,r,n,a,u,m,P,$;if(P=t,i.substr(t,6).toLowerCase()==="domain"?(e=i.substr(t,6),t+=6):(e=null,l('"domain"')),e!==null)if(s=J(),s!==null)if(r=Ae(),r!==null)if(n=st(),n!==null){if(a=[],$=t,m=C(),m!==null)for(u=[];m!==null;)u.push(m),m=C();else u=null;for(u!==null?(m=st(),m!==null?u=[u,m]:(u=null,t=$)):(u=null,t=$);u!==null;){if(a.push(u),$=t,m=C(),m!==null)for(u=[];m!==null;)u.push(m),m=C();else u=null;u!==null?(m=st(),m!==null?u=[u,m]:(u=null,t=$)):(u=null,t=$)}a!==null?(u=Ve(),u!==null?e=[e,s,r,n,a,u]:(e=null,t=P)):(e=null,t=P)}else e=null,t=P;else e=null,t=P;else e=null,t=P;else e=null,t=P;return e}function st(){var e;return e=Tt(),e===null&&(e=Ye()),e}function Nr(){var e,s,r,n;return n=t,i.substr(t,5).toLowerCase()==="nonce"?(e=i.substr(t,5),t+=5):(e=null,l('"nonce"')),e!==null?(s=J(),s!==null?(r=Or(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function Or(){var e,s;return s=t,e=X(),e!==null&&(e=(function(r,n){b.nonce=n})(s,e)),e===null&&(t=s),e}function Dr(){var e,s,r,n,a;return n=t,a=t,i.substr(t,6).toLowerCase()==="opaque"?(e=i.substr(t,6),t+=6):(e=null,l('"opaque"')),e!==null?(s=J(),s!==null?(r=X(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.opaque=m})(n,e[2])),e===null&&(t=n),e}function xr(){var e,s,r,n,a;return n=t,i.substr(t,5).toLowerCase()==="stale"?(e=i.substr(t,5),t+=5):(e=null,l('"stale"')),e!==null?(s=J(),s!==null?(a=t,i.substr(t,4).toLowerCase()==="true"?(r=i.substr(t,4),t+=4):(r=null,l('"true"')),r!==null&&(r=(function(u){b.stale=!0})()),r===null&&(t=a),r===null&&(a=t,i.substr(t,5).toLowerCase()==="false"?(r=i.substr(t,5),t+=5):(r=null,l('"false"')),r!==null&&(r=(function(u){b.stale=!1})()),r===null&&(t=a)),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function Ur(){var e,s,r,n,a;return n=t,a=t,i.substr(t,9).toLowerCase()==="algorithm"?(e=i.substr(t,9),t+=9):(e=null,l('"algorithm"')),e!==null?(s=J(),s!==null?(i.substr(t,3).toLowerCase()==="md5"?(r=i.substr(t,3),t+=3):(r=null,l('"MD5"')),r===null&&(i.substr(t,8).toLowerCase()==="md5-sess"?(r=i.substr(t,8),t+=8):(r=null,l('"MD5-sess"')),r===null&&(r=B())),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.algorithm=m.toUpperCase()})(n,e[2])),e===null&&(t=n),e}function Pr(){var e,s,r,n,a,u,m,P,$,W;if(P=t,i.substr(t,3).toLowerCase()==="qop"?(e=i.substr(t,3),t+=3):(e=null,l('"qop"')),e!==null)if(s=J(),s!==null)if(r=Ae(),r!==null){if($=t,n=rt(),n!==null){for(a=[],W=t,i.charCodeAt(t)===44?(u=",",t++):(u=null,l('","')),u!==null?(m=rt(),m!==null?u=[u,m]:(u=null,t=W)):(u=null,t=W);u!==null;)a.push(u),W=t,i.charCodeAt(t)===44?(u=",",t++):(u=null,l('","')),u!==null?(m=rt(),m!==null?u=[u,m]:(u=null,t=W)):(u=null,t=W);a!==null?n=[n,a]:(n=null,t=$)}else n=null,t=$;n!==null?(a=Ve(),a!==null?e=[e,s,r,n,a]:(e=null,t=P)):(e=null,t=P)}else e=null,t=P;else e=null,t=P;else e=null,t=P;return e}function rt(){var e,s;return s=t,i.substr(t,8).toLowerCase()==="auth-int"?(e=i.substr(t,8),t+=8):(e=null,l('"auth-int"')),e===null&&(i.substr(t,4).toLowerCase()==="auth"?(e=i.substr(t,4),t+=4):(e=null,l('"auth"')),e===null&&(e=B())),e!==null&&(e=(function(r,n){b.qop||(b.qop=[]),b.qop.push(n.toLowerCase())})(s,e)),e===null&&(t=s),e}function gl(){var e,s,r,n,a,u;if(a=t,e=B(),e!==null){for(s=[],u=t,r=Q(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=Q(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function Tl(){var e,s,r,n,a,u,m;if(a=t,u=t,e=nt(),e!==null){for(s=[],m=t,r=Q(),r!==null?(n=nt(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=Q(),r!==null?(n=nt(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P){var $,W;for(W=b.multi_header.length,$=0;$<W;$++)if(b.multi_header[$].parsed===null){b=null;break}b!==null?b=b.multi_header:b=-1})()),e===null&&(t=a),e}function nt(){var e,s,r,n,a,u,m;if(a=t,u=t,e=Oe(),e!==null){for(s=[],m=t,r=z(),r!==null?(n=le(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=z(),r!==null?(n=le(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P){var $;b.multi_header||(b.multi_header=[]);try{$=new Ue(b.uri,b.display_name,b.params),delete b.uri,delete b.display_name,delete b.params}catch{$=null}b.multi_header.push({possition:t,offset:P,parsed:$})})(a)),e===null&&(t=a),e}function Cl(){var e,s,r,n,a,u,m;if(a=t,u=t,i.substr(t,3).toLowerCase()==="sip"?(e=i.substr(t,3),t+=3):(e=null,l('"SIP"')),e===null&&(e=B()),e!==null){for(s=[],m=t,r=z(),r!==null?(n=wt(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=z(),r!==null?(n=wt(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P,$){if(b.protocol=$.toLowerCase(),b.params||(b.params={}),b.params.text&&b.params.text[0]==='"'){var W=b.params.text;b.text=W.substring(1,W.length-1),delete b.params.text}})(a,e[0])),e===null&&(t=a),e}function wt(){var e;return e=Lr(),e===null&&(e=le()),e}function Lr(){var e,s,r,n,a,u;if(a=t,u=t,i.substr(t,5).toLowerCase()==="cause"?(e=i.substr(t,5),t+=5):(e=null,l('"cause"')),e!==null)if(s=J(),s!==null){if(n=c(),n!==null)for(r=[];n!==null;)r.push(n),n=c();else r=null;r!==null?e=[e,s,r]:(e=null,t=u)}else e=null,t=u;else e=null,t=u;return e!==null&&(e=(function(m,P){b.cause=parseInt(P.join(""))})(a,e[2])),e===null&&(t=a),e}function vl(){var e,s,r,n,a,u;if(a=t,e=B(),e!==null){for(s=[],u=t,r=Q(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=Q(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function Sl(){var e,s,r,n,a,u;if(a=t,e=lt(),e!==null){for(s=[],u=t,r=Q(),r!==null?(n=lt(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=Q(),r!==null?(n=lt(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function lt(){var e,s,r,n,a,u;if(a=t,e=Oe(),e!==null){for(s=[],u=t,r=z(),r!==null?(n=le(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=z(),r!==null?(n=le(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function El(){var e,s,r,n,a,u;if(a=t,e=Mr(),e!==null){for(s=[],u=t,r=z(),r!==null?(n=bt(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=z(),r!==null?(n=bt(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function Mr(){var e,s;return s=t,i.substr(t,6).toLowerCase()==="active"?(e=i.substr(t,6),t+=6):(e=null,l('"active"')),e===null&&(i.substr(t,7).toLowerCase()==="pending"?(e=i.substr(t,7),t+=7):(e=null,l('"pending"')),e===null&&(i.substr(t,10).toLowerCase()==="terminated"?(e=i.substr(t,10),t+=10):(e=null,l('"terminated"')),e===null&&(e=B()))),e!==null&&(e=(function(r){b.state=i.substring(t,r)})(s)),e===null&&(t=s),e}function bt(){var e,s,r,n,a;return n=t,a=t,i.substr(t,6).toLowerCase()==="reason"?(e=i.substr(t,6),t+=6):(e=null,l('"reason"')),e!==null?(s=J(),s!==null?(r=Hr(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){typeof m<"u"&&(b.reason=m)})(n,e[2])),e===null&&(t=n),e===null&&(n=t,a=t,i.substr(t,7).toLowerCase()==="expires"?(e=i.substr(t,7),t+=7):(e=null,l('"expires"')),e!==null?(s=J(),s!==null?(r=De(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){typeof m<"u"&&(b.expires=m)})(n,e[2])),e===null&&(t=n),e===null&&(n=t,a=t,i.substr(t,11).toLowerCase()==="retry_after"?(e=i.substr(t,11),t+=11):(e=null,l('"retry_after"')),e!==null?(s=J(),s!==null?(r=De(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){typeof m<"u"&&(b.retry_after=m)})(n,e[2])),e===null&&(t=n),e===null&&(e=le()))),e}function Hr(){var e;return i.substr(t,11).toLowerCase()==="deactivated"?(e=i.substr(t,11),t+=11):(e=null,l('"deactivated"')),e===null&&(i.substr(t,9).toLowerCase()==="probation"?(e=i.substr(t,9),t+=9):(e=null,l('"probation"')),e===null&&(i.substr(t,8).toLowerCase()==="rejected"?(e=i.substr(t,8),t+=8):(e=null,l('"rejected"')),e===null&&(i.substr(t,7).toLowerCase()==="timeout"?(e=i.substr(t,7),t+=7):(e=null,l('"timeout"')),e===null&&(i.substr(t,6).toLowerCase()==="giveup"?(e=i.substr(t,6),t+=6):(e=null,l('"giveup"')),e===null&&(i.substr(t,10).toLowerCase()==="noresource"?(e=i.substr(t,10),t+=10):(e=null,l('"noresource"')),e===null&&(i.substr(t,9).toLowerCase()==="invariant"?(e=i.substr(t,9),t+=9):(e=null,l('"invariant"')),e===null&&(e=B()))))))),e}function Al(){var e;return e=v(),e=e!==null?e:"",e}function Rl(){var e,s,r,n,a,u;if(a=t,e=B(),e!==null){for(s=[],u=t,r=Q(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=Q(),r!==null?(n=B(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e=e!==null?e:"",e}function yl(){var e,s,r,n,a,u,m;if(a=t,u=t,e=Z(),e===null&&(e=Oe()),e!==null){for(s=[],m=t,r=z(),r!==null?(n=Nt(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=z(),r!==null?(n=Nt(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P){var $=b.tag;try{b=new Ue(b.uri,b.display_name,b.params),$&&b.setParam("tag",$)}catch{b=-1}})()),e===null&&(t=a),e}function Nt(){var e;return e=yt(),e===null&&(e=le()),e}function Il(){var e,s,r,n,a,u;if(a=t,e=it(),e!==null){for(s=[],u=t,r=Q(),r!==null?(n=it(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=Q(),r!==null?(n=it(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function it(){var e,s,r,n,a,u,m,P;if(m=t,e=Wr(),e!==null)if(s=p(),s!==null)if(r=Kr(),r!==null){for(n=[],P=t,a=z(),a!==null?(u=Ot(),u!==null?a=[a,u]:(a=null,t=P)):(a=null,t=P);a!==null;)n.push(a),P=t,a=z(),a!==null?(u=Ot(),u!==null?a=[a,u]:(a=null,t=P)):(a=null,t=P);n!==null?e=[e,s,r,n]:(e=null,t=m)}else e=null,t=m;else e=null,t=m;else e=null,t=m;return e}function Ot(){var e;return e=Fr(),e===null&&(e=$r(),e===null&&(e=kr(),e===null&&(e=qr(),e===null&&(e=Gr(),e===null&&(e=le()))))),e}function Fr(){var e,s,r,n,a;return n=t,a=t,i.substr(t,3).toLowerCase()==="ttl"?(e=i.substr(t,3),t+=3):(e=null,l('"ttl"')),e!==null?(s=J(),s!==null?(r=Dt(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.ttl=m})(n,e[2])),e===null&&(t=n),e}function $r(){var e,s,r,n,a;return n=t,a=t,i.substr(t,5).toLowerCase()==="maddr"?(e=i.substr(t,5),t+=5):(e=null,l('"maddr"')),e!==null?(s=J(),s!==null?(r=Pe(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.maddr=m})(n,e[2])),e===null&&(t=n),e}function kr(){var e,s,r,n,a;return n=t,a=t,i.substr(t,8).toLowerCase()==="received"?(e=i.substr(t,8),t+=8):(e=null,l('"received"')),e!==null?(s=J(),s!==null?(r=Le(),r===null&&(r=mt()),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.received=m})(n,e[2])),e===null&&(t=n),e}function qr(){var e,s,r,n,a;return n=t,a=t,i.substr(t,6).toLowerCase()==="branch"?(e=i.substr(t,6),t+=6):(e=null,l('"branch"')),e!==null?(s=J(),s!==null?(r=B(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.branch=m})(n,e[2])),e===null&&(t=n),e}function Gr(){var e,s,r,n,a;return n=t,i.substr(t,5).toLowerCase()==="rport"?(e=i.substr(t,5),t+=5):(e=null,l('"rport"')),e!==null?(a=t,s=J(),s!==null?(r=Br(),r!==null?s=[s,r]:(s=null,t=a)):(s=null,t=a),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e}function Br(){var e,s,r,n,a,u,m;return u=t,m=t,e=c(),e=e!==null?e:"",e!==null?(s=c(),s=s!==null?s:"",s!==null?(r=c(),r=r!==null?r:"",r!==null?(n=c(),n=n!==null?n:"",n!==null?(a=c(),a=a!==null?a:"",a!==null?e=[e,s,r,n,a]:(e=null,t=m)):(e=null,t=m)):(e=null,t=m)):(e=null,t=m)):(e=null,t=m),e!==null&&(e=(function(P,$){b.rport=parseInt($.join(""))})(u,e)),e===null&&(t=u),e}function Wr(){var e,s,r,n,a,u;return u=t,e=Vr(),e!==null?(s=he(),s!==null?(r=B(),r!==null?(n=he(),n!==null?(a=jr(),a!==null?e=[e,s,r,n,a]:(e=null,t=u)):(e=null,t=u)):(e=null,t=u)):(e=null,t=u)):(e=null,t=u),e}function Vr(){var e,s;return s=t,i.substr(t,3).toLowerCase()==="sip"?(e=i.substr(t,3),t+=3):(e=null,l('"SIP"')),e===null&&(e=B()),e!==null&&(e=(function(r,n){b.protocol=n})(s,e)),e===null&&(t=s),e}function jr(){var e,s;return s=t,i.substr(t,3).toLowerCase()==="udp"?(e=i.substr(t,3),t+=3):(e=null,l('"UDP"')),e===null&&(i.substr(t,3).toLowerCase()==="tcp"?(e=i.substr(t,3),t+=3):(e=null,l('"TCP"')),e===null&&(i.substr(t,3).toLowerCase()==="tls"?(e=i.substr(t,3),t+=3):(e=null,l('"TLS"')),e===null&&(i.substr(t,4).toLowerCase()==="sctp"?(e=i.substr(t,4),t+=4):(e=null,l('"SCTP"')),e===null&&(e=B())))),e!==null&&(e=(function(r,n){b.transport=n})(s,e)),e===null&&(t=s),e}function Kr(){var e,s,r,n,a;return n=t,e=zr(),e!==null?(a=t,s=Ne(),s!==null?(r=Yr(),r!==null?s=[s,r]:(s=null,t=a)):(s=null,t=a),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=n)):(e=null,t=n),e}function zr(){var e,s;return s=t,e=Le(),e===null&&(e=pt(),e===null&&(e=dt())),e!==null&&(e=(function(r){b.host=i.substring(t,r)})(s)),e===null&&(t=s),e}function Yr(){var e,s,r,n,a,u,m;return u=t,m=t,e=c(),e=e!==null?e:"",e!==null?(s=c(),s=s!==null?s:"",s!==null?(r=c(),r=r!==null?r:"",r!==null?(n=c(),n=n!==null?n:"",n!==null?(a=c(),a=a!==null?a:"",a!==null?e=[e,s,r,n,a]:(e=null,t=m)):(e=null,t=m)):(e=null,t=m)):(e=null,t=m)):(e=null,t=m),e!==null&&(e=(function(P,$){b.port=parseInt($.join(""))})(u,e)),e===null&&(t=u),e}function Dt(){var e,s,r,n,a;return n=t,a=t,e=c(),e!==null?(s=c(),s=s!==null?s:"",s!==null?(r=c(),r=r!==null?r:"",r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){return parseInt(m.join(""))})(n,e)),e===null&&(t=n),e}function wl(){var e;return e=It(),e}function bl(){var e,s,r,n,a,u;if(a=t,e=Jr(),e!==null){for(s=[],u=t,r=z(),r!==null?(n=xt(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=z(),r!==null?(n=xt(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function Jr(){var e,s;return s=t,e=De(),e!==null&&(e=(function(r,n){b.expires=n})(s,e)),e===null&&(t=s),e}function xt(){var e;return e=Xr(),e===null&&(e=le()),e}function Xr(){var e,s,r,n,a;return n=t,a=t,i.substr(t,9).toLowerCase()==="refresher"?(e=i.substr(t,9),t+=9):(e=null,l('"refresher"')),e!==null?(s=J(),s!==null?(i.substr(t,3).toLowerCase()==="uac"?(r=i.substr(t,3),t+=3):(r=null,l('"uac"')),r===null&&(i.substr(t,3).toLowerCase()==="uas"?(r=i.substr(t,3),t+=3):(r=null,l('"uas"'))),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.refresher=m.toLowerCase()})(n,e[2])),e===null&&(t=n),e}function Nl(){var e,s,r,n;return n=t,e=B(),e!==null?(s=D(),s!==null?(r=Qr(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function Qr(){var e,s;for(e=[],s=w(),s===null&&(s=M(),s===null&&(s=p()));s!==null;)e.push(s),s=w(),s===null&&(s=M(),s===null&&(s=p()));return e}function Ol(){var e,s;for(e=[],s=N();s!==null;)e.push(s),s=N();return e}function Dl(){var e,s,r;return r=t,i.substr(t,5)==="uuid:"?(e="uuid:",t+=5):(e=null,l('"uuid:"')),e!==null?(s=Zr(),s!==null?e=[e,s]:(e=null,t=r)):(e=null,t=r),e}function Zr(){var e,s,r,n,a,u,m,P,$,W,te;return W=t,te=t,e=en(),e!==null?(i.charCodeAt(t)===45?(s="-",t++):(s=null,l('"-"')),s!==null?(r=Ce(),r!==null?(i.charCodeAt(t)===45?(n="-",t++):(n=null,l('"-"')),n!==null?(a=Ce(),a!==null?(i.charCodeAt(t)===45?(u="-",t++):(u=null,l('"-"')),u!==null?(m=Ce(),m!==null?(i.charCodeAt(t)===45?(P="-",t++):(P=null,l('"-"')),P!==null?($=tn(),$!==null?e=[e,s,r,n,a,u,m,P,$]:(e=null,t=te)):(e=null,t=te)):(e=null,t=te)):(e=null,t=te)):(e=null,t=te)):(e=null,t=te)):(e=null,t=te)):(e=null,t=te)):(e=null,t=te),e!==null&&(e=(function(me,at){b=i.substring(t+5,me)})(W,e[0])),e===null&&(t=W),e}function Ce(){var e,s,r,n,a;return a=t,e=x(),e!==null?(s=x(),s!==null?(r=x(),r!==null?(n=x(),n!==null?e=[e,s,r,n]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e}function en(){var e,s,r;return r=t,e=Ce(),e!==null?(s=Ce(),s!==null?e=[e,s]:(e=null,t=r)):(e=null,t=r),e}function tn(){var e,s,r,n;return n=t,e=Ce(),e!==null?(s=Ce(),s!==null?(r=Ce(),r!==null?e=[e,s,r]:(e=null,t=n)):(e=null,t=n)):(e=null,t=n),e}function xl(){var e,s,r,n,a,u,m;if(a=t,u=t,e=Z(),e===null&&(e=Oe()),e!==null){for(s=[],m=t,r=z(),r!==null?(n=le(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);r!==null;)s.push(r),m=t,r=z(),r!==null?(n=le(),n!==null?r=[r,n]:(r=null,t=m)):(r=null,t=m);s!==null?e=[e,s]:(e=null,t=u)}else e=null,t=u;return e!==null&&(e=(function(P){try{b=new Ue(b.uri,b.display_name,b.params)}catch{b=-1}})()),e===null&&(t=a),e}function Ul(){var e,s,r,n,a,u;if(a=t,e=sn(),e!==null){for(s=[],u=t,r=z(),r!==null?(n=Ut(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);r!==null;)s.push(r),u=t,r=z(),r!==null?(n=Ut(),n!==null?r=[r,n]:(r=null,t=u)):(r=null,t=u);s!==null?e=[e,s]:(e=null,t=a)}else e=null,t=a;return e}function sn(){var e,s,r,n,a,u;return n=t,a=t,e=ce(),e!==null?(u=t,i.charCodeAt(t)===64?(s="@",t++):(s=null,l('"@"')),s!==null?(r=ce(),r!==null?s=[s,r]:(s=null,t=u)):(s=null,t=u),s=s!==null?s:"",s!==null?e=[e,s]:(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(m){b.call_id=i.substring(t,m)})(n)),e===null&&(t=n),e}function Ut(){var e;return e=rn(),e===null&&(e=nn(),e===null&&(e=ln(),e===null&&(e=le()))),e}function rn(){var e,s,r,n,a;return n=t,a=t,i.substr(t,6)==="to-tag"?(e="to-tag",t+=6):(e=null,l('"to-tag"')),e!==null?(s=J(),s!==null?(r=B(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.to_tag=m})(n,e[2])),e===null&&(t=n),e}function nn(){var e,s,r,n,a;return n=t,a=t,i.substr(t,8)==="from-tag"?(e="from-tag",t+=8):(e=null,l('"from-tag"')),e!==null?(s=J(),s!==null?(r=B(),r!==null?e=[e,s,r]:(e=null,t=a)):(e=null,t=a)):(e=null,t=a),e!==null&&(e=(function(u,m){b.from_tag=m})(n,e[2])),e===null&&(t=n),e}function ln(){var e,s;return s=t,i.substr(t,10)==="early-only"?(e="early-only",t+=10):(e=null,l('"early-only"')),e!==null&&(e=(function(r){b.early_only=!0})()),e===null&&(t=s),e}function Pl(e){e.sort();for(var s=null,r=[],n=0;n<e.length;n++)e[n]!==s&&(r.push(e[n]),s=e[n]);return r}function Ll(){for(var e=1,s=1,r=!1,n=0;n<Math.max(t,h);n++){var a=i.charAt(n);a===`
4
4
  `?(r||e++,s=1,r=!1):a==="\r"||a==="\u2028"||a==="\u2029"?(e++,s=1,r=!0):(s++,r=!1)}return{line:e,column:s}}var an=ye(),Ue=Ts(),b={},Ml=E[_]();if(Ml===null||t!==i.length){var Pt=Math.max(t,h),Hl=Pt<i.length?i.charAt(Pt):null,on=Ll();return new this.SyntaxError(Pl(d),Hl,Pt,on.line,on.column),-1}return b},toSource:function(){return this._source}};return y.SyntaxError=function(i,_,E,t,h){function d(l,g){var c,R;switch(l.length){case 0:c="end of input";break;case 1:c=l[0];break;default:c=l.slice(0,l.length-1).join(", ")+" or "+l[l.length-1]}return R=g?O(g):"end of input","Expected "+c+" but "+R+" found."}this.name="SyntaxError",this.expected=i,this.found=_,this.message=d(i,_),this.offset=E,this.line=t,this.column=h},y.SyntaxError.prototype=Error.prototype,y})()),$t}var kt,dn;function ye(){if(dn)return kt;dn=1;const O=ie(),y=ue(),i=ge();return kt=class Jn{static parse(E){if(E=i.parse(E,"SIP_URI"),E!==-1)return E}constructor(E,t,h,d,l={},g={}){if(!h)throw new TypeError('missing or invalid "host" parameter');this._parameters={},this._headers={},this._scheme=E||O.SIP,this._user=t,this._host=h,this._port=d;for(const c in l)Object.prototype.hasOwnProperty.call(l,c)&&this.setParam(c,l[c]);for(const c in g)Object.prototype.hasOwnProperty.call(g,c)&&this.setHeader(c,g[c])}get scheme(){return this._scheme}set scheme(E){this._scheme=E.toLowerCase()}get user(){return this._user}set user(E){this._user=E}get host(){return this._host}set host(E){this._host=E.toLowerCase()}get port(){return this._port}set port(E){this._port=E===0?E:parseInt(E,10)||null}setParam(E,t){E&&(this._parameters[E.toLowerCase()]=typeof t>"u"||t===null?null:t.toString())}getParam(E){if(E)return this._parameters[E.toLowerCase()]}hasParam(E){if(E)return this._parameters.hasOwnProperty(E.toLowerCase())&&!0||!1}deleteParam(E){if(E=E.toLowerCase(),this._parameters.hasOwnProperty(E)){const t=this._parameters[E];return delete this._parameters[E],t}}clearParams(){this._parameters={}}setHeader(E,t){this._headers[y.headerize(E)]=Array.isArray(t)?t:[t]}getHeader(E){if(E)return this._headers[y.headerize(E)]}hasHeader(E){if(E)return this._headers.hasOwnProperty(y.headerize(E))&&!0||!1}deleteHeader(E){if(E=y.headerize(E),this._headers.hasOwnProperty(E)){const t=this._headers[E];return delete this._headers[E],t}}clearHeaders(){this._headers={}}clone(){return new Jn(this._scheme,this._user,this._host,this._port,JSON.parse(JSON.stringify(this._parameters)),JSON.parse(JSON.stringify(this._headers)))}toString(){const E=[];let t=`${this._scheme}:`;this._user&&(t+=`${y.escapeUser(this._user)}@`),t+=this._host,(this._port||this._port===0)&&(t+=`:${this._port}`);for(const h in this._parameters)Object.prototype.hasOwnProperty.call(this._parameters,h)&&(t+=`;${h}`,this._parameters[h]!==null&&(t+=`=${this._parameters[h]}`));for(const h in this._headers)if(Object.prototype.hasOwnProperty.call(this._headers,h))for(const d of this._headers[h])E.push(`${h}=${d}`);return E.length>0&&(t+=`?${E.join("&")}`),t}toAor(E){let t=`${this._scheme}:`;return this._user&&(t+=`${y.escapeUser(this._user)}@`),t+=this._host,E&&(this._port||this._port===0)&&(t+=`:${this._port}`),t}},kt}var _n;function ue(){if(_n)return ne;_n=1;const O=ie(),y=ye(),i=ge();ne.str_utf8_length=h=>unescape(encodeURIComponent(h)).length;const _=ne.isFunction=h=>h!==void 0?Object.prototype.toString.call(h)==="[object Function]":!1;ne.isString=h=>h!==void 0?Object.prototype.toString.call(h)==="[object String]":!1,ne.isDecimal=h=>!isNaN(h)&&parseFloat(h)===parseInt(h,10),ne.isEmpty=h=>h===null||h===""||h===void 0||Array.isArray(h)&&h.length===0||typeof h=="number"&&isNaN(h),ne.hasMethods=function(h,...d){for(const l of d)if(_(h[l]))return!1;return!0};const E=ne.createRandomToken=(h,d=32)=>{let l,g,c="";for(l=0;l<h;l++)g=Math.random()*d|0,c+=g.toString(d);return c};ne.newTag=()=>E(10),ne.newUUID=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,d=>{const l=Math.random()*16|0;return(d==="x"?l:l&3|8).toString(16)}),ne.hostType=h=>{if(h){if(h=i.parse(h,"host"),h!==-1)return h.host_type}else return};const t=ne.escapeUser=h=>encodeURIComponent(decodeURIComponent(h)).replace(/%3A/ig,":").replace(/%2B/ig,"+").replace(/%3F/ig,"?").replace(/%2F/ig,"/");return ne.normalizeTarget=(h,d)=>{if(h){if(h instanceof y)return h;if(typeof h=="string"){const l=h.split("@");let g,c;switch(l.length){case 1:if(!d)return;g=h,c=d;break;case 2:g=l[0],c=l[1];break;default:g=l.slice(0,l.length-1).join("@"),c=l[l.length-1]}g=g.replace(/^(sips?|tel):/i,""),/^[-.()]*\+?[0-9\-.()]+$/.test(g)&&(g=g.replace(/[-.()]/g,"")),h=`${O.SIP}:${t(g)}@${c}`;let R;return(R=y.parse(h))?R:void 0}else return}else return},ne.headerize=h=>{const d={"Call-Id":"Call-ID",Cseq:"CSeq","Www-Authenticate":"WWW-Authenticate"},l=h.toLowerCase().replace(/_/g,"-").split("-");let g="";const c=l.length;let R;for(R=0;R<c;R++)R!==0&&(g+="-"),g+=l[R].charAt(0).toUpperCase()+l[R].substring(1);return d[g]&&(g=d[g]),g},ne.sipErrorCause=h=>{for(const d in O.SIP_ERROR_CAUSES)if(O.SIP_ERROR_CAUSES[d].indexOf(h)!==-1)return O.causes[d];return O.causes.SIP_FAILURE_CODE},ne.getRandomTestNetIP=()=>{function h(d,l){return Math.floor(Math.random()*(l-d+1)+d)}return`192.0.2.${h(1,254)}`},ne.calculateMD5=h=>{function d(j,V){return j<<V|j>>>32-V}function l(j,V){const K=j&2147483648,X=V&2147483648,se=j&1073741824,re=V&1073741824,Z=(j&1073741823)+(V&1073741823);return se&re?Z^2147483648^K^X:se|re?Z&1073741824?Z^3221225472^K^X:Z^1073741824^K^X:Z^K^X}function g(j,V,K){return j&V|~j&K}function c(j,V,K){return j&K|V&~K}function R(j,V,K){return j^V^K}function x(j,V,K){return V^(j|~K)}function S(j,V,K,X,se,re,Z){return j=l(j,l(l(g(V,K,X),se),Z)),l(d(j,re),V)}function N(j,V,K,X,se,re,Z){return j=l(j,l(l(c(V,K,X),se),Z)),l(d(j,re),V)}function k(j,V,K,X,se,re,Z){return j=l(j,l(l(R(V,K,X),se),Z)),l(d(j,re),V)}function C(j,V,K,X,se,re,Z){return j=l(j,l(l(x(V,K,X),se),Z)),l(d(j,re),V)}function I(j){let V;const K=j.length,X=K+8,re=((X-X%64)/64+1)*16,Z=new Array(re-1);let Te=0,de=0;for(;de<K;)V=(de-de%4)/4,Te=de%4*8,Z[V]=Z[V]|j.charCodeAt(de)<<Te,de++;return V=(de-de%4)/4,Te=de%4*8,Z[V]=Z[V]|128<<Te,Z[re-2]=K<<3,Z[re-1]=K>>>29,Z}function H(j){let V="",K="",X,se;for(se=0;se<=3;se++)X=j>>>se*8&255,K=`0${X.toString(16)}`,V=V+K.substr(K.length-2,2);return V}function F(j){let V="";for(let K=0;K<j.length;K++){const X=j.charCodeAt(K);X<128?V+=String.fromCharCode(X):X>127&&X<2048?(V+=String.fromCharCode(X>>6|192),V+=String.fromCharCode(X&63|128)):(V+=String.fromCharCode(X>>12|224),V+=String.fromCharCode(X>>6&63|128),V+=String.fromCharCode(X&63|128))}return V}let o=[],f,T,p,A,D,v,w,U,M;const ee=7,B=12,ae=17,fe=22,ce=5,Y=9,he=14,J=20,we=4,be=11,Se=16,Ee=23,Q=6,z=10,Ne=15,Ae=21;for(h=F(h),o=I(h),v=1732584193,w=4023233417,U=2562383102,M=271733878,f=0;f<o.length;f+=16)T=v,p=w,A=U,D=M,v=S(v,w,U,M,o[f+0],ee,3614090360),M=S(M,v,w,U,o[f+1],B,3905402710),U=S(U,M,v,w,o[f+2],ae,606105819),w=S(w,U,M,v,o[f+3],fe,3250441966),v=S(v,w,U,M,o[f+4],ee,4118548399),M=S(M,v,w,U,o[f+5],B,1200080426),U=S(U,M,v,w,o[f+6],ae,2821735955),w=S(w,U,M,v,o[f+7],fe,4249261313),v=S(v,w,U,M,o[f+8],ee,1770035416),M=S(M,v,w,U,o[f+9],B,2336552879),U=S(U,M,v,w,o[f+10],ae,4294925233),w=S(w,U,M,v,o[f+11],fe,2304563134),v=S(v,w,U,M,o[f+12],ee,1804603682),M=S(M,v,w,U,o[f+13],B,4254626195),U=S(U,M,v,w,o[f+14],ae,2792965006),w=S(w,U,M,v,o[f+15],fe,1236535329),v=N(v,w,U,M,o[f+1],ce,4129170786),M=N(M,v,w,U,o[f+6],Y,3225465664),U=N(U,M,v,w,o[f+11],he,643717713),w=N(w,U,M,v,o[f+0],J,3921069994),v=N(v,w,U,M,o[f+5],ce,3593408605),M=N(M,v,w,U,o[f+10],Y,38016083),U=N(U,M,v,w,o[f+15],he,3634488961),w=N(w,U,M,v,o[f+4],J,3889429448),v=N(v,w,U,M,o[f+9],ce,568446438),M=N(M,v,w,U,o[f+14],Y,3275163606),U=N(U,M,v,w,o[f+3],he,4107603335),w=N(w,U,M,v,o[f+8],J,1163531501),v=N(v,w,U,M,o[f+13],ce,2850285829),M=N(M,v,w,U,o[f+2],Y,4243563512),U=N(U,M,v,w,o[f+7],he,1735328473),w=N(w,U,M,v,o[f+12],J,2368359562),v=k(v,w,U,M,o[f+5],we,4294588738),M=k(M,v,w,U,o[f+8],be,2272392833),U=k(U,M,v,w,o[f+11],Se,1839030562),w=k(w,U,M,v,o[f+14],Ee,4259657740),v=k(v,w,U,M,o[f+1],we,2763975236),M=k(M,v,w,U,o[f+4],be,1272893353),U=k(U,M,v,w,o[f+7],Se,4139469664),w=k(w,U,M,v,o[f+10],Ee,3200236656),v=k(v,w,U,M,o[f+13],we,681279174),M=k(M,v,w,U,o[f+0],be,3936430074),U=k(U,M,v,w,o[f+3],Se,3572445317),w=k(w,U,M,v,o[f+6],Ee,76029189),v=k(v,w,U,M,o[f+9],we,3654602809),M=k(M,v,w,U,o[f+12],be,3873151461),U=k(U,M,v,w,o[f+15],Se,530742520),w=k(w,U,M,v,o[f+2],Ee,3299628645),v=C(v,w,U,M,o[f+0],Q,4096336452),M=C(M,v,w,U,o[f+7],z,1126891415),U=C(U,M,v,w,o[f+14],Ne,2878612391),w=C(w,U,M,v,o[f+5],Ae,4237533241),v=C(v,w,U,M,o[f+12],Q,1700485571),M=C(M,v,w,U,o[f+3],z,2399980690),U=C(U,M,v,w,o[f+10],Ne,4293915773),w=C(w,U,M,v,o[f+1],Ae,2240044497),v=C(v,w,U,M,o[f+8],Q,1873313359),M=C(M,v,w,U,o[f+15],z,4264355552),U=C(U,M,v,w,o[f+6],Ne,2734768916),w=C(w,U,M,v,o[f+13],Ae,1309151649),v=C(v,w,U,M,o[f+4],Q,4149444226),M=C(M,v,w,U,o[f+11],z,3174756917),U=C(U,M,v,w,o[f+2],Ne,718787259),w=C(w,U,M,v,o[f+9],Ae,3951481745),v=l(v,T),w=l(w,p),U=l(U,A),M=l(M,D);return(H(v)+H(w)+H(U)+H(M)).toLowerCase()},ne.closeMediaStream=h=>{if(h)try{let d;if(h.getTracks){d=h.getTracks();for(const l of d)l.stop()}else{d=h.getAudioTracks();for(const l of d)l.stop();d=h.getVideoTracks();for(const l of d)l.stop()}}catch{(typeof h.stop=="function"||typeof h.stop=="object")&&h.stop()}},ne.cloneArray=h=>h&&h.slice()||[],ne.cloneObject=(h,d={})=>h&&Object.assign({},h)||d,ne}var ot={exports:{}},pn;function Ie(){if(pn)return ot.exports;pn=1;var O=typeof Reflect=="object"?Reflect:null,y=O&&typeof O.apply=="function"?O.apply:function(f,T,p){return Function.prototype.apply.call(f,T,p)},i;O&&typeof O.ownKeys=="function"?i=O.ownKeys:Object.getOwnPropertySymbols?i=function(f){return Object.getOwnPropertyNames(f).concat(Object.getOwnPropertySymbols(f))}:i=function(f){return Object.getOwnPropertyNames(f)};function _(o){console&&console.warn&&console.warn(o)}var E=Number.isNaN||function(f){return f!==f};function t(){t.init.call(this)}ot.exports=t,ot.exports.once=I,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var h=10;function d(o){if(typeof o!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof o)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(o){if(typeof o!="number"||o<0||E(o))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+o+".");h=o}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(f){if(typeof f!="number"||f<0||E(f))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+f+".");return this._maxListeners=f,this};function l(o){return o._maxListeners===void 0?t.defaultMaxListeners:o._maxListeners}t.prototype.getMaxListeners=function(){return l(this)},t.prototype.emit=function(f){for(var T=[],p=1;p<arguments.length;p++)T.push(arguments[p]);var A=f==="error",D=this._events;if(D!==void 0)A=A&&D.error===void 0;else if(!A)return!1;if(A){var v;if(T.length>0&&(v=T[0]),v instanceof Error)throw v;var w=new Error("Unhandled error."+(v?" ("+v.message+")":""));throw w.context=v,w}var U=D[f];if(U===void 0)return!1;if(typeof U=="function")y(U,this,T);else for(var M=U.length,ee=N(U,M),p=0;p<M;++p)y(ee[p],this,T);return!0};function g(o,f,T,p){var A,D,v;if(d(T),D=o._events,D===void 0?(D=o._events=Object.create(null),o._eventsCount=0):(D.newListener!==void 0&&(o.emit("newListener",f,T.listener?T.listener:T),D=o._events),v=D[f]),v===void 0)v=D[f]=T,++o._eventsCount;else if(typeof v=="function"?v=D[f]=p?[T,v]:[v,T]:p?v.unshift(T):v.push(T),A=l(o),A>0&&v.length>A&&!v.warned){v.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+v.length+" "+String(f)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=o,w.type=f,w.count=v.length,_(w)}return o}t.prototype.addListener=function(f,T){return g(this,f,T,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(f,T){return g(this,f,T,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function R(o,f,T){var p={fired:!1,wrapFn:void 0,target:o,type:f,listener:T},A=c.bind(p);return A.listener=T,p.wrapFn=A,A}t.prototype.once=function(f,T){return d(T),this.on(f,R(this,f,T)),this},t.prototype.prependOnceListener=function(f,T){return d(T),this.prependListener(f,R(this,f,T)),this},t.prototype.removeListener=function(f,T){var p,A,D,v,w;if(d(T),A=this._events,A===void 0)return this;if(p=A[f],p===void 0)return this;if(p===T||p.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete A[f],A.removeListener&&this.emit("removeListener",f,p.listener||T));else if(typeof p!="function"){for(D=-1,v=p.length-1;v>=0;v--)if(p[v]===T||p[v].listener===T){w=p[v].listener,D=v;break}if(D<0)return this;D===0?p.shift():k(p,D),p.length===1&&(A[f]=p[0]),A.removeListener!==void 0&&this.emit("removeListener",f,w||T)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(f){var T,p,A;if(p=this._events,p===void 0)return this;if(p.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):p[f]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete p[f]),this;if(arguments.length===0){var D=Object.keys(p),v;for(A=0;A<D.length;++A)v=D[A],v!=="removeListener"&&this.removeAllListeners(v);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=p[f],typeof T=="function")this.removeListener(f,T);else if(T!==void 0)for(A=T.length-1;A>=0;A--)this.removeListener(f,T[A]);return this};function x(o,f,T){var p=o._events;if(p===void 0)return[];var A=p[f];return A===void 0?[]:typeof A=="function"?T?[A.listener||A]:[A]:T?C(A):N(A,A.length)}t.prototype.listeners=function(f){return x(this,f,!0)},t.prototype.rawListeners=function(f){return x(this,f,!1)},t.listenerCount=function(o,f){return typeof o.listenerCount=="function"?o.listenerCount(f):S.call(o,f)},t.prototype.listenerCount=S;function S(o){var f=this._events;if(f!==void 0){var T=f[o];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function N(o,f){for(var T=new Array(f),p=0;p<f;++p)T[p]=o[p];return T}function k(o,f){for(;f+1<o.length;f++)o[f]=o[f+1];o.pop()}function C(o){for(var f=new Array(o.length),T=0;T<f.length;++T)f[T]=o[T].listener||o[T];return f}function I(o,f){return new Promise(function(T,p){function A(v){o.removeListener(f,D),p(v)}function D(){typeof o.removeListener=="function"&&o.removeListener("error",A),T([].slice.call(arguments))}F(o,f,D,{once:!0}),f!=="error"&&H(o,A,{once:!0})})}function H(o,f,T){typeof o.on=="function"&&F(o,"error",f,T)}function F(o,f,T,p){if(typeof o.on=="function")p.once?o.once(f,T):o.on(f,T);else if(typeof o.addEventListener=="function")o.addEventListener(f,function A(D){p.once&&o.removeEventListener(f,A),T(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof o)}return ot.exports}var ut={exports:{}},qt,mn;function Vl(){if(mn)return qt;mn=1;var O=1e3,y=O*60,i=y*60,_=i*24,E=_*7,t=_*365.25;qt=function(c,R){R=R||{};var x=typeof c;if(x==="string"&&c.length>0)return h(c);if(x==="number"&&isFinite(c))return R.long?l(c):d(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function h(c){if(c=String(c),!(c.length>100)){var R=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(R){var x=parseFloat(R[1]),S=(R[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return x*t;case"weeks":case"week":case"w":return x*E;case"days":case"day":case"d":return x*_;case"hours":case"hour":case"hrs":case"hr":case"h":return x*i;case"minutes":case"minute":case"mins":case"min":case"m":return x*y;case"seconds":case"second":case"secs":case"sec":case"s":return x*O;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return x;default:return}}}}function d(c){var R=Math.abs(c);return R>=_?Math.round(c/_)+"d":R>=i?Math.round(c/i)+"h":R>=y?Math.round(c/y)+"m":R>=O?Math.round(c/O)+"s":c+"ms"}function l(c){var R=Math.abs(c);return R>=_?g(c,R,_,"day"):R>=i?g(c,R,i,"hour"):R>=y?g(c,R,y,"minute"):R>=O?g(c,R,O,"second"):c+" ms"}function g(c,R,x,S){var N=R>=x*1.5;return Math.round(c/x)+" "+S+(N?"s":"")}return qt}var Gt,gn;function jl(){if(gn)return Gt;gn=1;function O(y){_.debug=_,_.default=_,_.coerce=g,_.disable=d,_.enable=t,_.enabled=l,_.humanize=Vl(),_.destroy=c,Object.keys(y).forEach(R=>{_[R]=y[R]}),_.names=[],_.skips=[],_.formatters={};function i(R){let x=0;for(let S=0;S<R.length;S++)x=(x<<5)-x+R.charCodeAt(S),x|=0;return _.colors[Math.abs(x)%_.colors.length]}_.selectColor=i;function _(R){let x,S=null,N,k;function C(...I){if(!C.enabled)return;const H=C,F=Number(new Date),o=F-(x||F);H.diff=o,H.prev=x,H.curr=F,x=F,I[0]=_.coerce(I[0]),typeof I[0]!="string"&&I.unshift("%O");let f=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(p,A)=>{if(p==="%%")return"%";f++;const D=_.formatters[A];if(typeof D=="function"){const v=I[f];p=D.call(H,v),I.splice(f,1),f--}return p}),_.formatArgs.call(H,I),(H.log||_.log).apply(H,I)}return C.namespace=R,C.useColors=_.useColors(),C.color=_.selectColor(R),C.extend=E,C.destroy=_.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>S!==null?S:(N!==_.namespaces&&(N=_.namespaces,k=_.enabled(R)),k),set:I=>{S=I}}),typeof _.init=="function"&&_.init(C),C}function E(R,x){const S=_(this.namespace+(typeof x>"u"?":":x)+R);return S.log=this.log,S}function t(R){_.save(R),_.namespaces=R,_.names=[],_.skips=[];const x=(typeof R=="string"?R:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const S of x)S[0]==="-"?_.skips.push(S.slice(1)):_.names.push(S)}function h(R,x){let S=0,N=0,k=-1,C=0;for(;S<R.length;)if(N<x.length&&(x[N]===R[S]||x[N]==="*"))x[N]==="*"?(k=N,C=S,N++):(S++,N++);else if(k!==-1)N=k+1,C++,S=C;else return!1;for(;N<x.length&&x[N]==="*";)N++;return N===x.length}function d(){const R=[..._.names,..._.skips.map(x=>"-"+x)].join(",");return _.enable(""),R}function l(R){for(const x of _.skips)if(h(R,x))return!1;for(const x of _.names)if(h(R,x))return!0;return!1}function g(R){return R instanceof Error?R.stack||R.message:R}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return _.enable(_.load()),_}return Gt=O,Gt}var Tn;function ps(){return Tn||(Tn=1,(function(O,y){y.formatArgs=_,y.save=E,y.load=t,y.useColors=i,y.storage=h(),y.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),y.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function i(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function _(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+O.exports.humanize(this.diff),!this.useColors)return;const g="color: "+this.color;l.splice(1,0,g,"color: inherit");let c=0,R=0;l[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(c++,x==="%c"&&(R=c))}),l.splice(R,0,g)}y.log=console.debug||console.log||(()=>{});function E(l){try{l?y.storage.setItem("debug",l):y.storage.removeItem("debug")}catch{}}function t(){let l;try{l=y.storage.getItem("debug")||y.storage.getItem("DEBUG")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function h(){try{return localStorage}catch{}}O.exports=jl()(y);const{formatters:d}=O.exports;d.j=function(l){try{return JSON.stringify(l)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}})(ut,ut.exports)),ut.exports}var Bt,Cn;function oe(){if(Cn)return Bt;Cn=1;const O=ps(),y="JsSIP";return Bt=class{constructor(_){_?(this._debug=O.default(`${y}:${_}`),this._warn=O.default(`${y}:WARN:${_}`),this._error=O.default(`${y}:ERROR:${_}`)):(this._debug=O.default(y),this._warn=O.default(`${y}:WARN`),this._error=O.default(`${y}:ERROR`)),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}get debug(){return this._debug}get warn(){return this._warn}get error(){return this._error}},Bt}var pe={},Wt={},Vt={exports:{}},vn;function Cs(){if(vn)return Vt.exports;vn=1;var O=Vt.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(y){return y.encoding?"rtpmap:%d %s/%s/%s":y.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(y){return y.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(y){return y.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(y){return"extmap:%d"+(y.direction?"/%s":"%v")+(y["encrypt-uri"]?" %s":"%v")+" %s"+(y.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(y){return y.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(y){var i="candidate:%s %d %s %d %s %d typ %s";return i+=y.raddr!=null?" raddr %s rport %d":"%v%v",i+=y.tcptype!=null?" tcptype %s":"%v",y.generation!=null&&(i+=" generation %d"),i+=y["network-id"]!=null?" network-id %d":"%v",i+=y["network-cost"]!=null?" network-cost %d":"%v",i}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(y){var i="ssrc:%d";return y.attribute!=null&&(i+=" %s",y.value!=null&&(i+=":%s")),i}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(y){return y.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(y){return y.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(y){return"imageattr:%s %s %s"+(y.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(y){return"simulcast:%s %s"+(y.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(y){return"ts-refclk:%s"+(y.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(y){var i="mediaclk:";return i+=y.id!=null?"id=%s %s":"%v%s",i+=y.mediaClockValue!=null?"=%s":"",i+=y.rateNumerator!=null?" rate=%s":"",i+=y.rateDenominator!=null?"/%s":"",i}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(O).forEach(function(y){var i=O[y];i.forEach(function(_){_.reg||(_.reg=/(.*)/),_.format||(_.format="%s")})}),Vt.exports}var Sn;function Kl(){return Sn||(Sn=1,(function(O){var y=function(d){return String(Number(d))===d?Number(d):d},i=function(d,l,g,c){if(c&&!g)l[c]=y(d[1]);else for(var R=0;R<g.length;R+=1)d[R+1]!=null&&(l[g[R]]=y(d[R+1]))},_=function(d,l,g){var c=d.name&&d.names;d.push&&!l[d.push]?l[d.push]=[]:c&&!l[d.name]&&(l[d.name]={});var R=d.push?{}:c?l[d.name]:l;i(g.match(d.reg),R,d.names,d.name),d.push&&l[d.push].push(R)},E=Cs(),t=RegExp.prototype.test.bind(/^([a-z])=(.*)/);O.parse=function(d){var l={},g=[],c=l;return d.split(/(\r\n|\r|\n)/).filter(t).forEach(function(R){var x=R[0],S=R.slice(2);x==="m"&&(g.push({rtp:[],fmtp:[]}),c=g[g.length-1]);for(var N=0;N<(E[x]||[]).length;N+=1){var k=E[x][N];if(k.reg.test(S))return _(k,c,S)}}),l.media=g,l};var h=function(d,l){var g=l.split(/=(.+)/,2);return g.length===2?d[g[0]]=y(g[1]):g.length===1&&l.length>1&&(d[g[0]]=void 0),d};O.parseParams=function(d){return d.split(/;\s?/).reduce(h,{})},O.parseFmtpConfig=O.parseParams,O.parsePayloads=function(d){return d.toString().split(" ").map(Number)},O.parseRemoteCandidates=function(d){for(var l=[],g=d.split(" ").map(y),c=0;c<g.length;c+=3)l.push({component:g[c],ip:g[c+1],port:g[c+2]});return l},O.parseImageAttributes=function(d){return d.split(" ").map(function(l){return l.substring(1,l.length-1).split(",").reduce(h,{})})},O.parseSimulcastStreamList=function(d){return d.split(";").map(function(l){return l.split(",").map(function(g){var c,R=!1;return g[0]!=="~"?c=y(g):(c=y(g.substring(1,g.length)),R=!0),{scid:c,paused:R}})})}})(Wt)),Wt}var jt,En;function zl(){if(En)return jt;En=1;var O=Cs(),y=/%[sdv%]/g,i=function(h){var d=1,l=arguments,g=l.length;return h.replace(y,function(c){if(d>=g)return c;var R=l[d];switch(d+=1,c){case"%%":return"%";case"%s":return String(R);case"%d":return Number(R);case"%v":return""}})},_=function(h,d,l){var g=d.format instanceof Function?d.format(d.push?l:l[d.name]):d.format,c=[h+"="+g];if(d.names)for(var R=0;R<d.names.length;R+=1){var x=d.names[R];d.name?c.push(l[d.name][x]):c.push(l[d.names[R]])}else c.push(l[d.name]);return i.apply(null,c)},E=["v","o","s","i","u","e","p","c","b","t","r","z","a"],t=["i","c","b","a"];return jt=function(h,d){d=d||{},h.version==null&&(h.version=0),h.name==null&&(h.name=" "),h.media.forEach(function(R){R.payloads==null&&(R.payloads="")});var l=d.outerOrder||E,g=d.innerOrder||t,c=[];return l.forEach(function(R){O[R].forEach(function(x){x.name in h&&h[x.name]!=null?c.push(_(R,x,h)):x.push in h&&h[x.push]!=null&&h[x.push].forEach(function(S){c.push(_(R,x,S))})})}),h.media.forEach(function(R){c.push(_("m",O.m[0],R)),g.forEach(function(x){O[x].forEach(function(S){S.name in R&&R[S.name]!=null?c.push(_(x,S,R)):S.push in R&&R[S.push]!=null&&R[S.push].forEach(function(N){c.push(_(x,S,N))})})})}),c.join(`\r
@@ -20,7 +20,11 @@ const _i = {
20
20
  callsRegistered: "llamada(s) registrada(s)",
21
21
  noCalls: "No hay llamadas",
22
22
  startingCall: "Iniciando llamada a",
23
- callInProgress: "Ya hay una llamada en curso"
23
+ callInProgress: "Ya hay una llamada en curso",
24
+ turnOn: "Encender teléfono",
25
+ incomingCall: "Llamada entrante",
26
+ answer: "Contestar",
27
+ reject: "Rechazar"
24
28
  };
25
29
  function $l(O) {
26
30
  return O && O.__esModule && Object.prototype.hasOwnProperty.call(O, "default") ? O.default : O;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./usePhoneManager-uj2opBKT.cjs"),o=require("./index-Br8w8pI3.cjs");exports.Phone=e.Phone;exports.PhoneProvider=e.PhoneProvider;exports.default=e.Phone;exports.usePhone=e.usePhone;exports.usePhoneManager=e.usePhoneManager;exports.cn=o.cn;exports.defaultLabels=o.defaultLabels;exports.formatDuration=o.formatDuration;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./usePhoneManager-CfG7kttP.cjs"),o=require("./index-1EBiLrV_.cjs");exports.Phone=e.Phone;exports.PhoneProvider=e.PhoneProvider;exports.default=e.Phone;exports.usePhone=e.usePhone;exports.usePhoneManager=e.usePhoneManager;exports.cn=o.cn;exports.defaultLabels=o.defaultLabels;exports.formatDuration=o.formatDuration;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { P as e } from "./usePhoneManager-OZM1GaNS.js";
2
- import { a as s, u as t, b as f } from "./usePhoneManager-OZM1GaNS.js";
3
- import { c as u, d as P, f as m } from "./index-TymkBND5.js";
1
+ import { P as e } from "./usePhoneManager-CjRcDBFA.js";
2
+ import { a as s, u as t, b as f } from "./usePhoneManager-CjRcDBFA.js";
3
+ import { c as u, d as P, f as m } from "./index-8z_LWKp3.js";
4
4
  export {
5
5
  e as Phone,
6
6
  s as PhoneProvider,
@@ -1 +1 @@
1
- {"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../src/react/Phone.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,UAAU,CAAC;AAwV7D,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,UAAU,2CAW9G"}
1
+ {"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../src/react/Phone.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAoB,MAAM,UAAU,CAAC;AAsZ7D,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,UAAU,2CAW9G"}
@@ -1,4 +1,9 @@
1
1
  import type { PhoneConfig, PhoneStatus, CallHistoryEntry } from '../types';
2
+ interface IncomingCallInfo {
3
+ session: any;
4
+ callerNumber: string;
5
+ callerName?: string;
6
+ }
2
7
  interface PhoneContextValue {
3
8
  status: PhoneStatus;
4
9
  callNumber: string;
@@ -7,8 +12,13 @@ interface PhoneContextValue {
7
12
  currentCallDuration: number;
8
13
  startCall: (number: string) => void;
9
14
  endCall: () => void;
15
+ answerCall: () => void;
16
+ rejectCall: () => void;
10
17
  isReady: boolean;
11
18
  connectionStatus: 'connecting' | 'connected' | 'disconnected' | 'failed';
19
+ isInitialized: boolean;
20
+ initialize: () => void;
21
+ incomingCall: IncomingCallInfo | null;
12
22
  }
13
23
  interface PhoneProviderProps {
14
24
  config: PhoneConfig;
@@ -16,8 +26,9 @@ interface PhoneProviderProps {
16
26
  onCallStart?: (number: string) => void;
17
27
  onCallEnd?: (number: string, duration: number, status: 'completed' | 'failed') => void;
18
28
  onStatusChange?: (status: PhoneStatus) => void;
29
+ onIncomingCall?: (callerNumber: string, callerName?: string) => void;
19
30
  }
20
- export declare function PhoneProvider({ config, children, onCallStart, onCallEnd, onStatusChange }: PhoneProviderProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function PhoneProvider({ config, children, onCallStart, onCallEnd, onStatusChange, onIncomingCall }: PhoneProviderProps): import("react/jsx-runtime").JSX.Element;
21
32
  export declare function usePhone(): PhoneContextValue;
22
33
  export {};
23
34
  //# sourceMappingURL=PhoneContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneContext.d.ts","sourceRoot":"","sources":["../../src/react/PhoneContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA0J3E,UAAU,iBAAiB;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;CAC5E;AAID,UAAU,kBAAkB;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,KAAK,IAAI,CAAC;IACvF,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACjB,EAAE,kBAAkB,2CAoNpB;AAED,wBAAgB,QAAQ,sBAMvB"}
1
+ {"version":3,"file":"PhoneContext.d.ts","sourceRoot":"","sources":["../../src/react/PhoneContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAoL3E,UAAU,gBAAgB;IACtB,OAAO,EAAE,GAAG,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,iBAAiB;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;IACzE,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACzC;AAID,UAAU,kBAAkB;IACxB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,KAAK,IAAI,CAAC;IACvF,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxE;AAED,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,cAAc,EACjB,EAAE,kBAAkB,2CAuTpB;AAED,wBAAgB,QAAQ,sBAMvB"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../usePhoneManager-uj2opBKT.cjs");exports.Phone=e.Phone;exports.PhoneProvider=e.PhoneProvider;exports.default=e.Phone;exports.usePhone=e.usePhone;exports.usePhoneManager=e.usePhoneManager;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../usePhoneManager-CfG7kttP.cjs");exports.Phone=e.Phone;exports.PhoneProvider=e.PhoneProvider;exports.default=e.Phone;exports.usePhone=e.usePhone;exports.usePhoneManager=e.usePhoneManager;
@@ -1,5 +1,5 @@
1
- import { P as o } from "../usePhoneManager-OZM1GaNS.js";
2
- import { a as s, u as P, b as n } from "../usePhoneManager-OZM1GaNS.js";
1
+ import { P as o } from "../usePhoneManager-CjRcDBFA.js";
2
+ import { a as s, u as P, b as n } from "../usePhoneManager-CjRcDBFA.js";
3
3
  export {
4
4
  o as Phone,
5
5
  s as PhoneProvider,
@@ -5,7 +5,7 @@ export interface CallHistoryEntry {
5
5
  duration: number;
6
6
  status: 'completed' | 'failed' | 'missed';
7
7
  }
8
- export type PhoneStatus = 'disconnected' | 'progress' | 'confirmed' | 'failed' | 'ended';
8
+ export type PhoneStatus = 'disconnected' | 'progress' | 'confirmed' | 'failed' | 'ended' | 'ringing';
9
9
  export type ConnectionStatus = 'connecting' | 'connected' | 'disconnected' | 'failed';
10
10
  export interface PhoneConfig {
11
11
  /** WebSocket URL for the SIP connection */
@@ -32,6 +32,8 @@ export interface PhoneProps {
32
32
  onCallEnd?: (number: string, duration: number, status: 'completed' | 'failed') => void;
33
33
  /** Callback when status changes */
34
34
  onStatusChange?: (status: PhoneStatus) => void;
35
+ /** Callback when an incoming call is received */
36
+ onIncomingCall?: (callerNumber: string, callerName?: string) => void;
35
37
  /** Custom labels for internationalization */
36
38
  labels?: Partial<PhoneLabels>;
37
39
  }
@@ -51,6 +53,10 @@ export interface PhoneLabels {
51
53
  noCalls: string;
52
54
  startingCall: string;
53
55
  callInProgress: string;
56
+ turnOn: string;
57
+ incomingCall: string;
58
+ answer: string;
59
+ reject: string;
54
60
  }
55
61
  export declare const defaultLabels: PhoneLabels;
56
62
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC7C;AAED,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzF,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEtF,MAAM,WAAW,WAAW;IACxB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACvB,2CAA2C;IAC3C,MAAM,EAAE,WAAW,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,gCAAgC;IAChC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,KAAK,IAAI,CAAC;IACvF,mCAAmC;IACnC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,6CAA6C;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,EAAE,WAgB3B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC7C;AAED,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAErG,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEtF,MAAM,WAAW,WAAW;IACxB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACvB,2CAA2C;IAC3C,MAAM,EAAE,WAAW,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,gCAAgC;IAChC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,KAAK,IAAI,CAAC;IACvF,mCAAmC;IACnC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,iDAAiD;IACjD,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,6CAA6C;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,WAoB3B,CAAC"}