@arcware-cloud/pixelstreaming-websdk 0.1.11 → 0.1.12
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.
- package/index.cjs.js +3 -3
- package/index.esm.js +3 -3
- package/index.umd.js +3 -3
- package/package.json +1 -1
- package/types/lib/ArcwareConfig.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var sdp={exports:{}};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substring(7,t),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substring(t+1,n),r.value=e.substring(n+1)):r.attribute=e.substring(t+1),r},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const s=n[i],a=t.matchPrefix(e,"a=rtpmap:"+s+" ")[0];if(a){const n=t.parseRtpMap(a),i=t.matchPrefix(e,"a=fmtp:"+s+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+s+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),s=-1!==n.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),o=a.length>0&&a[0].ssrc;let l;const c=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));c.length>0&&c[0].length>1&&c[0][0]===o&&(l=c[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:o,codecPayloadType:parseInt(e.parameters.apt,10)};o&&l&&(t.rtx={ssrc:l}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:o,mechanism:s?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&o&&r.push({ssrc:o});let h=t.matchPrefix(e,"b=");return h.length&&(h=0===h[0].indexOf("b=TIAS:")?parseInt(h[0].substring(7),10):0===h[0].indexOf("b=AS:")?1e3*parseInt(h[0].substring(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=h}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const s=t.matchPrefix(e,"a=rtcp-mux");return r.mux=s.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const s=t.matchPrefix(e,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,r,n){let i;const s=void 0!==r?r:2;i=e||t.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+s+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t}(sdp);var t,s,n$1={d:(e,t)=>{for(var r in t)n$1.o(t,r)&&!n$1.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},r$1={},e;n$1.d(r$1,{Dz:()=>me,g$:()=>A$1,Lt:()=>R$1,Q9:()=>x$1,qf:()=>L$1,hV:()=>Me,z$:()=>Te,J0:()=>fe,De:()=>ge,$C:()=>ue,al:()=>_$1,_W:()=>W$1,tz:()=>B$1,Nu:()=>Ce,zg:()=>Oe,vp:()=>ne,vU:()=>re,wF:()=>q$1,rv:()=>pe,Nh:()=>ve,ss:()=>Fe,qW:()=>J$1,QL:()=>Y$1,cf:()=>Ie,eM:()=>$$a,Yd:()=>i,iM:()=>p$1,qy:()=>o$1,ce:()=>v$2,sK:()=>oe,Ok:()=>ce,q5:()=>Ee,g:()=>vt,xl:()=>N$1,I:()=>K$1,bx:()=>Q$1,Ib:()=>b$1,Az:()=>M$1,Iw:()=>w$2,qY:()=>k$1,db:()=>P$1,mR:()=>Z$1,Tn:()=>C$1,rV:()=>X$1,gh:()=>V$1,i5:()=>j$1,x_:()=>de,Am:()=>lt$1,eR:()=>F$1,r8:()=>H$1,u3:()=>Ue,vd:()=>O$1,iV:()=>I$1,jZ:()=>U$1,SW:()=>z$2,ZH:()=>G$1,Ni:()=>ht,lh:()=>D$1,bq:()=>f$1,$f:()=>St,eu:()=>se,Ax:()=>te,Mc:()=>ee});class i{static GetStackTrace(){const e=new Error;let t="No Stack Available for this browser";return e.stack&&(t=e.stack.toString().replace(/Error/g,"")),t}static SetLoggerVerbosity(e){null!=this.verboseLogLevel&&(this.verboseLogLevel=e)}static Log(e,t,r){if(r>this.verboseLogLevel)return;const n=`Level: Log\nMsg: ${t}\nCaller: ${e}`;console.log(n)}static Info(e,t,r){if(r>this.verboseLogLevel)return;const n=`Level: Info\nMsg: ${t}`;console.info(n)}static Error(e,t){const r=`Level: Error\nMsg: ${t}\nCaller: ${e}`;console.error(r)}static Warning(e,t){const r=`Level: Warning\nCaller: ${e}\nMsg: ${t}`;console.warn(r)}}i.verboseLogLevel=5,e=t||(t={}),e.LIST_STREAMERS="listStreamers",e.SUBSCRIBE="subscribe",e.UNSUBSCRIBE="unsubscribe",e.ICE_CANDIDATE="iceCandidate",e.OFFER="offer",e.ANSWER="answer",e.DATACHANNELREQUEST="dataChannelRequest",e.SFURECVDATACHANNELREADY="peerDataChannelsReady",e.PONG="pong";class o$1{payload(){return i.Log(i.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}class a$1 extends o$1{constructor(){super(),this.type=t.LIST_STREAMERS}}class d$1 extends o$1{constructor(e){super(),this.type=t.SUBSCRIBE,this.streamerId=e}}class l$1 extends o$1{constructor(){super(),this.type=t.UNSUBSCRIBE}}class c$1 extends o$1{constructor(e){super(),this.type=t.PONG,this.time=e}}class h$2 extends o$1{constructor(e){super(),this.type=t.OFFER,e&&(this.type=e.type,this.sdp=e.sdp)}}class g$1 extends o$1{constructor(e){super(),this.type=t.ANSWER,e&&(this.type=e.type,this.sdp=e.sdp)}}class u$1 extends o$1{constructor(){super(),this.type=t.DATACHANNELREQUEST}}class m$1 extends o$1{constructor(){super(),this.type=t.SFURECVDATACHANNELREADY}}class S$1{constructor(e){this.type=t.ICE_CANDIDATE,this.candidate=e}payload(){return i.Log(i.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}!function(e){e.CONFIG="config",e.STREAMER_LIST="streamerList",e.PLAYER_COUNT="playerCount",e.OFFER="offer",e.ANSWER="answer",e.ICE_CANDIDATE="iceCandidate",e.PEER_DATA_CHANNELS="peerDataChannels",e.PING="ping",e.WARNING="warning"}(s||(s={}));class p$1{}class v$2 extends p$1{}class C$1{constructor(){this.FromUEMessageHandlers=new Map}addMessageHandler(e,t){this.FromUEMessageHandlers.set(e,t)}handleMessage(e,t){this.FromUEMessageHandlers.has(e)?this.FromUEMessageHandlers.get(e)(t):i.Error(i.GetStackTrace(),`Message type of ${e} does not have a message handler registered on the frontend - ignoring message.`)}static setupDefaultHandlers(e){e.signallingProtocol.addMessageHandler(s.PING,(t=>{const r=new c$1((new Date).getTime()).payload();i.Log(i.GetStackTrace(),s.PING+": "+t,6),e.webSocket.send(r)})),e.signallingProtocol.addMessageHandler(s.CONFIG,(t=>{i.Log(i.GetStackTrace(),s.CONFIG,6);const r=JSON.parse(t);e.onConfig(r)})),e.signallingProtocol.addMessageHandler(s.STREAMER_LIST,(t=>{i.Log(i.GetStackTrace(),s.STREAMER_LIST,6);const r=JSON.parse(t);e.onStreamerList(r)})),e.signallingProtocol.addMessageHandler(s.PLAYER_COUNT,(e=>{i.Log(i.GetStackTrace(),s.PLAYER_COUNT,6);const t=JSON.parse(e);i.Log(i.GetStackTrace(),"Player Count: "+t.count,6)})),e.signallingProtocol.addMessageHandler(s.ANSWER,(t=>{i.Log(i.GetStackTrace(),s.ANSWER,6);const r=JSON.parse(t);e.onWebRtcAnswer(r)})),e.signallingProtocol.addMessageHandler(s.OFFER,(t=>{i.Log(i.GetStackTrace(),s.OFFER,6);const r=JSON.parse(t);e.onWebRtcOffer(r)})),e.signallingProtocol.addMessageHandler(s.ICE_CANDIDATE,(t=>{i.Log(i.GetStackTrace(),s.ICE_CANDIDATE,6);const r=JSON.parse(t);e.onIceCandidate(r.candidate)})),e.signallingProtocol.addMessageHandler(s.WARNING,(e=>{i.Warning(i.GetStackTrace(),`Warning received: ${e}`)})),e.signallingProtocol.addMessageHandler(s.PEER_DATA_CHANNELS,(t=>{i.Log(i.GetStackTrace(),s.PEER_DATA_CHANNELS,6);const r=JSON.parse(t);e.onWebRtcPeerDataChannels(r)}))}}class f$1{constructor(){this.WS_OPEN_STATE=1,this.onOpen=new EventTarget,this.onClose=new EventTarget,this.signallingProtocol=new C$1,C$1.setupDefaultHandlers(this)}connect(e){i.Log(i.GetStackTrace(),e,6);try{return this.webSocket=new WebSocket(e),this.webSocket.onopen=e=>this.handleOnOpen(e),this.webSocket.onerror=()=>this.handleOnError(),this.webSocket.onclose=e=>this.handleOnClose(e),this.webSocket.onmessage=e=>this.handleOnMessage(e),this.webSocket.onmessagebinary=e=>this.handleOnMessageBinary(e),!0}catch(e){return i.Error(e,e),!1}}handleOnMessageBinary(e){e&&e.data&&e.data.text().then((e=>{const t=new MessageEvent("messageFromBinary",{data:e});this.handleOnMessage(t)})).catch((e=>{i.Error(i.GetStackTrace(),`Failed to parse binary blob from websocket, reason: ${e}`)}))}handleOnMessage(e){if(e.data&&e.data instanceof Blob)return void this.handleOnMessageBinary(e);const t=JSON.parse(e.data);i.Log(i.GetStackTrace(),"received => \n"+JSON.stringify(JSON.parse(e.data),void 0,4),6),this.signallingProtocol.handleMessage(t.type,e.data)}handleOnOpen(e){i.Log(i.GetStackTrace(),"Connected to the signalling server via WebSocket",6),this.onOpen.dispatchEvent(new Event("open"))}handleOnError(){i.Error(i.GetStackTrace(),"WebSocket error")}handleOnClose(e){this.onWebSocketOncloseOverlayMessage(e),i.Log(i.GetStackTrace(),"Disconnected to the signalling server via WebSocket: "+JSON.stringify(e.code)+" - "+e.reason),this.onClose.dispatchEvent(new Event("close"))}requestStreamerList(){const e=new a$1;this.webSocket.send(e.payload())}sendSubscribe(e){const t=new d$1(e);this.webSocket.send(t.payload())}sendUnsubscribe(){const e=new l$1;this.webSocket.send(e.payload())}sendWebRtcOffer(e){const t=new h$2(e);this.webSocket.send(t.payload())}sendWebRtcAnswer(e){const t=new g$1(e);this.webSocket.send(t.payload())}sendWebRtcDatachannelRequest(){const e=new u$1;this.webSocket.send(e.payload())}sendSFURecvDataChannelReady(){const e=new m$1;this.webSocket.send(e.payload())}sendIceCandidate(e){if(i.Log(i.GetStackTrace(),"Sending Ice Candidate"),this.webSocket&&this.webSocket.readyState===this.WS_OPEN_STATE){const t=new S$1(e);this.webSocket.send(t.payload())}}close(){var e;null===(e=this.webSocket)||void 0===e||e.close()}onWebSocketOncloseOverlayMessage(e){}onConfig(e){}onStreamerList(e){}onIceCandidate(e){}onWebRtcAnswer(e){}onWebRtcOffer(e){}onWebRtcPeerDataChannels(e){}}class T$1{constructor(e){this.videoElementProvider=e,this.audioElement=document.createElement("Audio")}handleOnTrack(e){i.Log(i.GetStackTrace(),"handleOnTrack "+JSON.stringify(e.streams),6);const t=this.videoElementProvider.getVideoElement();if(e.track&&i.Log(i.GetStackTrace(),"Got track - "+e.track.kind+" id="+e.track.id+" readyState="+e.track.readyState,6),"audio"!=e.track.kind)return"video"==e.track.kind&&t.srcObject!==e.streams[0]?(t.srcObject=e.streams[0],void i.Log(i.GetStackTrace(),"Set video source from video track ontrack.")):void 0;this.CreateAudioTrack(e.streams[0])}CreateAudioTrack(e){const t=this.videoElementProvider.getVideoElement();t.srcObject!=e&&t.srcObject&&t.srcObject!==e&&(this.audioElement.srcObject=e,i.Log(i.GetStackTrace(),"Created new audio element to play separate audio stream."))}}class E$1{constructor(e){this.freezeFrameHeight=0,this.freezeFrameWidth=0,this.rootDiv=e,this.rootElement=document.createElement("div"),this.rootElement.id="freezeFrame",this.rootElement.style.display="none",this.rootElement.style.pointerEvents="none",this.rootElement.style.position="absolute",this.rootElement.style.zIndex="20",this.imageElement=document.createElement("img"),this.imageElement.style.position="absolute",this.rootElement.appendChild(this.imageElement),this.rootDiv.appendChild(this.rootElement)}setElementForShow(){this.rootElement.style.display="block"}setElementForHide(){this.rootElement.style.display="none"}updateImageElementSource(e){const t=btoa(e.reduce(((e,t)=>e+String.fromCharCode(t)),""));this.imageElement.src="data:image/jpeg;base64,"+t}setDimensionsFromElementAndResize(){this.freezeFrameHeight=this.imageElement.naturalHeight,this.freezeFrameWidth=this.imageElement.naturalWidth,this.resize()}resize(){if(0!==this.freezeFrameWidth&&0!==this.freezeFrameHeight){let e=0,t=0,r=0,n=0;const i=this.rootDiv.clientWidth/this.rootDiv.clientHeight,s=this.freezeFrameWidth/this.freezeFrameHeight;i<s?(e=this.rootDiv.clientWidth,t=Math.floor(this.rootDiv.clientWidth/s),r=Math.floor(.5*(this.rootDiv.clientHeight-t)),n=0):(e=Math.floor(this.rootDiv.clientHeight*s),t=this.rootDiv.clientHeight,r=0,n=Math.floor(.5*(this.rootDiv.clientWidth-e))),this.rootElement.style.width=this.rootDiv.offsetWidth+"px",this.rootElement.style.height=this.rootDiv.offsetHeight+"px",this.rootElement.style.left="0px",this.rootElement.style.top="0px",this.imageElement.style.width=e+"px",this.imageElement.style.height=t+"px",this.imageElement.style.left=n+"px",this.imageElement.style.top=r+"px"}}}class y$1{constructor(e){this.receiving=!1,this.size=0,this.jpeg=void 0,this.valid=!1,this.freezeFrameDelay=50,this.freezeFrame=new E$1(e)}showFreezeFrame(){this.valid&&this.freezeFrame.setElementForShow()}hideFreezeFrame(){this.valid=!1,this.freezeFrame.setElementForHide()}updateFreezeFrameAndShow(e,t){this.freezeFrame.updateImageElementSource(e),this.freezeFrame.imageElement.onload=()=>{this.freezeFrame.setDimensionsFromElementAndResize(),t()}}processFreezeFrameMessage(e,t){this.receiving||(this.receiving=!0,this.valid=!1,this.size=0,this.jpeg=void 0),this.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);const r=e.slice(5);if(this.jpeg){const e=new Uint8Array(this.jpeg.length+r.length);e.set(this.jpeg,0),e.set(r,this.jpeg.length),this.jpeg=e}else this.jpeg=r,this.receiving=!0,i.Log(i.GetStackTrace(),`received first chunk of freeze frame: ${this.jpeg.length}/${this.size}`,6);this.jpeg.length===this.size?(this.receiving=!1,this.valid=!0,i.Log(i.GetStackTrace(),`received complete freeze frame ${this.size}`,6),this.updateFreezeFrameAndShow(this.jpeg,t)):this.jpeg.length>this.size&&(i.Error(i.GetStackTrace(),`received bigger freeze frame than advertised: ${this.jpeg.length}/${this.size}`),this.jpeg=void 0,this.receiving=!1)}}class b$1{constructor(e,t,r,n,i=(()=>{})){this.onChange=i,this.onChangeEmit=()=>{},this.id=e,this.description=r,this.label=t,this.value=n}set label(e){this._label=e,this.onChangeEmit(this._value)}get label(){return this._label}get value(){return this._value}set value(e){this._value=e,this.onChange(this._value,this),this.onChangeEmit(this._value)}}class M$1 extends b$1{constructor(e,t,r,n,i,s=(()=>{})){super(e,t,r,n,s);const a=new URLSearchParams(window.location.search);if(i&&a.has(this.id)){const e=this.getUrlParamFlag();this.flag=e}else this.flag=n;this.useUrlParams=i}getUrlParamFlag(){const e=new URLSearchParams(window.location.search);return!!e.has(this.id)&&"false"!==e.get(this.id)&&"False"!==e.get(this.id)}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);!0===this.flag?e.set(this.id,"true"):e.set(this.id,"false"),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}enable(){this.flag=!0}get flag(){return!!this.value}set flag(e){this.value=e}}class w$2 extends b$1{constructor(e,t,r,n,i,s,a,o=(()=>{})){super(e,t,r,s,o),this._min=n,this._max=i;const l=new URLSearchParams(window.location.search);if(a&&l.has(this.id)){const e=Number.parseInt(l.get(this.id));this.number=Number.isNaN(e)?s:e}else this.number=s;this.useUrlParams=a}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.number.toString()),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}set number(e){this.value=this.clamp(e)}get number(){return this.value}clamp(e){return Math.max(Math.min(this._max,e),this._min)}get min(){return this._min}get max(){return this._max}addOnChangedListener(e){this.onChange=e}}class P$1 extends b$1{constructor(e,t,r,n,i,s=(()=>{})){super(e,t,r,n,s);const a=new URLSearchParams(window.location.search);if(i&&a.has(this.id)){const e=this.getUrlParamText();this.text=e}else this.text=n;this.useUrlParams=i}getUrlParamText(){var e;const t=new URLSearchParams(window.location.search);return t.has(this.id)&&null!==(e=t.get(this.id))&&void 0!==e?e:""}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.text),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}get text(){return this.value}set text(e){this.value=e}}class k$1 extends b$1{constructor(e,t,r,n,i,s,a=(()=>{})){super(e,t,r,[n,n],a),this.options=i;const o=new URLSearchParams(window.location.search),l=s&&o.has(this.id)?this.getUrlParamText():n;this.selected=l,this.useUrlParams=s}getUrlParamText(){var e;const t=new URLSearchParams(window.location.search);return t.has(this.id)&&null!==(e=t.get(this.id))&&void 0!==e?e:""}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.selected),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}addOnChangedListener(e){this.onChange=e}get options(){return this._options}set options(e){this._options=e,this.onChangeEmit(this.selected)}get selected(){return this.value}set selected(e){const t=this.options.filter((t=>-1!==t.indexOf(e)));t.length&&(this.value=t[0])}}class R$1 extends Event{constructor(e){super("afkWarningActivate"),this.data=e}}class L$1 extends Event{constructor(e){super("afkWarningUpdate"),this.data=e}}class x$1 extends Event{constructor(){super("afkWarningDeactivate")}}class A$1 extends Event{constructor(){super("afkTimedOut")}}class F$1 extends Event{constructor(e){super("videoEncoderAvgQP"),this.data=e}}class D$1 extends Event{constructor(){super("webRtcSdp")}}class O$1 extends Event{constructor(){super("webRtcAutoConnect")}}class U$1 extends Event{constructor(){super("webRtcConnecting")}}class I$1 extends Event{constructor(){super("webRtcConnected")}}class G$1 extends Event{constructor(){super("webRtcFailed")}}class z$2 extends Event{constructor(e){super("webRtcDisconnected"),this.data=e}}class B$1 extends Event{constructor(e){super("dataChannelOpen"),this.data=e}}class _$1 extends Event{constructor(e){super("dataChannelClose"),this.data=e}}class W$1 extends Event{constructor(e){super("dataChannelError"),this.data=e}}class H$1 extends Event{constructor(){super("videoInitialized")}}class V$1 extends Event{constructor(){super("streamLoading")}}class N$1 extends Event{constructor(e){super("playStreamError"),this.data=e}}class K$1 extends Event{constructor(){super("playStream")}}class Q$1 extends Event{constructor(e){super("playStreamRejected"),this.data=e}}class $$a extends Event{constructor(e){super("loadFreezeFrame"),this.data=e}}class q$1 extends Event{constructor(){super("hideFreezeFrame")}}class X$1 extends Event{constructor(e){super("statsReceived"),this.data=e}}class j$1 extends Event{constructor(e){super("streamerListMessage"),this.data=e}}class Y$1 extends Event{constructor(e){super("latencyTestResult"),this.data=e}}class J$1 extends Event{constructor(e){super("initialSettings"),this.data=e}}class Z$1 extends Event{constructor(e){super("settingsChanged"),this.data=e}}class ee extends Event{constructor(){super("xrSessionStarted")}}class te extends Event{constructor(){super("xrSessionEnded")}}class se extends Event{constructor(e){super("xrFrame"),this.data=e}}class ne extends EventTarget{dispatchEvent(e){return super.dispatchEvent(e)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}}class re{}re.AutoConnect="AutoConnect",re.AutoPlayVideo="AutoPlayVideo",re.AFKDetection="TimeoutIfIdle",re.BrowserSendOffer="OfferToReceive",re.HoveringMouseMode="HoveringMouse",re.ForceMonoAudio="ForceMonoAudio",re.ForceTURN="ForceTURN",re.FakeMouseWithTouches="FakeMouseWithTouches",re.IsQualityController="ControlsQuality",re.MatchViewportResolution="MatchViewportRes",re.PreferSFU="preferSFU",re.StartVideoMuted="StartVideoMuted",re.SuppressBrowserKeys="SuppressBrowserKeys",re.UseMic="UseMic",re.KeyboardInput="KeyboardInput",re.MouseInput="MouseInput",re.TouchInput="TouchInput",re.GamepadInput="GamepadInput",re.XRControllerInput="XRControllerInput";const ie=e=>Object.getOwnPropertyNames(re).some((t=>re[t]===e));class oe{}oe.AFKTimeoutSecs="AFKTimeout",oe.MinQP="MinQP",oe.MaxQP="MaxQP",oe.WebRTCFPS="WebRTCFPS",oe.WebRTCMinBitrate="WebRTCMinBitrate",oe.WebRTCMaxBitrate="WebRTCMaxBitrate";const ae=e=>Object.getOwnPropertyNames(oe).some((t=>oe[t]===e));class de{}de.SignallingServerUrl="ss";const le=e=>Object.getOwnPropertyNames(de).some((t=>de[t]===e));class ce{}ce.PreferredCodec="PreferredCodec",ce.StreamerId="StreamerId";const he=e=>Object.getOwnPropertyNames(ce).some((t=>ce[t]===e));class ge{constructor(e={}){this.flags=new Map,this.numericParameters=new Map,this.textParameters=new Map,this.optionParameters=new Map;const{initialSettings:t,useUrlParams:r}=e;this._useUrlParams=!!r,this.populateDefaultSettings(this._useUrlParams),t&&this.setSettings(t)}get useUrlParams(){return this._useUrlParams}populateDefaultSettings(e){this.textParameters.set(de.SignallingServerUrl,new P$1(de.SignallingServerUrl,"Signalling url","Url of the signalling server",("https:"===location.protocol?"wss://":"ws://")+window.location.hostname+("80"===window.location.port||""===window.location.port?"":`:${window.location.port}`),e)),this.optionParameters.set(ce.StreamerId,new k$1(ce.StreamerId,"Streamer ID","The ID of the streamer to stream.","",[],e)),this.optionParameters.set(ce.PreferredCodec,new k$1(ce.PreferredCodec,"Preferred Codec","The preferred codec to be used during codec negotiation","H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",function(){const e=[];if(!RTCRtpReceiver.getCapabilities)return e.push("Only available on Chrome"),e;const t=/(VP\d|H26\d|AV1).*/;return RTCRtpReceiver.getCapabilities("video").codecs.forEach((r=>{const n=r.mimeType.split("/")[1]+" "+(r.sdpFmtpLine||"");null!==t.exec(n)&&e.push(n)})),e}(),e)),this.flags.set(re.AutoConnect,new M$1(re.AutoConnect,"Auto connect to stream","Whether we should attempt to auto connect to the signalling server or show a click to start prompt.",!1,e)),this.flags.set(re.AutoPlayVideo,new M$1(re.AutoPlayVideo,"Auto play video","When video is ready automatically start playing it as opposed to showing a play button.",!0,e)),this.flags.set(re.BrowserSendOffer,new M$1(re.BrowserSendOffer,"Browser send offer","Browser will initiate the WebRTC handshake by sending the offer to the streamer",!1,e)),this.flags.set(re.UseMic,new M$1(re.UseMic,"Use microphone","Make browser request microphone access and open an input audio track.",!1,e)),this.flags.set(re.StartVideoMuted,new M$1(re.StartVideoMuted,"Start video muted","Video will start muted if true.",!1,e)),this.flags.set(re.SuppressBrowserKeys,new M$1(re.SuppressBrowserKeys,"Suppress browser keys","Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.",!0,e)),this.flags.set(re.PreferSFU,new M$1(re.PreferSFU,"Prefer SFU","Try to connect to the SFU instead of P2P.",!1,e)),this.flags.set(re.IsQualityController,new M$1(re.IsQualityController,"Is quality controller?","True if this peer controls stream quality",!0,e)),this.flags.set(re.ForceMonoAudio,new M$1(re.ForceMonoAudio,"Force mono audio","Force browser to request mono audio in the SDP",!1,e)),this.flags.set(re.ForceTURN,new M$1(re.ForceTURN,"Force TURN","Only generate TURN/Relayed ICE candidates.",!1,e)),this.flags.set(re.AFKDetection,new M$1(re.AFKDetection,"AFK if idle","Timeout the experience if user is AFK for a period.",!1,e)),this.flags.set(re.MatchViewportResolution,new M$1(re.MatchViewportResolution,"Match viewport resolution","Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.",!1,e)),this.flags.set(re.HoveringMouseMode,new M$1(re.HoveringMouseMode,"Control Scheme: Locked Mouse","Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.",!1,e,((e,t)=>{t.label=`Control Scheme: ${e?"Hovering":"Locked"} Mouse`}))),this.flags.set(re.FakeMouseWithTouches,new M$1(re.FakeMouseWithTouches,"Fake mouse with touches","A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.",!1,e)),this.flags.set(re.KeyboardInput,new M$1(re.KeyboardInput,"Keyboard input","If enabled, send keyboard events to streamer",!0,e)),this.flags.set(re.MouseInput,new M$1(re.MouseInput,"Mouse input","If enabled, send mouse events to streamer",!0,e)),this.flags.set(re.TouchInput,new M$1(re.TouchInput,"Touch input","If enabled, send touch events to streamer",!0,e)),this.flags.set(re.GamepadInput,new M$1(re.GamepadInput,"Gamepad input","If enabled, send gamepad events to streamer",!0,e)),this.flags.set(re.XRControllerInput,new M$1(re.XRControllerInput,"XR controller input","If enabled, send XR controller events to streamer",!0,e)),this.numericParameters.set(oe.AFKTimeoutSecs,new w$2(oe.AFKTimeoutSecs,"AFK timeout","The time (in seconds) it takes for the application to time out if AFK timeout is enabled.",0,600,120,e)),this.numericParameters.set(oe.MinQP,new w$2(oe.MinQP,"Min QP","The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,0,e)),this.numericParameters.set(oe.MaxQP,new w$2(oe.MaxQP,"Max QP","The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,51,e)),this.numericParameters.set(oe.WebRTCFPS,new w$2(oe.WebRTCFPS,"Max FPS","The maximum FPS that WebRTC will try to transmit frames at.",1,999,60,e)),this.numericParameters.set(oe.WebRTCMinBitrate,new w$2(oe.WebRTCMinBitrate,"Min Bitrate (kbps)","The minimum bitrate that WebRTC should use.",0,5e5,0,e)),this.numericParameters.set(oe.WebRTCMaxBitrate,new w$2(oe.WebRTCMaxBitrate,"Max Bitrate (kbps)","The maximum bitrate that WebRTC should use.",0,5e5,0,e))}_addOnNumericSettingChangedListener(e,t){this.numericParameters.has(e)&&this.numericParameters.get(e).addOnChangedListener(t)}_addOnOptionSettingChangedListener(e,t){this.optionParameters.has(e)&&this.optionParameters.get(e).addOnChangedListener(t)}getNumericSettingValue(e){if(this.numericParameters.has(e))return this.numericParameters.get(e).number;throw new Error(`There is no numeric setting with the id of ${e}`)}getTextSettingValue(e){if(this.textParameters.has(e))return this.textParameters.get(e).value;throw new Error(`There is no numeric setting with the id of ${e}`)}setNumericSetting(e,t){if(!this.numericParameters.has(e))throw new Error(`There is no numeric setting with the id of ${e}`);this.numericParameters.get(e).number=t}_addOnSettingChangedListener(e,t){this.flags.has(e)&&(this.flags.get(e).onChange=t)}_addOnTextSettingChangedListener(e,t){this.textParameters.has(e)&&(this.textParameters.get(e).onChange=t)}getSettingOption(e){return this.optionParameters.get(e)}isFlagEnabled(e){return this.flags.get(e).flag}setFlagEnabled(e,t){this.flags.has(e)?this.flags.get(e).flag=t:i.Warning(i.GetStackTrace(),`Cannot toggle flag called ${e} - it does not exist in the Config.flags map.`)}setTextSetting(e,t){this.textParameters.has(e)?this.textParameters.get(e).text=t:i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.textParameters map.`)}setOptionSettingOptions(e,t){this.optionParameters.has(e)?this.optionParameters.get(e).options=t:i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.optionParameters map.`)}setOptionSettingValue(e,t){this.optionParameters.has(e)?this.optionParameters.get(e).selected=t:i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.enumParameters map.`)}setFlagLabel(e,t){this.flags.has(e)?this.flags.get(e).label=t:i.Warning(i.GetStackTrace(),`Cannot set label for flag called ${e} - it does not exist in the Config.flags map.`)}setSettings(e){for(const t of Object.keys(e))ie(t)?this.setFlagEnabled(t,e[t]):ae(t)?this.setNumericSetting(t,e[t]):le(t)?this.setTextSetting(t,e[t]):he(t)&&this.setOptionSettingValue(t,e[t])}getSettings(){const e={};for(const[t,r]of this.flags.entries())e[t]=r.flag;for(const[t,r]of this.numericParameters.entries())e[t]=r.number;for(const[t,r]of this.textParameters.entries())e[t]=r.text;for(const[t,r]of this.optionParameters.entries())e[t]=r.selected;return e}getFlags(){return Array.from(this.flags.values())}getTextSettings(){return Array.from(this.textParameters.values())}getNumericSettings(){return Array.from(this.numericParameters.values())}getOptionSettings(){return Array.from(this.optionParameters.values())}_registerOnChangeEvents(e){for(const t of this.flags.keys()){const r=this.flags.get(t);r&&(r.onChangeEmit=t=>e.dispatchEvent(new Z$1({id:r.id,type:"flag",value:t,target:r})))}for(const t of this.numericParameters.keys()){const r=this.numericParameters.get(t);r&&(r.onChangeEmit=t=>e.dispatchEvent(new Z$1({id:r.id,type:"number",value:t,target:r})))}for(const t of this.textParameters.keys()){const r=this.textParameters.get(t);r&&(r.onChangeEmit=t=>e.dispatchEvent(new Z$1({id:r.id,type:"text",value:t,target:r})))}for(const t of this.optionParameters.keys()){const r=this.optionParameters.get(t);r&&(r.onChangeEmit=t=>e.dispatchEvent(new Z$1({id:r.id,type:"option",value:t,target:r})))}}}var ue;!function(e){e[e.LockedMouse=0]="LockedMouse",e[e.HoveringMouse=1]="HoveringMouse"}(ue||(ue={}));class me{constructor(e,t,r){this.closeTimeout=10,this.active=!1,this.countdownActive=!1,this.warnTimer=void 0,this.countDown=0,this.countDownTimer=void 0,this.config=e,this.pixelStreaming=t,this.onDismissAfk=r,this.onAFKTimedOutCallback=()=>{console.log("AFK timed out, did you want to override this callback?")}}onAfkClick(){clearInterval(this.countDownTimer),(this.active||this.countdownActive)&&(this.startAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new x$1))}startAfkWarningTimer(){this.config.getNumericSettingValue(oe.AFKTimeoutSecs)>0&&this.config.isFlagEnabled(re.AFKDetection)?this.active=!0:this.active=!1,this.resetAfkWarningTimer()}stopAfkWarningTimer(){this.active=!1,this.countdownActive=!1,clearTimeout(this.warnTimer),clearInterval(this.countDownTimer)}pauseAfkWarningTimer(){this.active=!1}resetAfkWarningTimer(){this.active&&this.config.isFlagEnabled(re.AFKDetection)&&(clearTimeout(this.warnTimer),this.warnTimer=setTimeout((()=>this.activateAfkEvent()),1e3*this.config.getNumericSettingValue(oe.AFKTimeoutSecs)))}activateAfkEvent(){this.pauseAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new R$1({countDown:this.countDown,dismissAfk:this.onDismissAfk})),this.countDown=this.closeTimeout,this.countdownActive=!0,this.pixelStreaming.dispatchEvent(new L$1({countDown:this.countDown})),this.config.isFlagEnabled(re.HoveringMouseMode)||document.exitPointerLock&&document.exitPointerLock(),this.countDownTimer=setInterval((()=>{this.countDown--,0==this.countDown?(this.pixelStreaming.dispatchEvent(new A$1),this.onAFKTimedOutCallback(),i.Log(i.GetStackTrace(),"You have been disconnected due to inactivity"),this.stopAfkWarningTimer()):this.pixelStreaming.dispatchEvent(new L$1({countDown:this.countDown}))}),1e3)}}class Se{constructor(){this.isReceivingFreezeFrame=!1}getDataChannelInstance(){return this}createDataChannel(e,t,r){this.peerConnection=e,this.label=t,this.datachannelOptions=r,null==r&&(this.datachannelOptions={},this.datachannelOptions.ordered=!0),this.dataChannel=this.peerConnection.createDataChannel(this.label,this.datachannelOptions),this.setupDataChannel()}setupDataChannel(){this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=e=>this.handleOnOpen(e),this.dataChannel.onclose=e=>this.handleOnClose(e),this.dataChannel.onmessage=e=>this.handleOnMessage(e),this.dataChannel.onerror=e=>this.handleOnError(e)}handleOnOpen(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) opened.`,7),this.onOpen(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}handleOnClose(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) closed.`,7),this.onClose(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}handleOnMessage(e){i.Log(i.GetStackTrace(),`Data Channel (${this.label}) message: ${e}`,8)}handleOnError(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) error: ${e}`,7),this.onError(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}onOpen(e,t){}onClose(e,t){}onError(e,t){}}class pe{}class ve{}class Ce{}class fe{}class Te{}class Ee{}class ye{}class be{}class Me{constructor(){this.inboundVideoStats=new ve,this.inboundAudioStats=new pe,this.candidatePair=new Te,this.DataChannelStats=new Ce,this.outBoundVideoStats=new Ee,this.sessionStats=new ye,this.streamStats=new be,this.codecs=new Map}processStats(e){this.localCandidates=new Array,this.remoteCandidates=new Array,e.forEach((e=>{switch(e.type){case"candidate-pair":this.handleCandidatePair(e);break;case"certificate":case"media-source":case"outbound-rtp":case"peer-connection":case"remote-inbound-rtp":case"transport":break;case"codec":this.handleCodec(e);break;case"data-channel":this.handleDataChannel(e);break;case"inbound-rtp":this.handleInBoundRTP(e);break;case"local-candidate":this.handleLocalCandidate(e);break;case"remote-candidate":this.handleRemoteCandidate(e);break;case"remote-outbound-rtp":this.handleRemoteOutBound(e);break;case"track":this.handleTrack(e);break;case"stream":this.handleStream(e);break;default:i.Error(i.GetStackTrace(),"unhandled Stat Type"),i.Log(i.GetStackTrace(),e)}}))}handleStream(e){this.streamStats=e}handleCandidatePair(e){this.candidatePair.bytesReceived=e.bytesReceived,this.candidatePair.bytesSent=e.bytesSent,this.candidatePair.localCandidateId=e.localCandidateId,this.candidatePair.remoteCandidateId=e.remoteCandidateId,this.candidatePair.nominated=e.nominated,this.candidatePair.readable=e.readable,this.candidatePair.selected=e.selected,this.candidatePair.writable=e.writable,this.candidatePair.state=e.state,this.candidatePair.currentRoundTripTime=e.currentRoundTripTime}handleDataChannel(e){this.DataChannelStats.bytesReceived=e.bytesReceived,this.DataChannelStats.bytesSent=e.bytesSent,this.DataChannelStats.dataChannelIdentifier=e.dataChannelIdentifier,this.DataChannelStats.id=e.id,this.DataChannelStats.label=e.label,this.DataChannelStats.messagesReceived=e.messagesReceived,this.DataChannelStats.messagesSent=e.messagesSent,this.DataChannelStats.protocol=e.protocol,this.DataChannelStats.state=e.state,this.DataChannelStats.timestamp=e.timestamp}handleLocalCandidate(e){const t=new fe;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.candidateType=e.candidateType,t.id=e.id,this.localCandidates.push(t)}handleRemoteCandidate(e){const t=new fe;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.id=e.id,t.candidateType=e.candidateType,this.remoteCandidates.push(t)}handleInBoundRTP(e){switch(e.kind){case"video":this.inboundVideoStats=e,null!=this.lastVideoStats&&(this.inboundVideoStats.bitrate=8*(this.inboundVideoStats.bytesReceived-this.lastVideoStats.bytesReceived)/(this.inboundVideoStats.timestamp-this.lastVideoStats.timestamp),this.inboundVideoStats.bitrate=Math.floor(this.inboundVideoStats.bitrate)),this.lastVideoStats=Object.assign({},this.inboundVideoStats);break;case"audio":this.inboundAudioStats=e,null!=this.lastAudioStats&&(this.inboundAudioStats.bitrate=8*(this.inboundAudioStats.bytesReceived-this.lastAudioStats.bytesReceived)/(this.inboundAudioStats.timestamp-this.lastAudioStats.timestamp),this.inboundAudioStats.bitrate=Math.floor(this.inboundAudioStats.bitrate)),this.lastAudioStats=Object.assign({},this.inboundAudioStats);break;default:i.Log(i.GetStackTrace(),"Kind is not handled")}}handleRemoteOutBound(e){"video"===e.kind&&(this.outBoundVideoStats.bytesSent=e.bytesSent,this.outBoundVideoStats.id=e.id,this.outBoundVideoStats.localId=e.localId,this.outBoundVideoStats.packetsSent=e.packetsSent,this.outBoundVideoStats.remoteTimestamp=e.remoteTimestamp,this.outBoundVideoStats.timestamp=e.timestamp)}handleTrack(e){"track"!==e.type||"video_label"!==e.trackIdentifier&&"video"!==e.kind||(this.inboundVideoStats.framesDropped=e.framesDropped,this.inboundVideoStats.framesReceived=e.framesReceived,this.inboundVideoStats.frameHeight=e.frameHeight,this.inboundVideoStats.frameWidth=e.frameWidth)}handleCodec(e){const t=e.id,r=`${e.mimeType.replace("video/","").replace("audio/","")}${e.sdpFmtpLine?` ${e.sdpFmtpLine}`:""}`;this.codecs.set(t,r)}handleSessionStatistics(e,t,r){const n=Date.now()-e;this.sessionStats.runTime=new Date(n).toISOString().substr(11,8).toString();const i=null===t?"Not sent yet":t?"true":"false";this.sessionStats.controlsStreamInput=i,this.sessionStats.videoEncoderAvgQP=r}isNumber(e){return"number"==typeof e&&isFinite(e)}}const we=(Pe={parseRtpParameters:()=>sdp.exports.parseRtpParameters,splitSections:()=>sdp.exports.splitSections},ke={},n$1.d(ke,Pe),ke);var Pe,ke,Re,Le,xe=function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))};class Ae{constructor(e,t,r){this.config=t,this.createPeerConnection(e,r)}createPeerConnection(e,t){this.config.isFlagEnabled(re.ForceTURN)&&(e.iceTransportPolicy="relay",i.Log(i.GetStackTrace(),"Forcing TURN usage by setting ICE Transport Policy in peer connection config.")),this.peerConnection=new RTCPeerConnection(e),this.peerConnection.onsignalingstatechange=e=>this.handleSignalStateChange(e),this.peerConnection.oniceconnectionstatechange=e=>this.handleIceConnectionStateChange(e),this.peerConnection.onicegatheringstatechange=e=>this.handleIceGatheringStateChange(e),this.peerConnection.ontrack=e=>this.handleOnTrack(e),this.peerConnection.onicecandidate=e=>this.handleIceCandidate(e),this.peerConnection.ondatachannel=e=>this.handleDataChannel(e),this.aggregatedStats=new Me,this.preferredCodec=t,this.updateCodecSelection=!0}createOffer(e,t){return xe(this,void 0,void 0,(function*(){i.Log(i.GetStackTrace(),"Create Offer",6);const r="localhost"===location.hostname||"127.0.0.1"===location.hostname,n="https:"===location.protocol;let s=t.isFlagEnabled(re.UseMic);!s||r||n||(s=!1,i.Error(i.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),i.Error(i.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(s).finally((()=>{var t;null===(t=this.peerConnection)||void 0===t||t.createOffer(e).then((e=>{var t;this.showTextOverlayConnecting(),e.sdp=this.mungeSDP(e.sdp,s),null===(t=this.peerConnection)||void 0===t||t.setLocalDescription(e),this.onSendWebRTCOffer(e)})).catch((()=>{this.showTextOverlaySetupFailure()}))}))}))}receiveOffer(e,t){var r;return xe(this,void 0,void 0,(function*(){i.Log(i.GetStackTrace(),"Receive Offer",6),null===(r=this.peerConnection)||void 0===r||r.setRemoteDescription(e).then((()=>{const e="localhost"===location.hostname||"127.0.0.1"===location.hostname,r="https:"===location.protocol;let n=t.isFlagEnabled(re.UseMic);!n||e||r||(n=!1,i.Error(i.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),i.Error(i.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(n).finally((()=>{var e;null===(e=this.peerConnection)||void 0===e||e.createAnswer().then((e=>{var t;return e.sdp=this.mungeSDP(e.sdp,n),null===(t=this.peerConnection)||void 0===t?void 0:t.setLocalDescription(e)})).then((()=>{var e;this.onSendWebRTCAnswer(null===(e=this.peerConnection)||void 0===e?void 0:e.currentLocalDescription)})).catch((()=>{i.Error(i.GetStackTrace(),"createAnswer() failed")}))}))})),this.config.setOptionSettingOptions(ce.PreferredCodec,this.parseAvailableCodecs(e).filter((e=>this.config.getSettingOption(ce.PreferredCodec).options.includes(e))))}))}receiveAnswer(e){var t;null===(t=this.peerConnection)||void 0===t||t.setRemoteDescription(e),this.config.setOptionSettingOptions(ce.PreferredCodec,this.parseAvailableCodecs(e).filter((e=>this.config.getSettingOption(ce.PreferredCodec).options.includes(e))))}generateStats(){var e;null===(e=this.peerConnection)||void 0===e||e.getStats(null).then((e=>{this.aggregatedStats.processStats(e),this.onVideoStats(this.aggregatedStats),this.updateCodecSelection&&this.config.setOptionSettingValue(ce.PreferredCodec,this.aggregatedStats.codecs.get(this.aggregatedStats.inboundVideoStats.codecId))}))}close(){this.peerConnection&&(this.peerConnection.close(),this.peerConnection=null)}mungeSDP(e,t){const r=e;r.replace(/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm,"$1;x-google-start-bitrate=10000;x-google-max-bitrate=100000\r\n");let n="";return n+="maxaveragebitrate=510000;",t&&(n+="sprop-maxcapturerate=48000;"),n+=this.config.isFlagEnabled(re.ForceMonoAudio)?"stereo=0;":"stereo=1;",n+="useinbandfec=1",r.replace("useinbandfec=1",n),r}handleOnIce(e){var t;i.Log(i.GetStackTrace(),"peerconnection handleOnIce",6),this.config.isFlagEnabled(re.ForceTURN)&&e.candidate.indexOf("relay")<0?i.Info(i.GetStackTrace(),`Dropping candidate because it was not TURN relay. | Type= ${e.type} | Protocol= ${e.protocol} | Address=${e.address} | Port=${e.port} |`,6):null===(t=this.peerConnection)||void 0===t||t.addIceCandidate(e)}handleSignalStateChange(e){i.Log(i.GetStackTrace(),"signaling state change: "+e,6)}handleIceConnectionStateChange(e){i.Log(i.GetStackTrace(),"ice connection state change: "+e,6),this.onIceConnectionStateChange(e)}handleIceGatheringStateChange(e){i.Log(i.GetStackTrace(),"ice gathering state change: "+JSON.stringify(e),6)}handleOnTrack(e){this.onTrack(e)}handleIceCandidate(e){this.onPeerIceCandidate(e)}handleDataChannel(e){this.onDataChannel(e)}onTrack(e){}onIceConnectionStateChange(e){}onPeerIceCandidate(e){}onDataChannel(e){}setupTransceiversAsync(e){var t,r,n,i,s,a,o,l,c;return xe(this,void 0,void 0,(function*(){const h=(null===(t=this.peerConnection)||void 0===t?void 0:t.getTransceivers().length)>0;if(null===(r=this.peerConnection)||void 0===r||r.addTransceiver("video",{direction:"recvonly"}),RTCRtpReceiver.getCapabilities&&""!=this.preferredCodec)for(const e of null!==(i=null===(n=this.peerConnection)||void 0===n?void 0:n.getTransceivers())&&void 0!==i?i:[])if(e&&e.receiver&&e.receiver.track&&"video"===e.receiver.track.kind){const t=this.preferredCodec.split(" "),r=[{mimeType:"video/"+t[0],clockRate:9e4,sdpFmtpLine:t[1]?t[1]:""}];this.config.getSettingOption(ce.PreferredCodec).options.filter((e=>e!=this.preferredCodec)).forEach((e=>{const t=e.split(" ");r.push({mimeType:"video/"+t[0],clockRate:9e4,sdpFmtpLine:t[1]?t[1]:""})}));for(const e of r)""===e.sdpFmtpLine&&delete e.sdpFmtpLine;e.setCodecPreferences(r)}if(e){const t={video:!1,audio:!!e&&{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,sampleSize:16,volume:1}},r=yield navigator.mediaDevices.getUserMedia(t);if(r)if(h){for(const e of null!==(o=null===(a=this.peerConnection)||void 0===a?void 0:a.getTransceivers())&&void 0!==o?o:[])if(e&&e.receiver&&e.receiver.track&&"audio"===e.receiver.track.kind)for(const t of r.getTracks())t.kind&&"audio"==t.kind&&(e.sender.replaceTrack(t),e.direction="sendrecv")}else for(const e of r.getTracks())e.kind&&"audio"==e.kind&&(null===(l=this.peerConnection)||void 0===l||l.addTransceiver(e,{direction:"sendrecv"}));else null===(c=this.peerConnection)||void 0===c||c.addTransceiver("audio",{direction:"recvonly"})}else null===(s=this.peerConnection)||void 0===s||s.addTransceiver("audio",{direction:"recvonly"})}))}onVideoStats(e){}onSendWebRTCOffer(e){}onSendWebRTCAnswer(e){}showTextOverlayConnecting(){}showTextOverlaySetupFailure(){}parseAvailableCodecs(e){if(!RTCRtpReceiver.getCapabilities)return["Only available on Chrome"];const t=[],r=(0,we.splitSections)(e.sdp);return r.shift(),r.forEach((e=>{const{codecs:r}=(0,we.parseRtpParameters)(e),n=/(VP\d|H26\d|AV1).*/;r.forEach((e=>{const r=e.name+" "+Object.keys(e.parameters||{}).map((t=>t+"="+e.parameters[t])).join(";");if(null!==n.exec(r)){"VP9"==e.name&&(e.parameters={"profile-id":"0"});const r=e.name+" "+Object.keys(e.parameters||{}).map((t=>t+"="+e.parameters[t])).join(";");t.push(r)}}))})),t}}class Fe{constructor(){this.PixelStreamingSettings=new De,this.EncoderSettings=new Oe,this.WebRTCSettings=new Ue}ueCompatible(){null!=this.WebRTCSettings.MaxFPS&&(this.WebRTCSettings.FPS=this.WebRTCSettings.MaxFPS)}}class De{}class Oe{}class Ue{}class Ie{constructor(){this.ReceiptTimeMs=null,this.TransmissionTimeMs=null,this.PreCaptureTimeMs=null,this.PostCaptureTimeMs=null,this.PreEncodeTimeMs=null,this.PostEncodeTimeMs=null,this.EncodeMs=null,this.CaptureToSendMs=null,this.testStartTimeMs=0,this.browserReceiptTimeMs=0,this.latencyExcludingDecode=0,this.testDuration=0,this.networkLatency=0,this.browserSendLatency=0,this.frameDisplayDeltaTimeMs=0,this.endToEndLatency=0,this.encodeLatency=0}setFrameDisplayDeltaTime(e){0==this.frameDisplayDeltaTimeMs&&(this.frameDisplayDeltaTimeMs=Math.round(e))}processFields(){null!=this.EncodeMs||null==this.PreEncodeTimeMs&&null==this.PostEncodeTimeMs||(i.Log(i.GetStackTrace(),`Setting Encode Ms \n ${this.PostEncodeTimeMs} \n ${this.PreEncodeTimeMs}`,6),this.EncodeMs=this.PostEncodeTimeMs-this.PreEncodeTimeMs),null!=this.CaptureToSendMs||null==this.PreCaptureTimeMs&&null==this.PostCaptureTimeMs||(i.Log(i.GetStackTrace(),`Setting CaptureToSendMs Ms \n ${this.PostCaptureTimeMs} \n ${this.PreCaptureTimeMs}`,6),this.CaptureToSendMs=this.PostCaptureTimeMs-this.PreCaptureTimeMs)}}class Ge{static setExtensionFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),i.Log(i.GetStackTrace(),"Received first chunk of file",6));const r=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),r,6),t.extension=r}static setMimeTypeFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),i.Log(i.GetStackTrace(),"Received first chunk of file",6));const r=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),r,6),t.mimetype=r}static setContentsFromBytes(e,t){if(!t.receiving)return;t.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);const r=e.slice(5);if(t.data.push(r),i.Log(i.GetStackTrace(),`Received file chunk: ${t.data.length}/${t.size}`,6),t.data.length===t.size){t.receiving=!1,t.valid=!0,i.Log(i.GetStackTrace(),"Received complete file",6);const e=(new Date).getTime()-t.timestampStart,r=Math.round(16*t.size*1024/e);i.Log(i.GetStackTrace(),`Average transfer bitrate: ${r}kb/s over ${e/1e3} seconds`,6);const n=new Blob(t.data,{type:t.mimetype}),s=document.createElement("a");s.setAttribute("href",URL.createObjectURL(n)),s.setAttribute("download",`transfer.${t.extension}`),document.body.append(s),s.remove()}else t.data.length>t.size&&(t.receiving=!1,i.Error(i.GetStackTrace(),`Received bigger file than advertised: ${t.data.length}/${t.size}`))}}class ze{constructor(){this.mimetype="",this.extension="",this.receiving=!1,this.size=0,this.data=[],this.valid=!1}}class Be{}Be.mainButton=0,Be.auxiliaryButton=1,Be.secondaryButton=2,Be.fourthButton=3,Be.fifthButton=4;class _e{}_e.primaryButton=1,_e.secondaryButton=2,_e.auxiliaryButton=4,_e.fourthButton=8,_e.fifthButton=16;class We{constructor(){this.unregisterCallbacks=[]}addUnregisterCallback(e){this.unregisterCallbacks.push(e)}unregisterAll(){for(const e of this.unregisterCallbacks)e();this.unregisterCallbacks=[]}}class He{constructor(e,t,r){this.touchEventListenerTracker=new We,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=r;const n=e=>this.onTouchStart(e),i=e=>this.onTouchEnd(e),s=e=>this.onTouchMove(e);document.addEventListener("touchstart",n,{passive:!1}),document.addEventListener("touchend",i,{passive:!1}),document.addEventListener("touchmove",s,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchstart",n))),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchend",i))),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchmove",s)))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}setVideoElementParentClientRect(e){this.videoElementParentClientRect=e}onTouchStart(e){if(this.videoElementProvider.isVideoReady()){if(null==this.fakeTouchFinger){const t=e.changedTouches[0];this.fakeTouchFinger=new Ve(t.identifier,t.clientX-this.videoElementParentClientRect.left,t.clientY-this.videoElementParentClientRect.top);const r=this.videoElementProvider.getVideoParentElement(),n=new MouseEvent("mouseenter",t);r.dispatchEvent(n);const i=this.coordinateConverter.normalizeAndQuantizeUnsigned(this.fakeTouchFinger.x,this.fakeTouchFinger.y);this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([Be.mainButton,i.x,i.y])}e.preventDefault()}}onTouchEnd(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.videoElementProvider.getVideoParentElement(),r=this.toStreamerMessagesProvider.toStreamerHandlers;for(let n=0;n<e.changedTouches.length;n++){const i=e.changedTouches[n];if(i.identifier===this.fakeTouchFinger.id){const e=i.clientX-this.videoElementParentClientRect.left,n=i.clientY-this.videoElementParentClientRect.top,s=this.coordinateConverter.normalizeAndQuantizeUnsigned(e,n);r.get("MouseUp")([Be.mainButton,s.x,s.y]);const a=new MouseEvent("mouseleave",i);t.dispatchEvent(a),this.fakeTouchFinger=null;break}}e.preventDefault()}onTouchMove(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.toStreamerMessagesProvider.toStreamerHandlers;for(let r=0;r<e.touches.length;r++){const n=e.touches[r];if(n.identifier===this.fakeTouchFinger.id){const e=n.clientX-this.videoElementParentClientRect.left,r=n.clientY-this.videoElementParentClientRect.top,i=this.coordinateConverter.normalizeAndQuantizeUnsigned(e,r),s=this.coordinateConverter.normalizeAndQuantizeSigned(e-this.fakeTouchFinger.x,r-this.fakeTouchFinger.y);t.get("MouseMove")([i.x,i.y,s.x,s.y]),this.fakeTouchFinger.x=e,this.fakeTouchFinger.y=r;break}}e.preventDefault()}}class Ve{constructor(e,t,r){this.id=e,this.x=t,this.y=r}}class Ne{}Ne.backSpace=8,Ne.shift=16,Ne.control=17,Ne.alt=18,Ne.rightShift=253,Ne.rightControl=254,Ne.rightAlt=255;class Ke{constructor(e,t,r){this.keyboardEventListenerTracker=new We,this.CodeToKeyCode={Escape:27,Digit0:48,Digit1:49,Digit2:50,Digit3:51,Digit4:52,Digit5:53,Digit6:54,Digit7:55,Digit8:56,Digit9:57,Minus:173,Equal:187,Backspace:8,Tab:9,KeyQ:81,KeyW:87,KeyE:69,KeyR:82,KeyT:84,KeyY:89,KeyU:85,KeyI:73,KeyO:79,KeyP:80,BracketLeft:219,BracketRight:221,Enter:13,ControlLeft:17,KeyA:65,KeyS:83,KeyD:68,KeyF:70,KeyG:71,KeyH:72,KeyJ:74,KeyK:75,KeyL:76,Semicolon:186,Quote:222,Backquote:192,ShiftLeft:16,Backslash:220,KeyZ:90,KeyX:88,KeyC:67,KeyV:86,KeyB:66,KeyN:78,KeyM:77,Comma:188,Period:190,Slash:191,ShiftRight:253,AltLeft:18,Space:32,CapsLock:20,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,Pause:19,ScrollLock:145,NumpadDivide:111,NumpadMultiply:106,NumpadSubtract:109,NumpadAdd:107,NumpadDecimal:110,Numpad9:105,Numpad8:104,Numpad7:103,Numpad6:102,Numpad5:101,Numpad4:100,Numpad3:99,Numpad2:98,Numpad1:97,Numpad0:96,NumLock:144,ControlRight:254,AltRight:255,Home:36,End:35,ArrowUp:38,ArrowLeft:37,ArrowRight:39,ArrowDown:40,PageUp:33,PageDown:34,Insert:45,Delete:46,ContextMenu:93},this.toStreamerMessagesProvider=e,this.config=t,this.activeKeysProvider=r}registerKeyBoardEvents(){const e=e=>this.handleOnKeyDown(e),t=e=>this.handleOnKeyUp(e),r=e=>this.handleOnKeyPress(e);document.addEventListener("keydown",e),document.addEventListener("keyup",t),document.addEventListener("keypress",r),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keydown",e))),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keyup",t))),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keypress",r)))}unregisterKeyBoardEvents(){this.keyboardEventListenerTracker.unregisterAll()}handleOnKeyDown(e){const t=this.getKeycode(e);t&&(i.Log(i.GetStackTrace(),`key down ${t}, repeat = ${e.repeat}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyDown")([this.getKeycode(e),e.repeat?1:0]),this.activeKeysProvider.getActiveKeys().push(t),t===Ne.backSpace&&document.dispatchEvent(new KeyboardEvent("keypress",{charCode:Ne.backSpace})),this.config.isFlagEnabled(re.SuppressBrowserKeys)&&this.isKeyCodeBrowserKey(t)&&e.preventDefault())}handleOnKeyUp(e){const t=this.getKeycode(e);t&&(i.Log(i.GetStackTrace(),`key up ${t}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyUp")([t,e.repeat?1:0]),this.config.isFlagEnabled(re.SuppressBrowserKeys)&&this.isKeyCodeBrowserKey(t)&&e.preventDefault())}handleOnKeyPress(e){if(!("charCode"in e))return void i.Warning(i.GetStackTrace(),"KeyboardEvent.charCode is deprecated in this browser, cannot send key press.");const t=e.charCode;i.Log(i.GetStackTrace(),`key press ${t}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyPress")([t])}getKeycode(e){if(!("keyCode"in e)){const t=e;return t.code in this.CodeToKeyCode?this.CodeToKeyCode[t.code]:(i.Warning(i.GetStackTrace(),`Keyboard code of ${t.code} is not supported in our mapping, ignoring this key.`),null)}return e.keyCode===Ne.shift&&"ShiftRight"===e.code?Ne.rightShift:e.keyCode===Ne.control&&"ControlRight"===e.code?Ne.rightControl:e.keyCode===Ne.alt&&"AltRight"===e.code?Ne.rightAlt:e.keyCode}isKeyCodeBrowserKey(e){return e>=112&&e<=123||9===e}}class Qe{constructor(e,t,r){this.x=0,this.y=0,this.updateMouseMovePositionEvent=e=>{this.updateMouseMovePosition(e)},this.mouseEventListenerTracker=new We,this.videoElementProvider=e,this.mouseController=t,this.activeKeysProvider=r;const n=this.videoElementProvider.getVideoParentElement();this.x=n.getBoundingClientRect().width/2,this.y=n.getBoundingClientRect().height/2,this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y)}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}lockStateChange(){const e=this.videoElementProvider.getVideoParentElement(),t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;if(document.pointerLockElement===e||document.mozPointerLockElement===e)i.Log(i.GetStackTrace(),"Pointer locked",6),document.addEventListener("mousemove",this.updateMouseMovePositionEvent,!1),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1)));else{i.Log(i.GetStackTrace(),"The pointer lock status is now unlocked",6),document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1);let e=this.activeKeysProvider.getActiveKeys();const r=[];new Set(e).forEach((e=>{})),r.forEach((e=>{t.get("KeyUp")([e])})),e=[]}}updateMouseMovePosition(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers,r=this.videoElementProvider.getVideoParentElement().clientWidth,n=this.videoElementProvider.getVideoParentElement().clientHeight;this.x+=e.movementX,this.y+=e.movementY,this.x>r&&(this.x-=r),this.y>n&&(this.y-=n),this.x<0&&(this.x=r+this.x),this.y<0&&(this.y=n-this.y),this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y);const i=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY);t.get("MouseMove")([this.coord.x,this.coord.y,i.x,i.y])}handleMouseDown(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,this.coord.x,this.coord.y])}handleMouseUp(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,this.coord.x,this.coord.y])}handleMouseWheel(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,this.coord.x,this.coord.y])}handleMouseDouble(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,this.coord.x,this.coord.y])}handlePressMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.pressMouseButtons(e.buttons,this.x,this.y)}handleReleaseMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.releaseMouseButtons(e.buttons,this.x,this.y)}}class $e{constructor(e){this.mouseController=e}unregisterMouseEvents(){}updateMouseMovePosition(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),"MouseMove",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),r=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseMove")([t.x,t.y,r.x,r.y]),e.preventDefault()}handleMouseDown(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),"onMouse Down",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,t.x,t.y]),e.preventDefault()}handleMouseUp(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,t.x,t.y]),e.preventDefault()}handleContextMenu(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,t.x,t.y]),e.preventDefault()}handleMouseWheel(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,t.x,t.y]),e.preventDefault()}handleMouseDouble(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,t.x,t.y])}handlePressMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&this.mouseController.pressMouseButtons(e.buttons,e.offsetX,e.offsetY)}handleReleaseMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&this.mouseController.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY)}}class qe{constructor(e,t,r,n){this.mouseEventListenerTracker=new We,this.toStreamerMessagesProvider=e,this.coordinateConverter=r,this.videoElementProvider=t,this.activeKeysProvider=n,this.registerMouseEnterAndLeaveEvents()}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}registerLockedMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),r=new Qe(this.videoElementProvider,e,this.activeKeysProvider);if(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,t.requestPointerLock){const e=()=>{t.requestPointerLock()};t.addEventListener("click",e),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("click",e)))}const n=()=>r.lockStateChange();document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("pointerlockchange",n,!1))),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("mozpointerlockchange",n,!1)));const i=e=>r.handleMouseDown(e),s=e=>r.handleMouseUp(e),a=e=>r.handleMouseWheel(e),o=e=>r.handleMouseDouble(e);t.addEventListener("mousedown",i),t.addEventListener("mouseup",s),t.addEventListener("wheel",a),t.addEventListener("dblclick",o),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousedown",i))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mouseup",s))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("wheel",a))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("dblclick",o))),this.mouseEventListenerTracker.addUnregisterCallback((()=>r.unregisterMouseEvents())),this.mouseEventListenerTracker.addUnregisterCallback((()=>{!document.exitPointerLock||document.pointerLockElement!==t&&document.mozPointerLockElement!==t||document.exitPointerLock()}))}registerHoveringMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),r=new $e(e),n=e=>r.updateMouseMovePosition(e),i=e=>r.handleMouseDown(e),s=e=>r.handleMouseUp(e),a=e=>r.handleContextMenu(e),o=e=>r.handleMouseWheel(e),l=e=>r.handleMouseDouble(e);t.addEventListener("mousemove",n),t.addEventListener("mousedown",i),t.addEventListener("mouseup",s),t.addEventListener("contextmenu",a),t.addEventListener("wheel",o),t.addEventListener("dblclick",l),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousemove",n))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousedown",i))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mouseup",s))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("contextmenu",a))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("wheel",o))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("dblclick",l))),this.mouseEventListenerTracker.addUnregisterCallback((()=>r.unregisterMouseEvents()))}registerMouseEnterAndLeaveEvents(){const e=this.videoElementProvider.getVideoParentElement(),t=e=>{this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"Mouse Entered",6),this.sendMouseEnter(),this.pressMouseButtons(e.buttons,e.x,e.y))},r=e=>{this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"Mouse Left",6),this.sendMouseLeave(),this.releaseMouseButtons(e.buttons,e.x,e.y))};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",r),this.mouseEventListenerTracker.addUnregisterCallback((()=>e.removeEventListener("mouseenter",t))),this.mouseEventListenerTracker.addUnregisterCallback((()=>e.removeEventListener("mouseleave",r)))}releaseMouseButtons(e,t,r){const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,r);e&_e.primaryButton&&this.sendMouseUp(Be.mainButton,n.x,n.y),e&_e.secondaryButton&&this.sendMouseUp(Be.secondaryButton,n.x,n.y),e&_e.auxiliaryButton&&this.sendMouseUp(Be.auxiliaryButton,n.x,n.y),e&_e.fourthButton&&this.sendMouseUp(Be.fourthButton,n.x,n.y),e&_e.fifthButton&&this.sendMouseUp(Be.fifthButton,n.x,n.y)}pressMouseButtons(e,t,r){if(!this.videoElementProvider.isVideoReady())return;const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,r);e&_e.primaryButton&&this.sendMouseDown(Be.mainButton,n.x,n.y),e&_e.secondaryButton&&this.sendMouseDown(Be.secondaryButton,n.x,n.y),e&_e.auxiliaryButton&&this.sendMouseDown(Be.auxiliaryButton,n.x,n.y),e&_e.fourthButton&&this.sendMouseDown(Be.fourthButton,n.x,n.y),e&_e.fifthButton&&this.sendMouseDown(Be.fifthButton,n.x,n.y)}sendMouseEnter(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseEnter")()}sendMouseLeave(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseLeave")()}sendMouseDown(e,t,r){this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),`mouse button ${e} down at (${t}, ${r})`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e,t,r]))}sendMouseUp(e,t,r){if(!this.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),`mouse button ${e} up at (${t}, ${r})`,6);const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,r);this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e,n.x,n.y])}}class Xe{constructor(e,t,r){this.fingers=[9,8,7,6,5,4,3,2,1,0],this.fingerIds=new Map,this.maxByteValue=255,this.touchEventListenerTracker=new We,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=r,this.videoElementParent=t.getVideoElement();const n=e=>this.onTouchStart(e),s=e=>this.onTouchEnd(e),a=e=>this.onTouchMove(e);this.videoElementParent.addEventListener("touchstart",n,{passive:!1}),this.videoElementParent.addEventListener("touchend",s,{passive:!1}),this.videoElementParent.addEventListener("touchmove",a,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchstart",n))),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchend",s))),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchmove",a))),i.Log(i.GetStackTrace(),"Touch Events Registered",6);const o=e=>{e.preventDefault()};document.addEventListener("touchmove",o,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchmove",o)))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}rememberTouch(e){const t=this.fingers.pop();void 0===t&&i.Log(i.GetStackTrace(),"exhausted touch identifiers",6),this.fingerIds.set(e.identifier,t)}forgetTouch(e){this.fingers.push(this.fingerIds.get(e.identifier)),this.fingers.sort((function(e,t){return t-e})),this.fingerIds.delete(e.identifier)}onTouchStart(e){if(this.videoElementProvider.isVideoReady()){for(let t=0;t<e.changedTouches.length;t++)this.rememberTouch(e.changedTouches[t]);i.Log(i.GetStackTrace(),"touch start",6),this.emitTouchData("TouchStart",e.changedTouches),e.preventDefault()}}onTouchEnd(e){if(this.videoElementProvider.isVideoReady()){i.Log(i.GetStackTrace(),"touch end",6),this.emitTouchData("TouchEnd",e.changedTouches);for(let t=0;t<e.changedTouches.length;t++)this.forgetTouch(e.changedTouches[t]);e.preventDefault()}}onTouchMove(e){this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"touch move",6),this.emitTouchData("TouchMove",e.touches),e.preventDefault())}emitTouchData(e,t){if(!this.videoElementProvider.isVideoReady())return;const r=this.videoElementProvider.getVideoParentElement(),n=this.toStreamerMessagesProvider.toStreamerHandlers;for(let s=0;s<t.length;s++){const a=1,o=t[s],l=o.clientX-r.offsetLeft,c=o.clientY-r.offsetTop;i.Log(i.GetStackTrace(),`F${this.fingerIds.get(o.identifier)}=(${l}, ${c})`,6);const h=this.coordinateConverter.normalizeAndQuantizeUnsigned(l,c);switch(e){case"TouchStart":n.get("TouchStart")([a,h.x,h.y,this.fingerIds.get(o.identifier),this.maxByteValue*o.force,h.inRange?1:0]);break;case"TouchEnd":n.get("TouchEnd")([a,h.x,h.y,this.fingerIds.get(o.identifier),this.maxByteValue*o.force,h.inRange?1:0]);break;case"TouchMove":n.get("TouchMove")([a,h.x,h.y,this.fingerIds.get(o.identifier),this.maxByteValue*o.force,h.inRange?1:0])}}}}class je{constructor(e){this.gamePadEventListenerTracker=new We,this.toStreamerMessagesProvider=e,this.requestAnimationFrame=(window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame).bind(window);const t=window;if("GamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("gamepadconnected",e))),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("gamepaddisconnected",t)))}else if("WebKitGamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("webkitgamepadconnected",e),window.addEventListener("webkitgamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("webkitgamepadconnected",e))),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("webkitgamepaddisconnected",t)))}if(this.controllers=[],navigator.getGamepads)for(const e of navigator.getGamepads())e&&this.gamePadConnectHandler(new GamepadEvent("gamepadconnected",{gamepad:e}))}unregisterGamePadEvents(){this.gamePadEventListenerTracker.unregisterAll();for(const e of this.controllers)void 0!==e.id&&this.onGamepadDisconnected(e.id);this.controllers=[],this.onGamepadConnected=()=>{},this.onGamepadDisconnected=()=>{}}gamePadConnectHandler(e){i.Log(i.GetStackTrace(),"Gamepad connect handler",6);const t=e.gamepad,r={currentState:t,prevState:t,id:void 0};this.controllers.push(r),this.controllers[t.index].currentState=t,this.controllers[t.index].prevState=t,i.Log(i.GetStackTrace(),"gamepad: "+t.id+" connected",6),window.requestAnimationFrame((()=>this.updateStatus())),this.onGamepadConnected()}gamePadDisconnectHandler(e){i.Log(i.GetStackTrace(),"Gamepad disconnect handler",6),i.Log(i.GetStackTrace(),"gamepad: "+e.gamepad.id+" disconnected",6);const t=this.controllers[e.gamepad.index];delete this.controllers[e.gamepad.index],this.controllers=this.controllers.filter((e=>void 0!==e)),this.onGamepadDisconnected(t.id)}scanGamePads(){const e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[];for(let t=0;t<e.length;t++)e[t]&&e[t].index in this.controllers&&(this.controllers[e[t].index].currentState=e[t])}updateStatus(){this.scanGamePads();const e=this.toStreamerMessagesProvider.toStreamerHandlers;for(const t of this.controllers){const r=void 0===t.id?this.controllers.indexOf(t):t.id,n=t.currentState;for(let n=0;n<t.currentState.buttons.length;n++){const i=t.currentState.buttons[n],s=t.prevState.buttons[n];i.pressed?n==Re.LeftTrigger?e.get("GamepadAnalog")([r,5,i.value]):n==Re.RightTrigger?e.get("GamepadAnalog")([r,6,i.value]):e.get("GamepadButtonPressed")([r,n,s.pressed?1:0]):!i.pressed&&s.pressed&&(n==Re.LeftTrigger?e.get("GamepadAnalog")([r,5,0]):n==Re.RightTrigger?e.get("GamepadAnalog")([r,6,0]):e.get("GamepadButtonReleased")([r,n]))}for(let t=0;t<n.axes.length;t+=2){const i=parseFloat(n.axes[t].toFixed(4)),s=-parseFloat(n.axes[t+1].toFixed(4));e.get("GamepadAnalog")([r,t+1,i]),e.get("GamepadAnalog")([r,t+2,s])}this.controllers[r].prevState=n}this.controllers.length>0&&this.requestAnimationFrame((()=>this.updateStatus()))}onGamepadResponseReceived(e){for(const t of this.controllers)if(void 0===t.id){t.id=e;break}}onGamepadConnected(){}onGamepadDisconnected(e){}}!function(e){e[e.RightClusterBottomButton=0]="RightClusterBottomButton",e[e.RightClusterRightButton=1]="RightClusterRightButton",e[e.RightClusterLeftButton=2]="RightClusterLeftButton",e[e.RightClusterTopButton=3]="RightClusterTopButton",e[e.LeftShoulder=4]="LeftShoulder",e[e.RightShoulder=5]="RightShoulder",e[e.LeftTrigger=6]="LeftTrigger",e[e.RightTrigger=7]="RightTrigger",e[e.SelectOrBack=8]="SelectOrBack",e[e.StartOrForward=9]="StartOrForward",e[e.LeftAnalogPress=10]="LeftAnalogPress",e[e.RightAnalogPress=11]="RightAnalogPress",e[e.LeftClusterTopButton=12]="LeftClusterTopButton",e[e.LeftClusterBottomButton=13]="LeftClusterBottomButton",e[e.LeftClusterLeftButton=14]="LeftClusterLeftButton",e[e.LeftClusterRightButton=15]="LeftClusterRightButton",e[e.CentreButton=16]="CentreButton",e[e.LeftStickHorizontal=0]="LeftStickHorizontal",e[e.LeftStickVertical=1]="LeftStickVertical",e[e.RightStickHorizontal=2]="RightStickHorizontal",e[e.RightStickVertical=3]="RightStickVertical"}(Re||(Re={}));class Ye{constructor(e,t,r){this.activeKeys=new Je,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=r}registerKeyBoard(e){i.Log(i.GetStackTrace(),"Register Keyboard Events",7);const t=new Ke(this.toStreamerMessagesProvider,e,this.activeKeys);return t.registerKeyBoardEvents(),t}registerMouse(e){i.Log(i.GetStackTrace(),"Register Mouse Events",7);const t=new qe(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter,this.activeKeys);switch(e){case ue.LockedMouse:t.registerLockedMouseEvents(t);break;case ue.HoveringMouse:t.registerHoveringMouseEvents(t);break;default:i.Info(i.GetStackTrace(),"unknown Control Scheme Type Defaulting to Locked Mouse Events"),t.registerLockedMouseEvents(t)}return t}registerTouch(e,t){if(i.Log(i.GetStackTrace(),"Registering Touch",6),e){const e=new He(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter);return e.setVideoElementParentClientRect(t),e}return new Xe(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter)}registerGamePad(){return i.Log(i.GetStackTrace(),"Register Game Pad",7),new je(this.toStreamerMessagesProvider)}}class Je{constructor(){this.activeKeys=[],this.activeKeys=[]}getActiveKeys(){return this.activeKeys}}class Ze{constructor(e,t){this.lastTimeResized=(new Date).getTime(),this.videoElement=document.createElement("video"),this.config=t,this.videoElement.id="streamingVideo",this.videoElement.disablePictureInPicture=!0,this.videoElement.playsInline=!0,this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.videoElement.style.pointerEvents="all",e.appendChild(this.videoElement),this.onResizePlayerCallback=()=>{console.log("Resolution changed, restyling player, did you forget to override this function?")},this.onMatchViewportResolutionCallback=()=>{console.log("Resolution changed and match viewport resolution is turned on, did you forget to override this function?")},this.videoElement.onclick=()=>{this.videoElement.paused&&this.videoElement.play()},this.videoElement.onloadedmetadata=()=>{this.onVideoInitialized()},window.addEventListener("resize",(()=>this.resizePlayerStyle()),!0),window.addEventListener("orientationchange",(()=>this.onOrientationChange()))}play(){return this.videoElement.muted=this.config.isFlagEnabled(re.StartVideoMuted),this.videoElement.autoplay=this.config.isFlagEnabled(re.AutoPlayVideo),this.videoElement.play()}isPaused(){return this.videoElement.paused}isVideoReady(){return void 0!==this.videoElement.readyState&&this.videoElement.readyState>0}hasVideoSource(){return void 0!==this.videoElement.srcObject&&null!==this.videoElement.srcObject}getVideoElement(){return this.videoElement}getVideoParentElement(){return this.videoElement.parentElement}setVideoEnabled(e){this.videoElement.srcObject.getTracks().forEach((t=>t.enabled=e))}onVideoInitialized(){}onOrientationChange(){clearTimeout(this.orientationChangeTimeout),this.orientationChangeTimeout=window.setTimeout((()=>{this.resizePlayerStyle()}),500)}resizePlayerStyle(){const e=this.getVideoParentElement();e&&(this.updateVideoStreamSize(),e.classList.contains("fixed-size")||this.resizePlayerStyleToFillParentElement(),this.onResizePlayerCallback())}resizePlayerStyleToFillParentElement(){this.getVideoParentElement().setAttribute("style","top: 0px; left: 0px; width: 100%; height: 100%; cursor: default;")}updateVideoStreamSize(){if(this.config.isFlagEnabled(re.MatchViewportResolution))if((new Date).getTime()-this.lastTimeResized>1e3){const e=this.getVideoParentElement();if(!e)return;this.onMatchViewportResolutionCallback(e.clientWidth,e.clientHeight),this.lastTimeResized=(new Date).getTime()}else i.Log(i.GetStackTrace(),"Resizing too often - skipping",6),clearTimeout(this.resizeTimeoutHandle),this.resizeTimeoutHandle=window.setTimeout((()=>this.updateVideoStreamSize),1e3)}}class et$1{constructor(){this.map=new Map,this.reverseMap=new Map}getFromKey(e){return this.map.get(e)}getFromValue(e){return this.reverseMap.get(e)}add(e,t){this.map.set(e,t),this.reverseMap.set(t,e)}remove(e,t){this.map.delete(e),this.reverseMap.delete(t)}}class tt$1{constructor(){this.toStreamerHandlers=new Map,this.fromStreamerHandlers=new Map,this.toStreamerMessages=new et$1,this.fromStreamerMessages=new et$1}populateDefaultProtocol(){this.toStreamerMessages.add("IFrameRequest",{id:0,byteLength:0,structure:[]}),this.toStreamerMessages.add("RequestQualityControl",{id:1,byteLength:0,structure:[]}),this.toStreamerMessages.add("FpsRequest",{id:2,byteLength:0,structure:[]}),this.toStreamerMessages.add("AverageBitrateRequest",{id:3,byteLength:0,structure:[]}),this.toStreamerMessages.add("StartStreaming",{id:4,byteLength:0,structure:[]}),this.toStreamerMessages.add("StopStreaming",{id:5,byteLength:0,structure:[]}),this.toStreamerMessages.add("LatencyTest",{id:6,byteLength:0,structure:[]}),this.toStreamerMessages.add("RequestInitialSettings",{id:7,byteLength:0,structure:[]}),this.toStreamerMessages.add("TestEcho",{id:8,byteLength:0,structure:[]}),this.toStreamerMessages.add("UIInteraction",{id:50,byteLength:0,structure:[]}),this.toStreamerMessages.add("Command",{id:51,byteLength:0,structure:[]}),this.toStreamerMessages.add("KeyDown",{id:60,byteLength:2,structure:["uint8","uint8"]}),this.toStreamerMessages.add("KeyUp",{id:61,byteLength:1,structure:["uint8"]}),this.toStreamerMessages.add("KeyPress",{id:62,byteLength:2,structure:["uint16"]}),this.toStreamerMessages.add("MouseEnter",{id:70,byteLength:0,structure:[]}),this.toStreamerMessages.add("MouseLeave",{id:71,byteLength:0,structure:[]}),this.toStreamerMessages.add("MouseDown",{id:72,byteLength:5,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.add("MouseUp",{id:73,byteLength:5,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.add("MouseMove",{id:74,byteLength:8,structure:["uint16","uint16","int16","int16"]}),this.toStreamerMessages.add("MouseWheel",{id:75,byteLength:6,structure:["int16","uint16","uint16"]}),this.toStreamerMessages.add("MouseDouble",{id:76,byteLength:5,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.add("TouchStart",{id:80,byteLength:8,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.add("TouchEnd",{id:81,byteLength:8,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.add("TouchMove",{id:82,byteLength:8,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.add("GamepadConnected",{id:93,byteLength:0,structure:[]}),this.toStreamerMessages.add("GamepadButtonPressed",{id:90,byteLength:3,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.add("GamepadButtonReleased",{id:91,byteLength:3,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.add("GamepadAnalog",{id:92,byteLength:10,structure:["uint8","uint8","double"]}),this.toStreamerMessages.add("GamepadDisconnected",{id:94,byteLength:1,structure:["uint8"]}),this.fromStreamerMessages.add("QualityControlOwnership",0),this.fromStreamerMessages.add("Response",1),this.fromStreamerMessages.add("Command",2),this.fromStreamerMessages.add("FreezeFrame",3),this.fromStreamerMessages.add("UnfreezeFrame",4),this.fromStreamerMessages.add("VideoEncoderAvgQP",5),this.fromStreamerMessages.add("LatencyTest",6),this.fromStreamerMessages.add("InitialSettings",7),this.fromStreamerMessages.add("FileExtension",8),this.fromStreamerMessages.add("FileMimeType",9),this.fromStreamerMessages.add("FileContents",10),this.fromStreamerMessages.add("TestEcho",11),this.fromStreamerMessages.add("InputControlOwnership",12),this.fromStreamerMessages.add("GamepadResponse",13),this.fromStreamerMessages.add("Protocol",255)}registerMessageHandler(e,t,r){switch(e){case Le.ToStreamer:this.toStreamerHandlers.set(t,r);break;case Le.FromStreamer:this.fromStreamerHandlers.set(t,r);break;default:i.Log(i.GetStackTrace(),`Unknown message direction ${e}`)}}}!function(e){e[e.ToStreamer=0]="ToStreamer",e[e.FromStreamer=1]="FromStreamer"}(Le||(Le={}));class st$1{constructor(){this.responseEventListeners=new Map}addResponseEventListener(e,t){this.responseEventListeners.set(e,t)}removeResponseEventListener(e){this.responseEventListeners.delete(e)}onResponse(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.Response",6);const t=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),t,6),this.responseEventListeners.forEach((e=>{e(t)}))}}class nt$1{constructor(e,t){this.dataChannelSender=e,this.toStreamerMessagesMapProvider=t}sendLatencyTest(e){this.sendDescriptor("LatencyTest",e)}emitCommand(e){this.sendDescriptor("Command",e)}emitUIInteraction(e){this.sendDescriptor("UIInteraction",e)}sendDescriptor(e,t){const r=JSON.stringify(t),n=this.toStreamerMessagesMapProvider.toStreamerMessages.getFromKey(e);void 0===n&&i.Error(i.GetStackTrace(),`Attempted to emit descriptor with message type: ${e}, but the frontend hasn't been configured to send such a message. Check you've added the message type in your cpp`),i.Log(i.GetStackTrace(),"Sending: "+t,6);const s=new DataView(new ArrayBuffer(3+2*r.length));let a=0;s.setUint8(a,n.id),a++,s.setUint16(a,r.length,!0),a+=2;for(let e=0;e<r.length;e++)s.setUint16(a,r.charCodeAt(e),!0),a+=2;this.dataChannelSender.canSend()?this.dataChannelSender.sendData(s.buffer):i.Info(i.GetStackTrace(),`Data channel cannot send yet, skipping sending descriptor message: ${e} - ${r}`)}}class rt$1{constructor(e,t){this.dataChannelSender=e,this.toStreamerMessagesMapProvider=t}sendMessageToStreamer(e,t){void 0===t&&(t=[]);const r=this.toStreamerMessagesMapProvider.toStreamerMessages.getFromKey(e);if(void 0===r)return void i.Error(i.GetStackTrace(),`Attempted to send a message to the streamer with message type: ${e}, but the frontend hasn't been configured to send such a message. Check you've added the message type in your cpp`);const n=new DataView(new ArrayBuffer(r.byteLength+1));n.setUint8(0,r.id);let s=1;t.forEach(((e,t)=>{switch(r.structure[t]){case"uint8":n.setUint8(s,e),s+=1;break;case"uint16":n.setUint16(s,e,!0),s+=2;break;case"int16":n.setInt16(s,e,!0),s+=2;break;case"float":n.setFloat32(s,e,!0),s+=4;break;case"double":n.setFloat64(s,e,!0),s+=8}})),this.dataChannelSender.canSend()?this.dataChannelSender.sendData(n.buffer):i.Info(i.GetStackTrace(),`Data channel cannot send yet, skipping sending message: ${e} - ${new Uint8Array(n.buffer)}`)}}class it$1{constructor(e){this.sendMessageController=e}SendRequestQualityControl(){this.sendMessageController.sendMessageToStreamer("RequestQualityControl")}SendMaxFpsRequest(){this.sendMessageController.sendMessageToStreamer("FpsRequest")}SendAverageBitrateRequest(){this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest")}SendStartStreaming(){this.sendMessageController.sendMessageToStreamer("StartStreaming")}SendStopStreaming(){this.sendMessageController.sendMessageToStreamer("StopStreaming")}SendRequestInitialSettings(){this.sendMessageController.sendMessageToStreamer("RequestInitialSettings")}}class ot$1{constructor(e){this.dataChannelProvider=e}canSend(){return void 0!==this.dataChannelProvider.getDataChannelInstance().dataChannel&&"open"==this.dataChannelProvider.getDataChannelInstance().dataChannel.readyState}sendData(e){const t=this.dataChannelProvider.getDataChannelInstance();"open"==t.dataChannel.readyState?(t.dataChannel.send(e),i.Log(i.GetStackTrace(),`Message Sent: ${new Uint8Array(e)}`,6),this.resetAfkWarningTimerOnDataSend()):i.Error(i.GetStackTrace(),`Message Failed: ${new Uint8Array(e)}`)}resetAfkWarningTimerOnDataSend(){}}class at$2{constructor(e){this.videoElementProvider=e,this.normalizeAndQuantizeUnsignedFunc=()=>{throw new Error("Normalize and quantize unsigned, method not implemented.")},this.normalizeAndQuantizeSignedFunc=()=>{throw new Error("Normalize and unquantize signed, method not implemented.")},this.denormalizeAndUnquantizeUnsignedFunc=()=>{throw new Error("Denormalize and unquantize unsigned, method not implemented.")}}normalizeAndQuantizeUnsigned(e,t){return this.normalizeAndQuantizeUnsignedFunc(e,t)}unquantizeAndDenormalizeUnsigned(e,t){return this.denormalizeAndUnquantizeUnsignedFunc(e,t)}normalizeAndQuantizeSigned(e,t){return this.normalizeAndQuantizeSignedFunc(e,t)}setupNormalizeAndQuantize(){if(this.videoElementParent=this.videoElementProvider.getVideoParentElement(),this.videoElement=this.videoElementProvider.getVideoElement(),this.videoElementParent&&this.videoElement){const e=this.videoElementParent.clientHeight/this.videoElementParent.clientWidth,t=this.videoElement.videoHeight/this.videoElement.videoWidth;e>t?(i.Log(i.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio",6),this.ratio=e/t,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerBigger(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerBigger(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerBigger(e,t)):(i.Log(i.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio",6),this.ratio=t/e,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerSmaller(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerSmaller(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t))}}normalizeAndQuantizeUnsignedPlayerBigger(e,t){const r=e/this.videoElementParent.clientWidth,n=this.ratio*(t/this.videoElementParent.clientHeight-.5)+.5;return r<0||r>1||n<0||n>1?new dt(!1,65535,65535):new dt(!0,65536*r,65536*n)}denormalizeAndUnquantizeUnsignedPlayerBigger(e,t){const r=e/65536,n=(t/65536-.5)/this.ratio+.5;return new lt$1(r*this.videoElementParent.clientWidth,n*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerBigger(e,t){const r=e/(.5*this.videoElementParent.clientWidth),n=this.ratio*t/(.5*this.videoElementParent.clientHeight);return new ct$1(32767*r,32767*n)}normalizeAndQuantizeUnsignedPlayerSmaller(e,t){const r=this.ratio*(e/this.videoElementParent.clientWidth-.5)+.5,n=t/this.videoElementParent.clientHeight;return r<0||r>1||n<0||n>1?new dt(!1,65535,65535):new dt(!0,65536*r,65536*n)}denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t){const r=(e/65536-.5)/this.ratio+.5,n=t/65536;return new lt$1(r*this.videoElementParent.clientWidth,n*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerSmaller(e,t){const r=this.ratio*e/(.5*this.videoElementParent.clientWidth),n=t/(.5*this.videoElementParent.clientHeight);return new ct$1(32767*r,32767*n)}}class dt{constructor(e,t,r){this.inRange=e,this.x=t,this.y=r}}class lt$1{constructor(e,t){this.x=e,this.y=t}}class ct$1{constructor(e,t){this.x=e,this.y=t}}class ht{constructor(e,t){this.shouldShowPlayOverlay=!0,this.config=e,this.pixelStreaming=t,this.responseController=new st$1,this.file=new ze,this.sdpConstraints={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.afkController=new me(this.config,this.pixelStreaming,this.onAfkTriggered.bind(this)),this.afkController.onAFKTimedOutCallback=()=>{this.setDisconnectMessageOverride("You have been disconnected due to inactivity"),this.closeSignalingServer()},this.freezeFrameController=new y$1(this.pixelStreaming.videoElementParent),this.videoPlayer=new Ze(this.pixelStreaming.videoElementParent,this.config),this.videoPlayer.onVideoInitialized=()=>this.handleVideoInitialized(),this.videoPlayer.onMatchViewportResolutionCallback=(e,t)=>{const r={"Resolution.Width":e,"Resolution.Height":t};this.sendDescriptorController.emitCommand(r)},this.videoPlayer.onResizePlayerCallback=()=>{this.setUpMouseAndFreezeFrame()},this.streamController=new T$1(this.videoPlayer),this.coordinateConverter=new at$2(this.videoPlayer),this.sendrecvDataChannelController=new Se,this.recvDataChannelController=new Se,this.registerDataChannelEventEmitters(this.sendrecvDataChannelController),this.registerDataChannelEventEmitters(this.recvDataChannelController),this.dataChannelSender=new ot$1(this.sendrecvDataChannelController),this.dataChannelSender.resetAfkWarningTimerOnDataSend=()=>this.afkController.resetAfkWarningTimer(),this.streamMessageController=new tt$1,this.webSocketController=new f$1,this.webSocketController.onConfig=e=>this.handleOnConfigMessage(e),this.webSocketController.onStreamerList=e=>this.handleStreamerListMessage(e),this.webSocketController.onWebSocketOncloseOverlayMessage=e=>{this.pixelStreaming._onDisconnect(`Websocket disconnect (${e.code}) ${""!=e.reason?"- "+e.reason:""}`),this.setVideoEncoderAvgQP(0)},this.webSocketController.onOpen.addEventListener("open",(()=>{this.config.isFlagEnabled(re.BrowserSendOffer)||this.webSocketController.requestStreamerList()})),this.webSocketController.onClose.addEventListener("close",(()=>{this.afkController.stopAfkWarningTimer(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.setTouchInputEnabled(!1),this.setMouseInputEnabled(!1),this.setKeyboardInputEnabled(!1),this.setGamePadInputEnabled(!1)})),this.sendDescriptorController=new nt$1(this.dataChannelSender,this.streamMessageController),this.sendMessageController=new rt$1(this.dataChannelSender,this.streamMessageController),this.toStreamerMessagesController=new it$1(this.sendMessageController),this.registerMessageHandlers(),this.streamMessageController.populateDefaultProtocol(),this.inputClassesFactory=new Ye(this.streamMessageController,this.videoPlayer,this.coordinateConverter),this.isUsingSFU=!1,this.isQualityController=!1,this.preferredCodec="",this.config._addOnOptionSettingChangedListener(ce.StreamerId,(e=>{this.peerConnectionController.peerConnection.close(),this.peerConnectionController.createPeerConnection(this.peerConfig,this.preferredCodec),this.webSocketController.sendSubscribe(e)})),this.setVideoEncoderAvgQP(-1),this.signallingUrlBuilder=()=>{let e=this.config.getTextSettingValue(de.SignallingServerUrl);return this.config.isFlagEnabled(re.BrowserSendOffer)&&(e+="?"+re.BrowserSendOffer+"=true"),e}}requestUnquantizedAndDenormalizeUnsigned(e,t){return this.coordinateConverter.unquantizeAndDenormalizeUnsigned(e,t)}handleOnMessage(e){const t=new Uint8Array(e.data);i.Log(i.GetStackTrace(),"Message incoming:"+t,6);const r=this.streamMessageController.fromStreamerMessages.getFromValue(t[0]);this.streamMessageController.fromStreamerHandlers.get(r)(e.data)}registerMessageHandlers(){this.streamMessageController.registerMessageHandler(Le.FromStreamer,"QualityControlOwnership",(e=>this.onQualityControlOwnership(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"Response",(e=>this.responseController.onResponse(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"Command",(e=>{this.onCommand(e)})),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"FreezeFrame",(e=>this.onFreezeFrameMessage(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"UnfreezeFrame",(()=>this.invalidateFreezeFrameAndEnableVideo())),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"VideoEncoderAvgQP",(e=>this.handleVideoEncoderAvgQP(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"LatencyTest",(e=>this.handleLatencyTestResult(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"InitialSettings",(e=>this.handleInitialSettings(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"FileExtension",(e=>this.onFileExtension(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"FileMimeType",(e=>this.onFileMimeType(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"FileContents",(e=>this.onFileContents(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"TestEcho",(()=>{})),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"InputControlOwnership",(e=>this.onInputControlOwnership(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"GamepadResponse",(e=>this.onGamepadResponse(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"Protocol",(e=>this.onProtocolMessage(e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"IFrameRequest",(()=>this.sendMessageController.sendMessageToStreamer("IFrameRequest"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"RequestQualityControl",(()=>this.sendMessageController.sendMessageToStreamer("RequestQualityControl"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"FpsRequest",(()=>this.sendMessageController.sendMessageToStreamer("FpsRequest"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"AverageBitrateRequest",(()=>this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"StartStreaming",(()=>this.sendMessageController.sendMessageToStreamer("StartStreaming"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"StopStreaming",(()=>this.sendMessageController.sendMessageToStreamer("StopStreaming"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"LatencyTest",(()=>this.sendMessageController.sendMessageToStreamer("LatencyTest"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"RequestInitialSettings",(()=>this.sendMessageController.sendMessageToStreamer("RequestInitialSettings"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"TestEcho",(()=>{})),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"UIInteraction",(e=>this.sendDescriptorController.emitUIInteraction(e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"Command",(e=>this.sendDescriptorController.emitCommand(e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"KeyDown",(e=>this.sendMessageController.sendMessageToStreamer("KeyDown",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"KeyUp",(e=>this.sendMessageController.sendMessageToStreamer("KeyUp",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"KeyPress",(e=>this.sendMessageController.sendMessageToStreamer("KeyPress",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseEnter",(e=>this.sendMessageController.sendMessageToStreamer("MouseEnter",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseLeave",(e=>this.sendMessageController.sendMessageToStreamer("MouseLeave",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseDown",(e=>this.sendMessageController.sendMessageToStreamer("MouseDown",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseUp",(e=>this.sendMessageController.sendMessageToStreamer("MouseUp",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseMove",(e=>this.sendMessageController.sendMessageToStreamer("MouseMove",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseWheel",(e=>this.sendMessageController.sendMessageToStreamer("MouseWheel",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseDouble",(e=>this.sendMessageController.sendMessageToStreamer("MouseDouble",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"TouchStart",(e=>this.sendMessageController.sendMessageToStreamer("TouchStart",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"TouchEnd",(e=>this.sendMessageController.sendMessageToStreamer("TouchEnd",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"TouchMove",(e=>this.sendMessageController.sendMessageToStreamer("TouchMove",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadConnected",(()=>this.sendMessageController.sendMessageToStreamer("GamepadConnected"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadButtonPressed",(e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonPressed",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadButtonReleased",(e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonReleased",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadAnalog",(e=>this.sendMessageController.sendMessageToStreamer("GamepadAnalog",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadDisconnected",(e=>this.sendMessageController.sendMessageToStreamer("GamepadDisconnected",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRHMDTransform",(e=>this.sendMessageController.sendMessageToStreamer("XRHMDTransform",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRControllerTransform",(e=>this.sendMessageController.sendMessageToStreamer("XRControllerTransform",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRSystem",(e=>this.sendMessageController.sendMessageToStreamer("XRSystem",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRButtonTouched",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonTouched",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRButtonPressed",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonPressed",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRButtonReleased",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonReleased",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRAnalog",(e=>this.sendMessageController.sendMessageToStreamer("XRAnalog",e)))}onCommand(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.Command",6);const t=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),"Data Channel Command: "+t,6);const r=JSON.parse(t);"onScreenKeyboard"===r.command&&this.pixelStreaming._activateOnScreenKeyboard(r)}onProtocolMessage(e){try{const t=new TextDecoder("utf-16").decode(e.slice(1)),r=JSON.parse(t);Object.prototype.hasOwnProperty.call(r,"Direction")||i.Error(i.GetStackTrace(),"Malformed protocol received. Ensure the protocol message contains a direction");const n=r.Direction;delete r.Direction,i.Log(i.GetStackTrace(),`Received new ${n==Le.FromStreamer?"FromStreamer":"ToStreamer"} protocol. Updating existing protocol...`),Object.keys(r).forEach((e=>{const t=r[e];switch(n){case Le.ToStreamer:if(!Object.prototype.hasOwnProperty.call(t,"id")||!Object.prototype.hasOwnProperty.call(t,"byteLength"))return void i.Error(i.GetStackTrace(),`ToStreamer->${e} protocol definition was malformed as it didn't contain at least an id and a byteLength\n\n Definition was: ${JSON.stringify(t,null,2)}`);if(t.byteLength>0&&!Object.prototype.hasOwnProperty.call(t,"structure"))return void i.Error(i.GetStackTrace(),`ToStreamer->${e} protocol definition was malformed as it specified a byteLength but no accompanying structure`);this.streamMessageController.toStreamerHandlers.get(e)?this.streamMessageController.toStreamerMessages.add(e,t):i.Error(i.GetStackTrace(),`There was no registered handler for "${e}" - try adding one using registerMessageHandler(MessageDirection.ToStreamer, "${e}", myHandler)`);break;case Le.FromStreamer:if(!Object.prototype.hasOwnProperty.call(t,"id"))return void i.Error(i.GetStackTrace(),`FromStreamer->${e} protocol definition was malformed as it didn't contain at least an id\n\n Definition was: ${JSON.stringify(t,null,2)}`);this.streamMessageController.fromStreamerHandlers.get(e)?this.streamMessageController.fromStreamerMessages.add(e,t.id):i.Error(i.GetStackTrace(),`There was no registered handler for "${t}" - try adding one using registerMessageHandler(MessageDirection.FromStreamer, "${e}", myHandler)`);break;default:i.Error(i.GetStackTrace(),`Unknown direction: ${n}`)}})),this.toStreamerMessagesController.SendRequestInitialSettings(),this.toStreamerMessagesController.SendRequestQualityControl()}catch(e){i.Log(i.GetStackTrace(),e)}}onInputControlOwnership(e){const t=new Uint8Array(e);i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.InputControlOwnership",6);const r=new Boolean(t[1]).valueOf();i.Log(i.GetStackTrace(),`Received input controller message - will your input control the stream: ${r}`),this.pixelStreaming._onInputControlOwnership(r)}onGamepadResponse(e){const t=new TextDecoder("utf-16").decode(e.slice(1)),r=JSON.parse(t);this.gamePadController.onGamepadResponseReceived(r.controllerId)}onAfkTriggered(){this.afkController.onAfkClick(),this.videoPlayer.isPaused()&&this.videoPlayer.hasVideoSource()&&this.playStream()}setAfkEnabled(e){e?this.onAfkTriggered():this.afkController.stopAfkWarningTimer()}restartStreamAutomatically(){if(this.webSocketController)if(this.webSocketController.webSocket&&this.webSocketController.webSocket.readyState!==WebSocket.CLOSED){this.pixelStreaming._showActionOrErrorOnDisconnect=!1,this.setDisconnectMessageOverride("Restarting stream..."),this.closeSignalingServer();const e=setTimeout((()=>{this.pixelStreaming._onWebRtcAutoConnect(),this.connectToSignallingServer(),clearTimeout(e)}),3e3)}else i.Log(i.GetStackTrace(),"A websocket connection has not been made yet so we will start the stream"),this.pixelStreaming._onWebRtcAutoConnect(),this.connectToSignallingServer();else i.Log(i.GetStackTrace(),"The Web Socket Controller does not exist so this will not work right now.")}loadFreezeFrameOrShowPlayOverlay(){this.pixelStreaming.dispatchEvent(new $$a({shouldShowPlayOverlay:this.shouldShowPlayOverlay,isValid:this.freezeFrameController.valid,jpegData:this.freezeFrameController.jpeg})),!0===this.shouldShowPlayOverlay?(i.Log(i.GetStackTrace(),"showing play overlay"),this.resizePlayerStyle()):(i.Log(i.GetStackTrace(),"showing freeze frame"),this.freezeFrameController.showFreezeFrame()),setTimeout((()=>{this.videoPlayer.setVideoEnabled(!1)}),this.freezeFrameController.freezeFrameDelay)}onFreezeFrameMessage(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6);const t=new Uint8Array(e);this.freezeFrameController.processFreezeFrameMessage(t,(()=>this.loadFreezeFrameOrShowPlayOverlay()))}invalidateFreezeFrameAndEnableVideo(){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6),setTimeout((()=>{this.pixelStreaming.dispatchEvent(new q$1),this.freezeFrameController.hideFreezeFrame()}),this.freezeFrameController.freezeFrameDelay),this.videoPlayer.getVideoElement()&&this.videoPlayer.setVideoEnabled(!0)}onFileExtension(e){const t=new Uint8Array(e);Ge.setExtensionFromBytes(t,this.file)}onFileMimeType(e){const t=new Uint8Array(e);Ge.setMimeTypeFromBytes(t,this.file)}onFileContents(e){const t=new Uint8Array(e);Ge.setContentsFromBytes(t,this.file)}playStream(){if(!this.videoPlayer.getVideoElement()){const e="Could not play video stream because the video player was not initialized correctly.";return this.pixelStreaming.dispatchEvent(new N$1({message:e})),i.Error(i.GetStackTrace(),e),this.setDisconnectMessageOverride("Stream not initialized correctly"),void this.closeSignalingServer()}this.videoPlayer.hasVideoSource()?(this.setTouchInputEnabled(this.config.isFlagEnabled(re.TouchInput)),this.pixelStreaming.dispatchEvent(new K$1),this.streamController.audioElement.srcObject?(this.streamController.audioElement.muted=this.config.isFlagEnabled(re.StartVideoMuted),this.streamController.audioElement.play().then((()=>{this.playVideo()})).catch((e=>{i.Log(i.GetStackTrace(),e),i.Log(i.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new Q$1({reason:e}))}))):this.playVideo(),this.shouldShowPlayOverlay=!1,this.freezeFrameController.showFreezeFrame()):i.Warning(i.GetStackTrace(),"Cannot play stream, the video element has no srcObject to play.")}playVideo(){this.videoPlayer.play().catch((e=>{this.streamController.audioElement.srcObject&&this.streamController.audioElement.pause(),i.Log(i.GetStackTrace(),e),i.Log(i.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new Q$1({reason:e}))}))}autoPlayVideoOrSetUpPlayOverlay(){this.config.isFlagEnabled(re.AutoPlayVideo)&&this.playStream(),this.resizePlayerStyle()}connectToSignallingServer(){const e=this.signallingUrlBuilder();this.webSocketController.connect(e)}startSession(e){if(this.peerConfig=e,this.config.isFlagEnabled(re.ForceTURN)&&!this.checkTurnServerAvailability(e))return i.Info(i.GetStackTrace(),"No turn server was found in the Peer Connection Options. TURN cannot be forced, closing connection. Please use STUN instead"),this.setDisconnectMessageOverride("TURN cannot be forced, closing connection. Please use STUN instead."),void this.closeSignalingServer();this.peerConnectionController=new Ae(this.peerConfig,this.config,this.preferredCodec),this.peerConnectionController.onVideoStats=e=>this.handleVideoStats(e),this.peerConnectionController.onSendWebRTCOffer=e=>this.handleSendWebRTCOffer(e),this.peerConnectionController.onSendWebRTCAnswer=e=>this.handleSendWebRTCAnswer(e),this.peerConnectionController.onPeerIceCandidate=e=>this.handleSendIceCandidate(e),this.peerConnectionController.onDataChannel=e=>this.handleDataChannel(e),this.peerConnectionController.showTextOverlayConnecting=()=>this.pixelStreaming._onWebRtcConnecting(),this.peerConnectionController.showTextOverlaySetupFailure=()=>this.pixelStreaming._onWebRtcFailed();let t=!1;this.peerConnectionController.onIceConnectionStateChange=()=>{!t&&["connected","completed"].includes(this.peerConnectionController.peerConnection.iceConnectionState)&&(this.pixelStreaming._onWebRtcConnected(),t=!0)},this.peerConnectionController.onTrack=e=>this.streamController.handleOnTrack(e),this.config.isFlagEnabled(re.BrowserSendOffer)&&(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"cirrus",this.datachannelOptions),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e),this.peerConnectionController.createOffer(this.sdpConstraints,this.config))}checkTurnServerAvailability(e){if(!e.iceServers)return i.Info(i.GetStackTrace(),"A turn sever was not found"),!1;for(const t of e.iceServers)for(const e of t.urls)if(e.includes("turn"))return i.Log(i.GetStackTrace(),`A turn sever was found at ${e}`),!0;return i.Info(i.GetStackTrace(),"A turn sever was not found"),!1}handleOnConfigMessage(e){this.resizePlayerStyle(),this.startSession(e.peerConnectionOptions),this.webSocketController.onWebRtcAnswer=e=>this.handleWebRtcAnswer(e),this.webSocketController.onWebRtcOffer=e=>this.handleWebRtcOffer(e),this.webSocketController.onWebRtcPeerDataChannels=e=>this.handleWebRtcSFUPeerDatachannels(e),this.webSocketController.onIceCandidate=e=>this.handleIceCandidate(e)}handleStreamerListMessage(e){i.Log(i.GetStackTrace(),`Got streamer list ${e.ids}`,6);const t=[...e.ids];t.unshift(""),this.config.setOptionSettingOptions(ce.StreamerId,t);const r=new URLSearchParams(window.location.search);let n=null;1==e.ids.length?n=e.ids[0]:this.config.isFlagEnabled(re.PreferSFU)&&e.ids.includes("SFU")?n="SFU":r.has(ce.StreamerId)&&e.ids.includes(r.get(ce.StreamerId))&&(n=r.get(ce.StreamerId)),null!==n&&this.config.setOptionSettingValue(ce.StreamerId,n),this.pixelStreaming.dispatchEvent(new j$1({messageStreamerList:e,autoSelectedStreamerId:n}))}handleWebRtcAnswer(e){i.Log(i.GetStackTrace(),`Got answer sdp ${e.sdp}`,6);const t={sdp:e.sdp,type:"answer"};this.peerConnectionController.receiveAnswer(t),this.handlePostWebrtcNegotiation()}handleWebRtcOffer(e){i.Log(i.GetStackTrace(),`Got offer sdp ${e.sdp}`,6),this.isUsingSFU=!!e.sfu&&e.sfu,this.isUsingSFU&&(this.peerConnectionController.preferredCodec="");const t={sdp:e.sdp,type:"offer"};this.peerConnectionController.receiveOffer(t,this.config),this.handlePostWebrtcNegotiation()}handleWebRtcSFUPeerDatachannels(e){const t={ordered:!0,negotiated:!0,id:e.sendStreamId},r=e.sendStreamId!=e.recvStreamId;if(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,r?"send-datachannel":"datachannel",t),r){const t={ordered:!0,negotiated:!0,id:e.recvStreamId};this.recvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"recv-datachannel",t),this.recvDataChannelController.handleOnOpen=()=>this.webSocketController.sendSFURecvDataChannelReady(),this.recvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}else this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handlePostWebrtcNegotiation(){this.afkController.startAfkWarningTimer(),this.pixelStreaming._onWebRtcSdp(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.statsTimerHandle=window.setInterval((()=>this.getStats()),1e3),this.setMouseInputEnabled(this.config.isFlagEnabled(re.MouseInput)),this.setKeyboardInputEnabled(this.config.isFlagEnabled(re.KeyboardInput)),this.setGamePadInputEnabled(this.config.isFlagEnabled(re.GamepadInput))}handleIceCandidate(e){i.Log(i.GetStackTrace(),"Web RTC Controller: onWebRtcIce",6);const t=new RTCIceCandidate(e);this.peerConnectionController.handleOnIce(t)}handleSendIceCandidate(e){i.Log(i.GetStackTrace(),"OnIceCandidate",6),e.candidate&&e.candidate.candidate&&this.webSocketController.sendIceCandidate(e.candidate)}handleDataChannel(e){i.Log(i.GetStackTrace(),"Data channel created for us by browser as we are a receiving peer.",6),this.sendrecvDataChannelController.dataChannel=e.channel,this.sendrecvDataChannelController.setupDataChannel(),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handleSendWebRTCOffer(e){i.Log(i.GetStackTrace(),"Sending the offer to the Server",6),this.webSocketController.sendWebRtcOffer(e)}handleSendWebRTCAnswer(e){i.Log(i.GetStackTrace(),"Sending the answer to the Server",6),this.webSocketController.sendWebRtcAnswer(e),this.isUsingSFU&&this.webSocketController.sendWebRtcDatachannelRequest()}setUpMouseAndFreezeFrame(){this.videoElementParentClientRect=this.videoPlayer.getVideoParentElement().getBoundingClientRect(),this.coordinateConverter.setupNormalizeAndQuantize(),this.freezeFrameController.freezeFrame.resize()}closeSignalingServer(){var e;null===(e=this.webSocketController)||void 0===e||e.close()}closePeerConnection(){var e;null===(e=this.peerConnectionController)||void 0===e||e.close()}close(){this.closeSignalingServer(),this.closePeerConnection()}getStats(){this.peerConnectionController.generateStats()}sendLatencyTest(){this.latencyStartTime=Date.now(),this.sendDescriptorController.sendLatencyTest({StartTime:this.latencyStartTime})}sendEncoderMinQP(e){i.Log(i.GetStackTrace(),`MinQP=${e}\n`,6),null!=e&&this.sendDescriptorController.emitCommand({"Encoder.MinQP":e})}sendEncoderMaxQP(e){i.Log(i.GetStackTrace(),`MaxQP=${e}\n`,6),null!=e&&this.sendDescriptorController.emitCommand({"Encoder.MaxQP":e})}sendWebRTCMinBitrate(e){i.Log(i.GetStackTrace(),`WebRTC Min Bitrate=${e}`,6),null!=e&&this.sendDescriptorController.emitCommand({"WebRTC.MinBitrate":e})}sendWebRTCMaxBitrate(e){i.Log(i.GetStackTrace(),`WebRTC Max Bitrate=${e}`,6),null!=e&&this.sendDescriptorController.emitCommand({"WebRTC.MaxBitrate":e})}sendWebRTCFps(e){i.Log(i.GetStackTrace(),`WebRTC FPS=${e}`,6),null!=e&&(this.sendDescriptorController.emitCommand({"WebRTC.Fps":e}),this.sendDescriptorController.emitCommand({"WebRTC.MaxFps":e}))}sendShowFps(){i.Log(i.GetStackTrace(),"---- Sending show stat to UE ----",6),this.sendDescriptorController.emitCommand({"stat.fps":""})}sendIframeRequest(){i.Log(i.GetStackTrace(),"---- Sending Request for an IFrame ----",6),this.streamMessageController.toStreamerHandlers.get("IFrameRequest")()}emitUIInteraction(e){i.Log(i.GetStackTrace(),"---- Sending custom UIInteraction message ----",6),this.sendDescriptorController.emitUIInteraction(e)}emitCommand(e){i.Log(i.GetStackTrace(),"---- Sending custom Command message ----",6),this.sendDescriptorController.emitCommand(e)}emitConsoleCommand(e){i.Log(i.GetStackTrace(),"---- Sending custom Command:ConsoleCommand message ----",6),this.sendDescriptorController.emitCommand({ConsoleCommand:e})}sendRequestQualityControlOwnership(){i.Log(i.GetStackTrace(),"---- Sending Request to Control Quality ----",6),this.toStreamerMessagesController.SendRequestQualityControl()}handleLatencyTestResult(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.latencyTest",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),r=new Ie;Object.assign(r,JSON.parse(t)),r.processFields(),r.testStartTimeMs=this.latencyStartTime,r.browserReceiptTimeMs=Date.now(),r.latencyExcludingDecode=~~(r.browserReceiptTimeMs-r.testStartTimeMs),r.testDuration=~~(r.TransmissionTimeMs-r.ReceiptTimeMs),r.networkLatency=~~(r.latencyExcludingDecode-r.testDuration),r.frameDisplayDeltaTimeMs&&r.browserReceiptTimeMs&&(r.endToEndLatency=(r.frameDisplayDeltaTimeMs,r.networkLatency,~~+r.CaptureToSendMs)),this.pixelStreaming._onLatencyTestResult(r)}handleInitialSettings(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.InitialSettings",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),r=JSON.parse(t),n=new Fe;r.Encoder&&(n.EncoderSettings=r.Encoder),r.WebRTC&&(n.WebRTCSettings=r.WebRTC),r.PixelStreaming&&(n.PixelStreamingSettings=r.PixelStreaming),r.ConfigOptions&&this.config.setFlagEnabled(re.HoveringMouseMode,!!r.ConfigOptions.DefaultToHover),n.ueCompatible(),i.Log(i.GetStackTrace(),t,6),this.pixelStreaming._onInitialSettings(n)}handleVideoEncoderAvgQP(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.VideoEncoderAvgQP",6);const t=Number(new TextDecoder("utf-16").decode(e.slice(1)));this.setVideoEncoderAvgQP(t)}handleVideoInitialized(){this.pixelStreaming._onVideoInitialized(),this.autoPlayVideoOrSetUpPlayOverlay(),this.resizePlayerStyle(),this.videoPlayer.updateVideoStreamSize()}onQualityControlOwnership(e){const t=new Uint8Array(e);i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.QualityControlOwnership",6),this.isQualityController=new Boolean(t[1]).valueOf(),i.Log(i.GetStackTrace(),`Received quality controller message, will control quality: ${this.isQualityController}`),this.pixelStreaming._onQualityControlOwnership(this.isQualityController)}handleVideoStats(e){this.pixelStreaming._onVideoStats(e)}resizePlayerStyle(){this.videoPlayer.resizePlayerStyle()}getDisconnectMessageOverride(){return this.disconnectMessageOverride}setDisconnectMessageOverride(e){this.disconnectMessageOverride=e}setPreferredCodec(e){this.preferredCodec=e,this.peerConnectionController&&(this.peerConnectionController.preferredCodec=e,this.peerConnectionController.updateCodecSelection=!1)}setVideoEncoderAvgQP(e){this.videoAvgQp=e,this.pixelStreaming._onVideoEncoderAvgQP(this.videoAvgQp)}setKeyboardInputEnabled(e){var t;null===(t=this.keyboardController)||void 0===t||t.unregisterKeyBoardEvents(),e&&(this.keyboardController=this.inputClassesFactory.registerKeyBoard(this.config))}setMouseInputEnabled(e){var t;if(null===(t=this.mouseController)||void 0===t||t.unregisterMouseEvents(),e){const e=this.config.isFlagEnabled(re.HoveringMouseMode)?ue.HoveringMouse:ue.LockedMouse;this.mouseController=this.inputClassesFactory.registerMouse(e)}}setTouchInputEnabled(e){var t;null===(t=this.touchController)||void 0===t||t.unregisterTouchEvents(),e&&(this.touchController=this.inputClassesFactory.registerTouch(this.config.isFlagEnabled(re.FakeMouseWithTouches),this.videoElementParentClientRect))}setGamePadInputEnabled(e){var t;null===(t=this.gamePadController)||void 0===t||t.unregisterGamePadEvents(),e&&(this.gamePadController=this.inputClassesFactory.registerGamePad(),this.gamePadController.onGamepadConnected=()=>{this.streamMessageController.toStreamerHandlers.get("GamepadConnected")()},this.gamePadController.onGamepadDisconnected=e=>{this.streamMessageController.toStreamerHandlers.get("GamepadDisconnected")([e])})}registerDataChannelEventEmitters(e){e.onOpen=(e,t)=>this.pixelStreaming.dispatchEvent(new B$1({label:e,event:t})),e.onClose=(e,t)=>this.pixelStreaming.dispatchEvent(new _$1({label:e,event:t})),e.onError=(e,t)=>this.pixelStreaming.dispatchEvent(new W$1({label:e,event:t}))}}class gt{static vertexShader(){return"\n\t\tattribute vec2 a_position;\n\t\tattribute vec2 a_texCoord;\n\n\t\t// input\n\t\tuniform vec2 u_resolution;\n\t\tuniform vec4 u_offset;\n\n\t\t//\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t // convert the rectangle from pixels to 0.0 to 1.0\n\t\t vec2 zeroToOne = a_position / u_resolution;\n\n\t\t // convert from 0->1 to 0->2\n\t\t vec2 zeroToTwo = zeroToOne * 2.0;\n\n\t\t // convert from 0->2 to -1->+1 (clipspace)\n\t\t vec2 clipSpace = zeroToTwo - 1.0;\n\n\t\t gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\t\t // pass the texCoord to the fragment shader\n\t\t // The GPU will interpolate this value between points.\n\t\t v_texCoord = (a_texCoord * u_offset.xy) + u_offset.zw;\n\t\t}\n\t\t"}static fragmentShader(){return"\n\t\tprecision mediump float;\n\n\t\t// our texture\n\t\tuniform sampler2D u_image;\n\n\t\t// the texCoords passed in from the vertex shader.\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t gl_FragColor = texture2D(u_image, v_texCoord);\n\t\t}\n\t\t"}}class ut{static deepCopyGamepad(e){return JSON.parse(JSON.stringify({buttons:e.buttons.map((e=>JSON.parse(JSON.stringify({pressed:e.pressed,touched:e.touched})))),axes:e.axes}))}}class mt{constructor(e){this.toStreamerMessagesProvider=e,this.controllers=[]}updateStatus(e,t,r){if(e.gamepad){const n=t.getPose(e.gripSpace,r);if(!n)return;let i=0;e.profiles.includes("htc-vive")?i=1:e.profiles.includes("oculus-touch")&&(i=2),this.toStreamerMessagesProvider.toStreamerHandlers.get("XRSystem")([i]);let s=2;switch(e.handedness){case"left":s=0;break;case"right":s=1}const a=n.transform.matrix,o=[];for(let e=0;e<16;e++)o[e]=new Float32Array([a[e]])[0];this.toStreamerMessagesProvider.toStreamerHandlers.get("XRControllerTransform")([o[0],o[4],o[8],o[12],o[1],o[5],o[9],o[13],o[2],o[6],o[10],o[14],o[3],o[7],o[11],o[15],s]),void 0===this.controllers[s]&&(this.controllers[s]={prevState:void 0,currentState:void 0,id:void 0},this.controllers[s].prevState=ut.deepCopyGamepad(e.gamepad)),this.controllers[s].currentState=ut.deepCopyGamepad(e.gamepad);const l=this.controllers[s],c=l.currentState,h=l.prevState;for(let e=0;e<c.buttons.length;e++){const t=c.buttons[e],r=h.buttons[e];t.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([s,e,r.pressed?1:0]):!t.pressed&&r.pressed&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([s,e,0]),t.touched&&!t.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([s,3,r.touched?1:0]):!t.touched&&r.touched&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([s,3,0])}for(let e=0;e<c.axes.length;e++)this.toStreamerMessagesProvider.toStreamerHandlers.get("XRAnalog")([s,e,c.axes[e]]);this.controllers[s].prevState=c}}}class St{constructor(e){this.xrSession=null,this.webRtcController=e,this.xrControllers=[],this.xrGamepadController=new mt(this.webRtcController.streamMessageController),this.onSessionEnded=new EventTarget,this.onSessionStarted=new EventTarget,this.onFrame=new EventTarget}xrClicked(){this.xrSession?this.xrSession.end():navigator.xr.requestSession("immersive-vr").then((e=>{this.onXrSessionStarted(e)}))}onXrSessionEnded(){i.Log(i.GetStackTrace(),"XR Session ended"),this.xrSession=null,this.onSessionEnded.dispatchEvent(new Event("xrSessionEnded"))}onXrSessionStarted(e){i.Log(i.GetStackTrace(),"XR Session started"),this.xrSession=e,this.xrSession.addEventListener("end",(()=>{this.onXrSessionEnded()}));const t=document.createElement("canvas");this.gl=t.getContext("webgl2",{xrCompatible:!0}),this.xrSession.updateRenderState({baseLayer:new XRWebGLLayer(this.xrSession,this.gl)});const r=this.gl.createShader(this.gl.VERTEX_SHADER);this.gl.shaderSource(r,gt.vertexShader()),this.gl.compileShader(r);const n=this.gl.createShader(this.gl.FRAGMENT_SHADER);this.gl.shaderSource(n,gt.fragmentShader()),this.gl.compileShader(n);const s=this.gl.createProgram();this.gl.attachShader(s,r),this.gl.attachShader(s,n),this.gl.linkProgram(s),this.gl.useProgram(s),this.positionLocation=this.gl.getAttribLocation(s,"a_position"),this.texcoordLocation=this.gl.getAttribLocation(s,"a_texCoord"),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.enableVertexAttribArray(this.positionLocation);const a=this.gl.createTexture();this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.texcoordBuffer=this.gl.createBuffer(),this.resolutionLocation=this.gl.getUniformLocation(s,"u_resolution"),this.offsetLocation=this.gl.getUniformLocation(s,"u_offset"),e.requestReferenceSpace("local").then((e=>{this.xrRefSpace=e,this.xrSession.requestAnimationFrame(((e,t)=>this.onXrFrame(e,t)))})),this.onSessionStarted.dispatchEvent(new Event("xrSessionStarted"))}onXrFrame(e,t){const r=t.getViewerPose(this.xrRefSpace);if(r){const e=r.transform.matrix,t=[];for(let r=0;r<16;r++)t[r]=new Float32Array([e[r]])[0];this.webRtcController.streamMessageController.toStreamerHandlers.get("XRHMDTransform")([t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]]);const n=this.xrSession.renderState.baseLayer;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,n.framebuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.webRtcController.videoPlayer.getVideoElement()),this.render(this.webRtcController.videoPlayer.getVideoElement())}this.webRtcController.config.isFlagEnabled(re.XRControllerInput)&&this.xrSession.inputSources.forEach(((e,r,n)=>{this.xrGamepadController.updateStatus(e,t,this.xrRefSpace)}),this),this.xrSession.requestAnimationFrame(((e,t)=>this.onXrFrame(e,t))),this.onFrame.dispatchEvent(new se({time:e,frame:t}))}render(e){if(!this.gl)return;const t=this.xrSession.renderState.baseLayer;let r,n,i,s,a;this.gl.viewport(0,0,t.framebufferWidth,t.framebufferHeight),this.gl.uniform4f(this.offsetLocation,1,1,0,0),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,e.videoWidth,0,0,e.videoHeight,0,e.videoHeight,e.videoWidth,0,e.videoWidth,e.videoHeight]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),r=2,n=this.gl.FLOAT,i=!1,s=0,a=0,this.gl.vertexAttribPointer(this.positionLocation,r,n,i,s,a),this.gl.enableVertexAttribArray(this.texcoordLocation),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),r=2,n=this.gl.FLOAT,i=!1,s=0,a=0,this.gl.vertexAttribPointer(this.texcoordLocation,r,n,i,s,a),this.gl.uniform2f(this.resolutionLocation,e.videoWidth,e.videoHeight);const o=this.gl.TRIANGLES;a=0,this.gl.drawArrays(o,a,6)}static isSessionSupported(e){return navigator.xr?navigator.xr.isSessionSupported(e):new Promise((()=>!1))}}class pt{constructor(e){this.editTextButton=null,this.hiddenInput=null,"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e)}unquantizeAndDenormalizeUnsigned(e,t){return null}createOnScreenKeyboardHelpers(e){this.hiddenInput||(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),this.editTextButton||(this.editTextButton=document.createElement("button"),this.editTextButton.id="editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("touchend",(e=>{this.hiddenInput.focus(),e.preventDefault()})))}showOnScreenKeyboard(e){if(e.showOnScreenKeyboard){this.editTextButton.classList.remove("hiddenState");const t=this.unquantizeAndDenormalizeUnsigned(e.x,e.y);this.editTextButton.style.top=t.y.toString()+"px",this.editTextButton.style.left=(t.x-40).toString()+"px"}else this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur()}}class vt{constructor(e,t){this._showActionOrErrorOnDisconnect=!0,this.allowConsoleCommands=!1,this.config=e,(null==t?void 0:t.videoElementParent)&&(this._videoElementParent=t.videoElementParent),this._eventEmitter=new ne,this.configureSettings(),this.setWebRtcPlayerController(new ht(this.config,this)),this.onScreenKeyboardHelper=new pt(this.videoElementParent),this.onScreenKeyboardHelper.unquantizeAndDenormalizeUnsigned=(e,t)=>this._webRtcController.requestUnquantizedAndDenormalizeUnsigned(e,t),this._activateOnScreenKeyboard=e=>this.onScreenKeyboardHelper.showOnScreenKeyboard(e),this._webXrController=new St(this._webRtcController)}get videoElementParent(){return this._videoElementParent||(this._videoElementParent=document.createElement("div"),this._videoElementParent.id="videoElementParent"),this._videoElementParent}configureSettings(){this.config._addOnSettingChangedListener(re.IsQualityController,(e=>{!0!==e||this._webRtcController.isQualityController||this._webRtcController.sendRequestQualityControlOwnership()})),this.config._addOnSettingChangedListener(re.AFKDetection,(e=>{this._webRtcController.setAfkEnabled(e)})),this.config._addOnSettingChangedListener(re.MatchViewportResolution,(()=>{this._webRtcController.videoPlayer.updateVideoStreamSize()})),this.config._addOnSettingChangedListener(re.HoveringMouseMode,(e=>{this.config.setFlagLabel(re.HoveringMouseMode,`Control Scheme: ${e?"Hovering":"Locked"} Mouse`),this._webRtcController.setMouseInputEnabled(this.config.isFlagEnabled(re.MouseInput))})),this.config._addOnSettingChangedListener(re.KeyboardInput,(e=>{this._webRtcController.setKeyboardInputEnabled(e)})),this.config._addOnSettingChangedListener(re.MouseInput,(e=>{this._webRtcController.setMouseInputEnabled(e)})),this.config._addOnSettingChangedListener(re.TouchInput,(e=>{this._webRtcController.setTouchInputEnabled(e)})),this.config._addOnSettingChangedListener(re.GamepadInput,(e=>{this._webRtcController.setGamePadInputEnabled(e)})),this.config._addOnNumericSettingChangedListener(oe.MinQP,(e=>{i.Log(i.GetStackTrace(),"-------- Sending MinQP --------",7),this._webRtcController.sendEncoderMinQP(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(oe.MaxQP,(e=>{i.Log(i.GetStackTrace(),"-------- Sending encoder settings --------",7),this._webRtcController.sendEncoderMaxQP(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(oe.WebRTCMinBitrate,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMinBitrate(1e3*e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(oe.WebRTCMaxBitrate,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMaxBitrate(1e3*e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(oe.WebRTCFPS,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCFps(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnOptionSettingChangedListener(ce.PreferredCodec,(e=>{this._webRtcController&&this._webRtcController.setPreferredCodec(e)})),this.config._registerOnChangeEvents(this._eventEmitter)}_activateOnScreenKeyboard(e){throw new Error("Method not implemented.")}_onInputControlOwnership(e){this._inputController=e}setWebRtcPlayerController(e){this._webRtcController=e,this._webRtcController.setPreferredCodec(this.config.getSettingOption(ce.PreferredCodec).selected),this._webRtcController.resizePlayerStyle(),this.checkForAutoConnect()}connect(){this._webRtcController.connectToSignallingServer()}reconnect(){this._webRtcController.restartStreamAutomatically()}disconnect(){this._webRtcController.close()}play(){this._onStreamLoading(),this._webRtcController.playStream()}checkForAutoConnect(){this.config.isFlagEnabled(re.AutoConnect)&&(this._onWebRtcAutoConnect(),this._webRtcController.connectToSignallingServer())}_onWebRtcAutoConnect(){this._eventEmitter.dispatchEvent(new O$1),this._showActionOrErrorOnDisconnect=!0}_onWebRtcSdp(){this._eventEmitter.dispatchEvent(new D$1)}_onStreamLoading(){this._eventEmitter.dispatchEvent(new V$1)}_onDisconnect(e){""!=this._webRtcController.getDisconnectMessageOverride()&&void 0!==this._webRtcController.getDisconnectMessageOverride()&&null!=this._webRtcController.getDisconnectMessageOverride()&&(e=this._webRtcController.getDisconnectMessageOverride(),this._webRtcController.setDisconnectMessageOverride("")),this._eventEmitter.dispatchEvent(new z$2({eventString:e,showActionOrErrorOnDisconnect:this._showActionOrErrorOnDisconnect})),0==this._showActionOrErrorOnDisconnect&&(this._showActionOrErrorOnDisconnect=!0)}_onWebRtcConnecting(){this._eventEmitter.dispatchEvent(new U$1)}_onWebRtcConnected(){this._eventEmitter.dispatchEvent(new I$1)}_onWebRtcFailed(){this._eventEmitter.dispatchEvent(new G$1)}_onVideoInitialized(){this._eventEmitter.dispatchEvent(new H$1),this._videoStartTime=Date.now()}_onLatencyTestResult(e){this._eventEmitter.dispatchEvent(new Y$1({latencyTimings:e}))}_onVideoStats(e){this._videoStartTime&&void 0!==this._videoStartTime||(this._videoStartTime=Date.now()),e.handleSessionStatistics(this._videoStartTime,this._inputController,this._webRtcController.videoAvgQp),this._eventEmitter.dispatchEvent(new X$1({aggregatedStats:e}))}_onVideoEncoderAvgQP(e){this._eventEmitter.dispatchEvent(new F$1({avgQP:e}))}_onInitialSettings(e){var t;this._eventEmitter.dispatchEvent(new J$1({settings:e})),e.PixelStreamingSettings&&(this.allowConsoleCommands=null!==(t=e.PixelStreamingSettings.AllowPixelStreamingCommands)&&void 0!==t&&t,!1===this.allowConsoleCommands&&i.Info(i.GetStackTrace(),"-AllowPixelStreamingCommands=false, sending arbitrary console commands from browser to UE is disabled."));const r=this.config.useUrlParams,n=new URLSearchParams(window.location.search);e.EncoderSettings&&(this.config.setNumericSetting(oe.MinQP,r&&n.has(oe.MinQP)?Number.parseInt(n.get(oe.MinQP)):e.EncoderSettings.MinQP),this.config.setNumericSetting(oe.MaxQP,r&&n.has(oe.MaxQP)?Number.parseInt(n.get(oe.MaxQP)):e.EncoderSettings.MaxQP)),e.WebRTCSettings&&(this.config.setNumericSetting(oe.WebRTCMinBitrate,r&&n.has(oe.WebRTCMinBitrate)?Number.parseInt(n.get(oe.WebRTCMinBitrate))/1e3:e.WebRTCSettings.MinBitrate/1e3),this.config.setNumericSetting(oe.WebRTCMaxBitrate,r&&n.has(oe.WebRTCMaxBitrate)?Number.parseInt(n.get(oe.WebRTCMaxBitrate))/1e3:e.WebRTCSettings.MaxBitrate/1e3),this.config.setNumericSetting(oe.WebRTCFPS,r&&n.has(oe.WebRTCFPS)?Number.parseInt(n.get(oe.WebRTCFPS)):e.WebRTCSettings.FPS))}_onQualityControlOwnership(e){this.config.setFlagEnabled(re.IsQualityController,e)}requestLatencyTest(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendLatencyTest(),!0)}requestShowFps(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendShowFps(),!0)}requestIframe(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendIframeRequest(),!0)}emitUIInteraction(e){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.emitUIInteraction(e),!0)}emitCommand(e){return!(!this._webRtcController.videoPlayer.isVideoReady()||!this.allowConsoleCommands&&"ConsoleCommand"in e||(this._webRtcController.emitCommand(e),0))}emitConsoleCommand(e){return!(!this.allowConsoleCommands||!this._webRtcController.videoPlayer.isVideoReady()||(this._webRtcController.emitConsoleCommand(e),0))}addResponseEventListener(e,t){this._webRtcController.responseController.addResponseEventListener(e,t)}removeResponseEventListener(e){this._webRtcController.responseController.removeResponseEventListener(e)}dispatchEvent(e){return this._eventEmitter.dispatchEvent(e)}addEventListener(e,t){this._eventEmitter.addEventListener(e,t)}removeEventListener(e,t){this._eventEmitter.removeEventListener(e,t)}toggleXR(){this.webXrController.xrClicked()}setSignallingUrlBuilder(e){this._webRtcController.signallingUrlBuilder=e}get webSocketController(){return this._webRtcController.webSocketController}get webXrController(){return this._webXrController}}var Ct=r$1.Dz,ft=r$1.g$,Tt=r$1.Lt,Et=r$1.Q9,yt=r$1.qf,bt=r$1.hV,Mt=r$1.z$,wt=r$1.J0,Pt=r$1.De,kt=r$1.$C,Rt=r$1.al,Lt=r$1._W,xt=r$1.tz,At=r$1.Nu,Ft=r$1.zg,Dt=r$1.vp,Ot=r$1.vU,Ut=r$1.wF,It=r$1.rv,Gt=r$1.Nh,zt=r$1.ss,Bt=r$1.qW,_t=r$1.QL,Wt=r$1.cf,Ht=r$1.eM,Vt=r$1.Yd,Nt=r$1.iM,Kt=r$1.qy,Qt=r$1.ce,$t=r$1.sK,qt=r$1.Ok,Xt=r$1.q5,jt=r$1.g,Yt=r$1.xl,Jt=r$1.I,Zt=r$1.bx,es=r$1.Ib,ts=r$1.Az,ss=r$1.Iw,ns$1=r$1.qY,rs=r$1.db,is=r$1.mR,os=r$1.Tn,as=r$1.rV,ds=r$1.gh,ls=r$1.i5,cs=r$1.x_,hs=r$1.Am,gs=r$1.eR,us=r$1.r8,ms=r$1.u3,Ss=r$1.vd,ps=r$1.iV,vs=r$1.jZ,Cs=r$1.SW,fs=r$1.ZH,Ts=r$1.Ni,Es=r$1.lh,ys=r$1.bq,bs=r$1.$f,Ms=r$1.eu,ws=r$1.Ax,Ps=r$1.Mc;function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}var _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},isBrowser="object"===("undefined"==typeof window?"undefined":_typeof$1(window))&&"object"===("undefined"==typeof document?"undefined":_typeof$1(document))&&9===document.nodeType;function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}var plainObjectConstrurctor={}.constructor;function cloneStyle(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(cloneStyle);if(e.constructor!==plainObjectConstrurctor)return e;var t={};for(var r in e)t[r]=cloneStyle(e[r]);return t}function createRule(e,t,r){void 0===e&&(e="unnamed");var n=r.jss,i=cloneStyle(t),s=n.plugins.onCreateRule(e,i,r);return s||(e[0],null)}var join$4=function(e,t){for(var r="",n=0;n<e.length&&"!important"!==e[n];n++)r&&(r+=t),r+=e[n];return r},toCssValue=function(e){if(!Array.isArray(e))return e;var t="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)t&&(t+=", "),t+=join$4(e[r]," ");else t=join$4(e,", ");return"!important"===e[e.length-1]&&(t+=" !important"),t};function getWhitespaceSymbols(e){return e&&!1===e.format?{linebreak:"",space:""}:{linebreak:"\n",space:" "}}function indentStr(e,t){for(var r="",n=0;n<t;n++)r+=" ";return r+e}function toCss(e,t,r){void 0===r&&(r={});var n="";if(!t)return n;var i=r.indent,s=void 0===i?0:i,a=t.fallbacks;!1===r.format&&(s=-1/0);var o=getWhitespaceSymbols(r),l=o.linebreak,c=o.space;if(e&&s++,a)if(Array.isArray(a))for(var h=0;h<a.length;h++){var d=a[h];for(var u in d){var p=d[u];null!=p&&(n&&(n+=l),n+=indentStr(u+":"+c+toCssValue(p)+";",s))}}else for(var f in a){var m=a[f];null!=m&&(n&&(n+=l),n+=indentStr(f+":"+c+toCssValue(m)+";",s))}for(var g in t){var y=t[g];null!=y&&"fallbacks"!==g&&(n&&(n+=l),n+=indentStr(g+":"+c+toCssValue(y)+";",s))}return(n||r.allowEmpty)&&e?(n&&(n=""+l+n+l),indentStr(""+e+c+"{"+n,--s)+indentStr("}",s)):n}var escapeRegex=/([[\].#*$><+~=|^:(),"'`\s])/g,nativeEscape="undefined"!=typeof CSS&&CSS.escape,escape=function(e){return nativeEscape?nativeEscape(e):e.replace(escapeRegex,"\\$1")},BaseStyleRule=function(){function e(e,t,r){this.type="style",this.isProcessed=!1;var n=r.sheet,i=r.Renderer;this.key=e,this.options=r,this.style=t,n?this.renderer=n.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,r){if(void 0===t)return this.style[e];var n=!!r&&r.force;if(!n&&this.style[e]===t)return this;var i=t;r&&!1===r.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var s=null==i||!1===i,a=e in this.style;if(s&&!a&&!n)return this;var o=s&&a;if(o?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return o?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},e}(),StyleRule=function(e){function t(t,r,n){var i;i=e.call(this,t,r,n)||this;var s=n.selector,a=n.scoped,o=n.sheet,l=n.generateId;return s?i.selectorText=s:!1!==a&&(i.id=l(_assertThisInitialized(_assertThisInitialized(i)),o),i.selectorText="."+escape(i.id)),i}_inheritsLoose(t,e);var r=t.prototype;return r.applyTo=function(e){var t=this.renderer;if(t){var r=this.toJSON();for(var n in r)t.setProperty(e,n,r[n])}return this},r.toJSON=function(){var e={};for(var t in this.style){var r=this.style[t];"object"!=typeof r?e[t]=r:Array.isArray(r)&&(e[t]=toCssValue(r))}return e},r.toString=function(e){var t=this.options.sheet,r=!!t&&t.options.link?_extends({},e,{allowEmpty:!0}):e;return toCss(this.selectorText,this.style,r)},_createClass(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,r=this.renderable;if(r&&t)t.setSelector(r,e)||t.replaceRule(r,this)}},get:function(){return this.selectorText}}]),t}(BaseStyleRule),pluginStyleRule={onCreateRule:function(e,t,r){return"@"===e[0]||r.parent&&"keyframes"===r.parent.type?null:new StyleRule(e,t,r)}},defaultToStringOptions={indent:1,children:!0},atRegExp=/@([\w-]+)/,ConditionalRule=function(){function e(e,t,r){this.type="conditional",this.isProcessed=!1,this.key=e;var n=e.match(atRegExp);for(var i in this.at=n?n[1]:"unknown",this.query=r.name||"@"+this.at,this.options=r,this.rules=new RuleList(_extends({},r,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,r){var n=this.rules.add(e,t,r);return n?(this.options.jss.plugins.onProcessRule(n),n):null},t.replaceRule=function(e,t,r){var n=this.rules.replace(e,t,r);return n&&this.options.jss.plugins.onProcessRule(n),n},t.toString=function(e){void 0===e&&(e=defaultToStringOptions);var t=getWhitespaceSymbols(e).linebreak;if(null==e.indent&&(e.indent=defaultToStringOptions.indent),null==e.children&&(e.children=defaultToStringOptions.children),!1===e.children)return this.query+" {}";var r=this.rules.toString(e);return r?this.query+" {"+t+r+t+"}":""},e}(),keyRegExp=/@container|@media|@supports\s+/,pluginConditionalRule={onCreateRule:function(e,t,r){return keyRegExp.test(e)?new ConditionalRule(e,t,r):null}},defaultToStringOptions$1={indent:1,children:!0},nameRegExp=/@keyframes\s+([\w-]+)/,KeyframesRule=function(){function e(e,t,r){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var n=e.match(nameRegExp);n&&n[1]?this.name=n[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=r;var i=r.scoped,s=r.sheet,a=r.generateId;for(var o in this.id=!1===i?this.name:escape(a(this,s)),this.rules=new RuleList(_extends({},r,{parent:this})),t)this.rules.add(o,t[o],_extends({},r,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=defaultToStringOptions$1);var t=getWhitespaceSymbols(e).linebreak;if(null==e.indent&&(e.indent=defaultToStringOptions$1.indent),null==e.children&&(e.children=defaultToStringOptions$1.children),!1===e.children)return this.at+" "+this.id+" {}";var r=this.rules.toString(e);return r&&(r=""+t+r+t),this.at+" "+this.id+" {"+r+"}"},e}(),keyRegExp$1=/@keyframes\s+/,refRegExp=/\$([\w-]+)/g,findReferencedKeyframe=function(e,t){return"string"==typeof e?e.replace(refRegExp,(function(e,r){return r in t?t[r]:e})):e},replaceRef=function(e,t,r){var n=e[t],i=findReferencedKeyframe(n,r);i!==n&&(e[t]=i)},pluginKeyframesRule={onCreateRule:function(e,t,r){return"string"==typeof e&&keyRegExp$1.test(e)?new KeyframesRule(e,t,r):null},onProcessStyle:function(e,t,r){return"style"===t.type&&r?("animation-name"in e&&replaceRef(e,"animation-name",r.keyframes),"animation"in e&&replaceRef(e,"animation",r.keyframes),e):e},onChangeValue:function(e,t,r){var n=r.options.sheet;if(!n)return e;switch(t){case"animation":case"animation-name":return findReferencedKeyframe(e,n.keyframes);default:return e}}},KeyframeRule=function(e){function t(){return e.apply(this,arguments)||this}return _inheritsLoose(t,e),t.prototype.toString=function(e){var t=this.options.sheet,r=!!t&&t.options.link?_extends({},e,{allowEmpty:!0}):e;return toCss(this.key,this.style,r)},t}(BaseStyleRule),pluginKeyframeRule={onCreateRule:function(e,t,r){return r.parent&&"keyframes"===r.parent.type?new KeyframeRule(e,t,r):null}},FontFaceRule=function(){function e(e,t,r){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=r}return e.prototype.toString=function(e){var t=getWhitespaceSymbols(e).linebreak;if(Array.isArray(this.style)){for(var r="",n=0;n<this.style.length;n++)r+=toCss(this.at,this.style[n]),this.style[n+1]&&(r+=t);return r}return toCss(this.at,this.style,e)},e}(),keyRegExp$2=/@font-face/,pluginFontFaceRule={onCreateRule:function(e,t,r){return keyRegExp$2.test(e)?new FontFaceRule(e,t,r):null}},ViewportRule=function(){function e(e,t,r){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=e,this.style=t,this.options=r}return e.prototype.toString=function(e){return toCss(this.key,this.style,e)},e}(),pluginViewportRule={onCreateRule:function(e,t,r){return"@viewport"===e||"@-ms-viewport"===e?new ViewportRule(e,t,r):null}},SimpleRule=function(){function e(e,t,r){this.type="simple",this.isProcessed=!1,this.key=e,this.value=t,this.options=r}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",r=0;r<this.value.length;r++)t+=this.key+" "+this.value[r]+";",this.value[r+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),keysMap={"@charset":!0,"@import":!0,"@namespace":!0},pluginSimpleRule={onCreateRule:function(e,t,r){return e in keysMap?new SimpleRule(e,t,r):null}},plugins=[pluginStyleRule,pluginConditionalRule,pluginKeyframesRule,pluginKeyframeRule,pluginFontFaceRule,pluginViewportRule,pluginSimpleRule],defaultUpdateOptions={process:!0},forceUpdateOptions={force:!0,process:!0},RuleList=function(){function e(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var t=e.prototype;return t.add=function(e,t,r){var n=this.options,i=n.parent,s=n.sheet,a=n.jss,o=n.Renderer,l=n.generateId,c=n.scoped,h=_extends({classes:this.classes,parent:i,sheet:s,jss:a,Renderer:o,generateId:l,scoped:c,name:e,keyframes:this.keyframes,selector:void 0},r),d=e;e in this.raw&&(d=e+"-d"+this.counter++),this.raw[d]=t,d in this.classes&&(h.selector="."+escape(this.classes[d]));var u=createRule(d,t,h);if(!u)return null;this.register(u);var p=void 0===h.index?this.index.length:h.index;return this.index.splice(p,0,u),u},t.replace=function(e,t,r){var n=this.get(e),i=this.index.indexOf(n);n&&this.remove(n);var s=r;return-1!==i&&(s=_extends({},r,{index:i})),this.add(e,t,s)},t.get=function(e){return this.map[e]},t.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},t.indexOf=function(e){return this.index.indexOf(e)},t.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},t.register=function(e){this.map[e.key]=e,e instanceof StyleRule?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof KeyframesRule&&this.keyframes&&(this.keyframes[e.name]=e.id)},t.unregister=function(e){delete this.map[e.key],e instanceof StyleRule?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof KeyframesRule&&delete this.keyframes[e.name]},t.update=function(){var e,t,r;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.get(e),t,r);else for(var n=0;n<this.index.length;n++)this.updateOne(this.index[n],t,r)},t.updateOne=function(t,r,n){void 0===n&&(n=defaultUpdateOptions);var i=this.options,s=i.jss.plugins,a=i.sheet;if(t.rules instanceof e)t.rules.update(r,n);else{var o=t.style;if(s.onUpdate(r,t,a,n),n.process&&o&&o!==t.style){for(var l in s.onProcessStyle(t.style,t,a),t.style){var c=t.style[l];c!==o[l]&&t.prop(l,c,forceUpdateOptions)}for(var h in o){var d=t.style[h],u=o[h];null==d&&d!==u&&t.prop(h,null,forceUpdateOptions)}}}},t.toString=function(e){for(var t="",r=this.options.sheet,n=!!r&&r.options.link,i=getWhitespaceSymbols(e).linebreak,s=0;s<this.index.length;s++){var a=this.index[s].toString(e);(a||n)&&(t&&(t+=i),t+=a)}return t},e}(),StyleSheet=function(){function e(e,t){for(var r in this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=_extends({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),t.Renderer&&(this.renderer=new t.Renderer(this)),this.rules=new RuleList(this.options),e)this.rules.add(r,e[r]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},t.addRule=function(e,t,r){var n=this.queue;this.attached&&!n&&(this.queue=[]);var i=this.rules.add(e,t,r);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(n?n.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),i):i:(this.deployed=!1,i)):null},t.replaceRule=function(e,t,r){var n=this.rules.get(e);if(!n)return this.addRule(e,t,r);var i=this.rules.replace(e,t,r);return i&&this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(this.renderer&&(i?n.renderable&&this.renderer.replaceRule(n.renderable,i):this.renderer.deleteRule(n)),i):i:(this.deployed=!1,i)},t.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},t.addRules=function(e,t){var r=[];for(var n in e){var i=this.addRule(n,e[n],t);i&&r.push(i)}return r},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t="object"==typeof e?e:this.rules.get(e);return!(!t||this.attached&&!t.renderable)&&(this.rules.remove(t),!(this.attached&&t.renderable&&this.renderer)||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.updateOne=function(e,t,r){return this.rules.updateOne(e,t,r),this},t.toString=function(e){return this.rules.toString(e)},e}(),PluginsRegistry=function(){function e(){this.plugins={internal:[],external:[]},this.registry={}}var t=e.prototype;return t.onCreateRule=function(e,t,r){for(var n=0;n<this.registry.onCreateRule.length;n++){var i=this.registry.onCreateRule[n](e,t,r);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,r=0;r<this.registry.onProcessRule.length;r++)this.registry.onProcessRule[r](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,r){for(var n=0;n<this.registry.onProcessStyle.length;n++)t.style=this.registry.onProcessStyle[n](t.style,t,r)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,r,n){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,r,n)},t.onChangeValue=function(e,t,r){for(var n=e,i=0;i<this.registry.onChangeValue.length;i++)n=this.registry.onChangeValue[i](n,t,r);return n},t.use=function(e,t){void 0===t&&(t={queue:"external"});var r=this.plugins[t.queue];-1===r.indexOf(e)&&(r.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(e,t){for(var r in t)r in e&&e[r].push(t[r]);return e}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),SheetsRegistry=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,r=e.options.index;if(-1===t.indexOf(e))if(0===t.length||r>=this.index)t.push(e);else for(var n=0;n<t.length;n++)if(t[n].options.index>r)return void t.splice(n,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,r=t.attached,n=_objectWithoutPropertiesLoose(t,["attached"]),i=getWhitespaceSymbols(n).linebreak,s="",a=0;a<this.registry.length;a++){var o=this.registry[a];null!=r&&o.attached!==r||(s&&(s+=i),s+=o.toString(n))}return s},_createClass(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),sheets=new SheetsRegistry,globalThis$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),ns="2f1acc6c3a606b082e5eef5e54414ffb";null==globalThis$1[ns]&&(globalThis$1[ns]=0);var moduleId=globalThis$1[ns]++,createGenerateId=function(e){void 0===e&&(e={});var t=0;return function(r,n){t+=1;var i="",s="";return n&&(n.options.classNamePrefix&&(s=n.options.classNamePrefix),null!=n.options.jss.id&&(i=String(n.options.jss.id))),e.minify?""+(s||"c")+moduleId+i+t:s+r.key+"-"+moduleId+(i?"-"+i:"")+"-"+t}},memoize=function(e){var t;return function(){return t||(t=e()),t}},getPropertyValue=function(e,t){try{return e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(e){return""}},setProperty=function(e,t,r){try{var n=r;if(Array.isArray(r)&&(n=toCssValue(r)),e.attributeStyleMap)e.attributeStyleMap.set(t,n);else{var i=n?n.indexOf("!important"):-1,s=i>-1?n.substr(0,i-1):n;e.style.setProperty(t,s,i>-1?"important":"")}}catch(e){return!1}return!0},removeProperty=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(e){}},setSelector=function(e,t){return e.selectorText=t,e.selectorText===t},getHead=memoize((function(){return document.querySelector("head")}));function findHigherSheet(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.attached&&n.options.index>t.index&&n.options.insertionPoint===t.insertionPoint)return n}return null}function findHighestSheet(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.attached&&n.options.insertionPoint===t.insertionPoint)return n}return null}function findCommentNode(e){for(var t=getHead(),r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];if(8===n.nodeType&&n.nodeValue.trim()===e)return n}return null}function findPrevNode(e){var t=sheets.registry;if(t.length>0){var r=findHigherSheet(t,e);if(r&&r.renderer)return{parent:r.renderer.element.parentNode,node:r.renderer.element};if((r=findHighestSheet(t,e))&&r.renderer)return{parent:r.renderer.element.parentNode,node:r.renderer.element.nextSibling}}var n=e.insertionPoint;if(n&&"string"==typeof n){var i=findCommentNode(n);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function insertStyle(e,t){var r=t.insertionPoint,n=findPrevNode(t);if(!1!==n&&n.parent)n.parent.insertBefore(e,n.node);else if(r&&"number"==typeof r.nodeType){var i=r,s=i.parentNode;s&&s.insertBefore(e,i.nextSibling)}else getHead().appendChild(e)}var getNonce=memoize((function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null})),_insertRule=function(e,t,r){try{"insertRule"in e?e.insertRule(t,r):"appendRule"in e&&e.appendRule(t)}catch(e){return!1}return e.cssRules[r]},getValidRuleInsertionIndex=function(e,t){var r=e.cssRules.length;return void 0===t||t>r?r:t},createStyle=function(){var e=document.createElement("style");return e.textContent="\n",e},DomRenderer=function(){function e(e){this.getPropertyValue=getPropertyValue,this.setProperty=setProperty,this.removeProperty=removeProperty,this.setSelector=setSelector,this.hasInsertedRules=!1,this.cssRules=[],e&&sheets.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},r=t.media,n=t.meta,i=t.element;this.element=i||createStyle(),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),n&&this.element.setAttribute("data-meta",n);var s=getNonce();s&&this.element.setAttribute("nonce",s)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){insertStyle(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var r=0;r<e.index.length;r++)this.insertRule(e.index[r],r,t)},t.insertRule=function(e,t,r){if(void 0===r&&(r=this.element.sheet),e.rules){var n=e,i=r;if("conditional"===e.type||"keyframes"===e.type){var s=getValidRuleInsertionIndex(r,t);if(!1===(i=_insertRule(r,n.toString({children:!1}),s)))return!1;this.refCssRule(e,s,i)}return this.insertRules(n.rules,i),i}var a=e.toString();if(!a)return!1;var o=getValidRuleInsertionIndex(r,t),l=_insertRule(r,a,o);return!1!==l&&(this.hasInsertedRules=!0,this.refCssRule(e,o,l),l)},t.refCssRule=function(e,t,r){e.renderable=r,e.options.parent instanceof StyleSheet&&this.cssRules.splice(t,0,r)},t.deleteRule=function(e){var t=this.element.sheet,r=this.indexOf(e);return-1!==r&&(t.deleteRule(r),this.cssRules.splice(r,1),!0)},t.indexOf=function(e){return this.cssRules.indexOf(e)},t.replaceRule=function(e,t){var r=this.indexOf(e);return-1!==r&&(this.element.sheet.deleteRule(r),this.cssRules.splice(r,1),this.insertRule(t,r))},t.getRules=function(){return this.element.sheet.cssRules},e}(),instanceCounter=0,Jss=function(){function e(e){this.id=instanceCounter++,this.version="10.10.0",this.plugins=new PluginsRegistry,this.options={id:{minify:!1},createGenerateId:createGenerateId,Renderer:isBrowser?DomRenderer:null,plugins:[]},this.generateId=createGenerateId({minify:!1});for(var t=0;t<plugins.length;t++)this.plugins.use(plugins[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId),e.id&&(this.options.id=_extends({},this.options.id,e.id)),(e.createGenerateId||e.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),"Renderer"in e&&(this.options.Renderer=e.Renderer),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var r=t.index;"number"!=typeof r&&(r=0===sheets.index?0:sheets.index+1);var n=new StyleSheet(e,_extends({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:r}));return this.plugins.onProcessSheet(n),n},t.removeStyleSheet=function(e){return e.detach(),sheets.remove(e),this},t.createRule=function(e,t,r){if(void 0===t&&(t={}),void 0===r&&(r={}),"object"==typeof e)return this.createRule(void 0,e,t);var n=_extends({},r,{name:e,jss:this,Renderer:this.options.Renderer});n.generateId||(n.generateId=this.generateId),n.classes||(n.classes={}),n.keyframes||(n.keyframes={});var i=createRule(e,t,n);return i&&this.plugins.onProcessRule(i),i},t.use=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){e.plugins.use(t)})),this},e}(),createJss=function(e){return new Jss(e)},index=createJss(),index$1=index,at$1="@global",atPrefix="@global ",GlobalContainerRule=function(){function e(e,t,r){for(var n in this.type="global",this.at=at$1,this.isProcessed=!1,this.key=e,this.options=r,this.rules=new RuleList(_extends({},r,{parent:this})),t)this.rules.add(n,t[n]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,r){var n=this.rules.add(e,t,r);return n&&this.options.jss.plugins.onProcessRule(n),n},t.replaceRule=function(e,t,r){var n=this.rules.replace(e,t,r);return n&&this.options.jss.plugins.onProcessRule(n),n},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(e){return this.rules.toString(e)},e}(),GlobalPrefixedRule=function(){function e(e,t,r){this.type="global",this.at=at$1,this.isProcessed=!1,this.key=e,this.options=r;var n=e.substr(atPrefix.length);this.rule=r.jss.createRule(n,t,_extends({},r,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),separatorRegExp=/\s*,\s*/g;function addScope(e,t){for(var r=e.split(separatorRegExp),n="",i=0;i<r.length;i++)n+=t+" "+r[i].trim(),r[i+1]&&(n+=", ");return n}function handleNestedGlobalContainerRule(e,t){var r=e.options,n=e.style,i=n?n[at$1]:null;if(i){for(var s in i)t.addRule(s,i[s],_extends({},r,{selector:addScope(s,e.selector)}));delete n[at$1]}}function handlePrefixedGlobalRule(e,t){var r=e.options,n=e.style;for(var i in n)if("@"===i[0]&&i.substr(0,at$1.length)===at$1){var s=addScope(i.substr(at$1.length),e.selector);t.addRule(s,n[i],_extends({},r,{selector:s})),delete n[i]}}function jssGlobal(){return{onCreateRule:function(e,t,r){if(!e)return null;if(e===at$1)return new GlobalContainerRule(e,t,r);if("@"===e[0]&&e.substr(0,atPrefix.length)===atPrefix)return new GlobalPrefixedRule(e,t,r);var n=r.parent;return n&&("global"===n.type||n.options.parent&&"global"===n.options.parent.type)&&(r.scoped=!1),r.selector||!1!==r.scoped||(r.selector=e),null},onProcessRule:function(e,t){"style"===e.type&&t&&(handleNestedGlobalContainerRule(e,t),handlePrefixedGlobalRule(e,t))}}}var uppercasePattern=/[A-Z]/g,msPattern=/^ms-/,cache={};function toHyphenLower(e){return"-"+e.toLowerCase()}function hyphenateStyleName(e){if(cache.hasOwnProperty(e))return cache[e];var t=e.replace(uppercasePattern,toHyphenLower);return cache[e]=msPattern.test(t)?"-"+t:t}function convertCase(e){var t={};for(var r in e){t[0===r.indexOf("--")?r:hyphenateStyleName(r)]=e[r]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(convertCase):t.fallbacks=convertCase(e.fallbacks)),t}function camelCase(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]=convertCase(e[t]);return e}return convertCase(e)},onChangeValue:function(e,t,r){if(0===t.indexOf("--"))return e;var n=hyphenateStyleName(t);return t===n?e:(r.prop(n,e),null)}}}var n={d:(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};n.d(o,{ym:()=>b,EW:()=>h$1,Mx:()=>Q,L3:()=>H,rl:()=>m,NR:()=>u,f1:()=>v$1,IY:()=>E,RZ:()=>d,XY:()=>j,Fk:()=>g,Zh:()=>N,ek:()=>R,MG:()=>z$1,gE:()=>U,tW:()=>B,wr:()=>p});const l=(a={Flags:()=>Ot,Logger:()=>Vt,NumericParameters:()=>$t,OptionParameters:()=>qt,SettingFlag:()=>ts,TextParameters:()=>cs,WebXRController:()=>bs},r={},n.d(r,a),r);var a,r,c;class d{constructor(e,t,r){this.rootDiv=e,this.rootElement=t,this.textElement=r,this.rootElement.appendChild(this.textElement),this.hide(),this.rootDiv.appendChild(this.rootElement)}show(){this.rootElement.classList.remove("hiddenState")}hide(){this.rootElement.classList.add("hiddenState")}}class h$1 extends d{constructor(e,t,r){super(e,t,r),this.onActionCallback=()=>{l.Logger.Info(l.Logger.GetStackTrace(),"Did you forget to set the onAction callback in your overlay?")}}update(e){null==e&&null==e||(this.textElement.innerHTML=e)}onAction(e){this.onActionCallback=e}activate(){this.onActionCallback()}}class m extends h$1{static createRootElement(){const e=document.createElement("div");return e.id="connectOverlay",e.className="clickableState",e}static createContentElement(){const e=document.createElement("div");return e.id="connectButton",e.innerHTML="Click to start",e}constructor(e){super(e,m.createRootElement(),m.createContentElement()),this.rootElement.addEventListener("click",(()=>{this.activate()}))}}class u extends h$1{static createRootElement(){const e=document.createElement("div");return e.id="disconnectOverlay",e.className="clickableState",e}static createContentElement(){const e=document.createElement("div");return e.id="disconnectButton",e.innerHTML="Click To Restart",e}constructor(e){super(e,u.createRootElement(),u.createContentElement()),this.rootElement.addEventListener("click",(()=>{this.activate()}))}}class g extends h$1{static createRootElement(){const e=document.createElement("div");return e.id="playOverlay",e.className="clickableState",e}static createContentElement(){const e=document.createElement("img");return e.id="playButton",e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPEAAAD5CAYAAAD2mNNkAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAASgklEQVR4Xu2dC7BdVX2HqUCCIRASCPjAFIQREBRBBSRYbFOt8lIrFUWRFqXWsT5wbItUqFWs0KqIMPKoYEWpRS06KDjS1BeVFkVQbCw+wCfiAwGhCKWP9PuZtU24uTe59zz22Y/vm/nGkXtz7jlrr9+sdfZea/03Wb169QtxGW62iYi0D8L7NbwYj8EdcdPyIxFpA4T2P/F/8Ua8CI/GhPnXyq+ISJMhrAlxxX9hRuYL8Sh8SPk1EWkqBHXdEFfcg6vw3fhs3Kb8uog0DQI6XYgr8rOvYsJ8OM4v/0xEmkIJ6ob4P8zIfANegCvQMIs0BQK5sRBXJMy/wIzM5+ByXFBeRkQmBUGcbYjX5S5MmM/AA3CL8nIiUjcEcJAQV9yBX8a/wSeiz5hF6obgDRPikGfMCfOX8DTcu7y0iNQBoRs2xBX/g3diwvwm3Kn8CREZJ4RtVCGuqMKcu9kn4xJ09ZfIuCBgow5xyJ3sTLNzAywrwF6J26NhFhk1BGscIV6XhPluvA6Pxx3KnxaRUUCoxh3iioQ5z5n/BY/FJeUtiMgwEKa6QlyRMN+Hn8Hn4ZblrYjIIBCiukMc8p25Ws6ZMD+zvB0RmSsEaBIhnkrew5V4EHrCiMhcKAFqCv+Nl+J+uBC9my2yMQhKk0Jcke/M78Gsy06YH1TerohMhYA0McQVP8Nz8UDcCl2bLTIVgtHkEFd8D8/E/XFrdGQWqSAQbQhxyKOpm/B03Ac9MkgkEIa2hLgiN78S5lPx0bgIvQEm/YUAtC3EFQnzzfgnuDc6zZZ+Qsdva4jX5Sv4atwXHZmlX9DhuxDikC2Qn8dXYUbmReUjinQbOntXQlyRTRafwldgwrxV+agi3YRO3rUQV/wcV+LL8DHoyZzSTejcXQ1xRc7/uhyzl3kv3Lx8dJFuQKfueohDnjFnZP4o/j7m0ZQH4Es3oDP3IcQV2f6YMF+COZjgUeiZ2dJu6MR9CvG63ILvx4zMCfO80iQi7YLO29cQV3wb34spsr4rumBE2gWdtu8hDln99S1MXeYX4M6leUSaDx3WEK8lRdYT5lR/zPlfnswpzYeOaojXJ4cSfB3Pw+fgtug0W5oJndMQT0/uZGeaXZVyfTZuV5pNpDnQMQ3xxsk0O9Ufz8ZDcdvSfCKThw5piGdP2ioF496JT0c3WcjkKR1T5kYWjCTM78DfQheMyOSgAxriwch35lR/vAbPwOXozS+pHzqeIR6Oal12wvx2fBy6yULqgw5niEdDwpyR+VpMkfXsmHIpp4wfOpohHj234RfwFNwDnWbL+KCDGeLxkJH5p3g1vg53K00uMlroXIZ4vGTBSMJ8FeZkzmWl6UVGA53KENfD/ZiyNCmynvO/FpdLIDIcdCZDXC8ZmfOd+d/wJejZXzIcdCJDXD95xpwjdnP+V74zH4Wu/pLBoPMY4smSMN+FKbJ+BBpmmRt0GkPcDBLmu/FjeAi6lFNmB53FEDeHTLPzaCoj80dwBfqMWTYMncQQN5esAPsw7lcul8j60EEMcfPJDbD3YU7l3KxcOpE10CkMcTvIVDvfmc/E3XELtPqjGOKWkhVgp+GemDD7vbnP0AEMcXtJkfU34GNxAToy9xEuvCFuP6vwJMyOqYXl0kpf4KIb4m5QncyZTRapZGGY+wIX2xB3i3vxOswmi13QaXbX4QIb4m6SY3a/iMdh7mYb5q7ChTXE3aXaaLESq7rMW5ZLL12Bi2qI+8E9eDkmzLuhYe4KXExD3B8yMt+Ol+KL0CLrXYCLaIj7R8J8K16CR6PLOdsMF88Q95fsmPoRXozPxdzNdvVX2+CiGWLJza+EOXWZj8Sd0APw2wIXyxBLqPYy34LnY8K8DA1z0+EiGWKZSgJ9I74LU2R9R3Sa3VS4OIZYZqJaynkWpsj6w0u3kSbBhTHEsjHuwxswpVwPw6Wl+0gT4IIYYpkNmWKnr1yPqf54KG5VupFMknJhRGZLwpzVX6n++DZ8GrpjapJwAQyxDELCnB1TqWTx1/gUdGSeBDS8IZZBSZBjzv76PP4VHoSGuU5ocEMsoyBhTsG4VH98Ix6A80s3k3FCQxtiGSVZMPIT/CwmzPuhz5jHCQ1siGUcZClnwvxpPAX3LF1ORg2Na4hlXGSKnQUjCfNn8PX4CNy0dD8ZBTSoIZZxkzBXI/Pn8ATMumzDPApoSEMsdZEw5zvzDzHT7JdjwuzZX8NAAxpimQSZZifMn8Tj8aGlS8pcofEMsUyKjMw5lTOnjHwcc2TQktI1ZbbQaIZYJk3CnE0WGZmvwOeh+5hnC41liKUpVCNzwvwJPBy9+bUxaCRDLE0jYb4fU/0x0+yD8cGly8pUaBxDLE0kQa7CfCfmML8D0SN2p0KjGGJpOglztWgkh/k9CT1it4LGMMTSFhLmLBrJ3exzcJ/SjfsNDWGIpY0k0D/AM/GRpTv3ExrAEEubqVaAnY5LsX93s/nQhli6QLUF8nWYI3bnYT+Wc/JBDbF0heqO9jfwlfhInI/dDjMf0BBLF0mYr8NsskiNqS2wm2Hmgxli6TJ5zpwjg/4Qd8buLRrhQxli6QM5ZjdHBh2H+c7cnUUjfBhDLH0hU+y7cCU+H7OXeV6JQnvhQxhi6RsJc0bmy/BZ+MsbYCUS7YM3b4ilryTM2QL5QUzBuHxnbt80mzdtiEVWr74NL8KUck2R9faMzLxZQyyyhozMWcp5If4uJszNP5yAN2mIRR5IVn/djOfhEdjsw/x4c4ZYZHryjPkmPBsPwYeV2DQL3pghFpmZTLFzZFDCnLrMz8DtsTkbLXgzhlhk4yTM2cu8CrNjKiNzwjz5OlO8CUMsMjcS5qzLfgumyPr2JU6TgTdgiEUGoyqynrrMv42TOTObP2yIRQYn0+ws5bwaU8r1N3HrEq964A8aYpHhSZjvwBSMS5gPwnrWZfOHDLHI6Mgz5hyxm4Jxf4kH4HjDzB8wxCKjJ2HONPuf8c9xHxzPXmZe2BCLjIdMsWMqWfwTnoiPwdGOzLygIRYZPwlzVWPqtbgXjmbBCC9kiEXqI8+Ys8nicnwN7laiODi8iCEWqZeMylmXnTCnYFxO5tyxRHLu8I8NschkSJizLvv7mJH5pbgY57Zjin9giEUmSzUyfw9TZP1Y3LZEdOPwy4ZYpBkkzKn++B38KB6F25Wozgy/ZIhFmkXCnLO/vosfwpwysqhEdn34oSEWaSYJ8y8w0+wP4GG4/oIR/qMhFmk2VZgzzU6Ys2Nq7T5m/o8hFmkHCXO2PybMF+O++CBDLNIuEuSsy8535lvxZEMs0j6qWszZJbXUEIu0i1vwrZhqFZv5nVikPWTqfA5mF9QDD+fjPxhikeaR777xdrwAn1Aiuz780BCLNIvsdMqBAqkNtRw3XBeKXzDEIpMno27Cezdeik/GBSWmG4ZfNMQikyPhzXrpVGXM6R8rcG7lVfkHhlikfhLe7FzKo6KV+Hu45m7zXOEfGmKReske4oT3k3gMblniOBi8gCEWqYeMvD/GK/F43KHEcDh4IUMsMl5yw+pHmLOoX4aDH8UzHbygIRYZD/nem5H3KjwBd8LRV1HkRQ2xyGjJ3eacNZ1iayfhr+P46hnz4oZYZDRk2pzwph7TX+CuOP76xfwRQywyHNlVVIX3VHx8iVc98AcNscjgZJFGypq+GffHwZ71DgN/1BCLzJ2f47/iWzBlTId71jsM/HFDLDI7crf5HrwG34YHY70FxaeDN2GIRTZMwpvjcK7Fd+BTcfLhreDNGGKRmcnIez2+Ew/FhTi3MivjhjdkiEXWJ0fEfhXPwmfi4hKZ5sGbM8Qia8n65lX4LkzlhYeVqDQX3qQhFlnzrPc/8FzMtsBl2Kxp80zwRg2x9J0cxn4epoBZlkjW/6x3GHjDhlj6SJZI5gTJ9+DzMeHdvMSiXfDGDbH0iWpbYMqgJLy7YLtG3qnwAQyx9IVsC7wEX4C74/h2FtUJH8QQS9fJUTg5QfI43APnle7fDfhAhli6So5//Ri+GBPeya1vHid8MEMsXSMH0X0CX4J74cLS3bsJH9AQS1fITavs6f1VeLEdz3qHgQ9piKXtZHNC1jfnELpfTpux++Gt4MMaYmkrmTZ/GV+LCW+3p80zwQc3xNI2skTyBswhdHtic7YFTgIawBBLm7gRT8HH4dbYn2nzTNAIhljaQCrkvwkT3tywGv8pkm2BxjDE0lRyokbOsjoDUyE/N6wM71RoFEMsTSPhvRPfjY/GBei0eSZoHEMsTeJ2/ADug+3cVVQ3NJQhliaQkfcf8SnoqDsXaDBDLJMij4ruxcvwaejIOwg0nCGWusnyyIT3CjwM+7lIY1TQgIZY6iA3qzLyZmdRSn0eic09QbJN0JCGWMZJwpuR9w78Er4Qu7klcFLQoIZYxkXq9OZuc2oWZXNCv5dHjgsa1hDLqKnCm2qB2Zzw0NLdZBzQwIZYRkWmzT/DhPdE3KV0MxknNLQhlmHJ996ENwXHsjkhq6xcHlkXNLYhlkFJeHPDKhvyszkh4W338a9thEY3xDJX8qgoGxMS3tTpfSzOL11K6obGN8QyWxLeLI/MtDmlPvdHp82ThotgiGU2ZOStwrsCXSLZFLgYhlg2xF2Yc6zOxqejCzWaBhfFEMt0pMj2VzB1eg/BJaXLSNPg4hhiqcjd5izUSIX8lPp8Fi4tXUWaChfJEEtIhfwU2b4QU2R7O3RfbxvgQhnifpOD17+JCW9KfS5F7zi3CS6YIe4nOXj9W/h3eAw+vHQJaRtcPEPcL/Ks92a8CI/FXdFpc5vhAhri/vB9/Hv8A3wUukSyC3AhDXH3+Sn+Ax6PqZDvEskuwQU1xN2kOgonJ0im1Gc2J2xRLrt0CS6sIe4W1c6ij2NG3lROmFcut3QRLrAh7g4J75X4R7g3Gt4+wIU2xO0n0+ZP4aswBcdc39wnuOCGuL3kWe/n8DW4Ly4ql1X6BBfeELeTL+AJ+ATcBn3W21e4+Ia4PeSO89fwT/GJuAhdItl36ASGuPlkZ9G38fWYo3Ay8hpeWQOdwRA3lxwBexO+GVPq07Insj50DEPcTLK++e2Yc6wWo995ZXroHIa4WdyKOQpnOWbavGm5VCLTQycxxM0gp0iej0/G3LAyvDI76CyGeHJUx+G8Hw9Ewytzh05jiCdDDqK7HA/Aheh3XhkMOo8hrpe096fxd9D9vDI8pVPJ+LkXP4vPQafMMjroUIZ4fOQ7b9Y3X4U5x8oi2zJ66FiGePRkeWROkfwiHoee3Szjgw5miEdDRt14D+bw9ZfjDqWZRcYHHc0QD091FE6OgP0z9OB1qQ86myEenKxtTngz8r4BHXmlfuh4hnjuJLwp9Zlqgafh7qU5ReqHDmiIZ0+mzVkeeQO+FR9fmlFkctARDfHsSJ3ef8dqZ5GH0EkzoDMa4pnJ3ea0T07TOAezvnlBaTqRZlA6qTyQhDdrm1fhBXgwGl5pJnROQ7yW6jlvwvtefAZuXppKpJmUTitrp80p9Zn1zQ8uTSTSbOisfQ9xps2pkJ/wPhe3K00j0g7otH0N8f34dXwfHo0W2ZZ2QuftY4izPDKnabwIH4Ee/yrthQ7clxBnldUP8BJ8MSa87uuV9kNH7nqIc4ZVwvshfCkuQ8Mr3YEO3dUQZ4nkD/HDmFKfe5SPLNIt6NxdDHHC+xF8BabsiSOvdBc6eJdCfBtehglvimz7rFe6Dx29CyHOQo0r8NWYOr0W2Zb+QIdva4izRDLPeldi6vSm1OfC8rFE+gMdv40hznu+GlMhfz/cEj0OR/oJnb9NIc57vQZPxCehI69ICUbTydnN1+LJmPAuKW9fRAhEk0OcZ73XYw6hOwg9v1lkKgSjqSHO5oRT8TdwKbq+WWQ6CEeTQpw7zlmocTqmTm/Ob7bomMiGICRNCHGmzT/BszClPjPyuspKZDYQlkmH+Mf4t7gct0enzSJzgdBMKsQJ70X4VHTkFRkUwlN3iFM54YN4KG6LHkQnMgyEqK4Q51nvpZjwZuQ1vCKjgDDVEeIr8XBMeL3bLDJKCNW4QpyR9zo8ArdBb1iJjAPCNeoQJ7ypFngszkc3JoiME0I2qhDnWW8Kjv0xujFBpC4I3DAhzgqrHESXUp/Z0/uQ8rIiUhcEb5AQJ7z34TfwJNy5vJyI1A0BnG2IE9yYsiffwTfizuh3XpFJQghnE+J83014v4upkL8r+qhIpAkQxg2FOOHNzzNtPhf3REdekSZRQjqVTJtzguSNeD4eWH5dRJoGAZ0a4rvxm3ghrkCnzSJNhpBWIc7/plpgwpudRZ7dLNIGCOvtJbwX42G4uPxIRNoAoU2d3iNxUflPItIaNtnk/wEGBoMdpECGHAAAAABJRU5ErkJggg==",e.alt="Start Streaming",e}constructor(e){super(e,g.createRootElement(),g.createContentElement()),this.rootElement.addEventListener("click",(()=>{this.activate()}))}}class p extends d{constructor(e,t,r){super(e,t,r)}update(e){null==e&&null==e||(this.textElement.innerHTML=e)}}class E extends p{static createRootElement(){const e=document.createElement("div");return e.id="infoOverlay",e.className="textDisplayState",e}static createContentElement(){const e=document.createElement("div");return e.id="messageOverlayInner",e}constructor(e){super(e,E.createRootElement(),E.createContentElement())}}class v$1 extends p{static createRootElement(){const e=document.createElement("div");return e.id="errorOverlay",e.className="textDisplayState",e}static createContentElement(){const e=document.createElement("div");return e.id="errorOverlayInner",e}constructor(e){super(e,v$1.createRootElement(),v$1.createContentElement())}}class b extends h$1{static createRootElement(){const e=document.createElement("div");return e.id="afkOverlay",e.className="clickableState",e}static createContentElement(){const e=document.createElement("div");return e.id="afkOverlayInner",e.innerHTML='<center>No activity detected<br>Disconnecting in <span id="afkCountDownNumber"></span> seconds<br>Click to continue<br></center>',e}constructor(e){super(e,b.createRootElement(),b.createContentElement()),this.rootElement.addEventListener("click",(()=>{this.activate()}))}updateCountdown(e){this.textElement.innerHTML=`<center>No activity detected<br>Disconnecting in <span id="afkCountDownNumber">${e}</span> seconds<br>Click to continue<br></center>`}}class f{get rootElement(){return this._rootElement}set rootElement(e){e.onclick=()=>this.toggleFullscreen(),this._rootElement=e}constructor(){this.isFullscreen=!1,document.addEventListener("webkitfullscreenchange",(()=>this.onFullscreenChange()),!1),document.addEventListener("mozfullscreenchange",(()=>this.onFullscreenChange()),!1),document.addEventListener("fullscreenchange",(()=>this.onFullscreenChange()),!1),document.addEventListener("MSFullscreenChange",(()=>this.onFullscreenChange()),!1)}toggleFullscreen(){if(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen();else{const e=this.fullscreenElement;if(!e)return;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullscreen?e.mozRequestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitEnterFullscreen&&e.webkitEnterFullscreen()}this.onFullscreenChange()}onFullscreenChange(){this.isFullscreen=document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement&&null!==document.msFullscreenElement||document.fullscreenElement&&null!==document.fullscreenElement}}class y extends f{constructor(e){super(),this.rootElement=e}}class x extends f{constructor(){super();const e=document.createElement("button");e.type="button",e.classList.add("UiTool"),e.id="fullscreen-btn",e.appendChild(this.maximizeIcon),e.appendChild(this.minimizeIcon),e.appendChild(this.tooltipText),this.rootElement=e}get tooltipText(){return this._tooltipText||(this._tooltipText=document.createElement("span"),this._tooltipText.classList.add("tooltiptext"),this._tooltipText.innerHTML="Fullscreen"),this._tooltipText}get maximizeIcon(){if(!this._maximizeIcon){this._maximizeIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._maximizeIcon.setAttributeNS(null,"id","maximizeIcon"),this._maximizeIcon.setAttributeNS(null,"x","0px"),this._maximizeIcon.setAttributeNS(null,"y","0px"),this._maximizeIcon.setAttributeNS(null,"viewBox","0 0 384.97 384.97");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._maximizeIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M384.97,12.03c0-6.713-5.317-12.03-12.03-12.03H264.847c-6.833,0-11.922,5.39-11.934,12.223c0,6.821,5.101,11.838,11.934,11.838h96.062l-0.193,96.519c0,6.833,5.197,12.03,12.03,12.03c6.833-0.012,12.03-5.197,12.03-12.03l0.193-108.369c0-0.036-0.012-0.06-0.012-0.084C384.958,12.09,384.97,12.066,384.97,12.03z");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M120.496,0H12.403c-0.036,0-0.06,0.012-0.096,0.012C12.283,0.012,12.247,0,12.223,0C5.51,0,0.192,5.317,0.192,12.03L0,120.399c0,6.833,5.39,11.934,12.223,11.934c6.821,0,11.838-5.101,11.838-11.934l0.192-96.339h96.242c6.833,0,12.03-5.197,12.03-12.03C132.514,5.197,127.317,0,120.496,0z");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M120.123,360.909H24.061v-96.242c0-6.833-5.197-12.03-12.03-12.03S0,257.833,0,264.667v108.092c0,0.036,0.012,0.06,0.012,0.084c0,0.036-0.012,0.06-0.012,0.096c0,6.713,5.317,12.03,12.03,12.03h108.092c6.833,0,11.922-5.39,11.934-12.223C132.057,365.926,126.956,360.909,120.123,360.909z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M372.747,252.913c-6.833,0-11.85,5.101-11.838,11.934v96.062h-96.242c-6.833,0-12.03,5.197-12.03,12.03s5.197,12.03,12.03,12.03h108.092c0.036,0,0.06-0.012,0.084-0.012c0.036-0.012,0.06,0.012,0.096,0.012c6.713,0,12.03-5.317,12.03-12.03V264.847C384.97,258.014,379.58,252.913,372.747,252.913z"),e.appendChild(t),e.appendChild(r),e.appendChild(n),e.appendChild(i)}return this._maximizeIcon}get minimizeIcon(){if(!this._minimizeIcon){this._minimizeIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._minimizeIcon.setAttributeNS(null,"id","minimizeIcon"),this._minimizeIcon.setAttributeNS(null,"x","0px"),this._minimizeIcon.setAttributeNS(null,"y","0px"),this._minimizeIcon.setAttributeNS(null,"viewBox","0 0 385.331 385.331");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._minimizeIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M264.943,156.665h108.273c6.833,0,11.934-5.39,11.934-12.211c0-6.833-5.101-11.85-11.934-11.838h-96.242V36.181c0-6.833-5.197-12.03-12.03-12.03s-12.03,5.197-12.03,12.03v108.273c0,0.036,0.012,0.06,0.012,0.084c0,0.036-0.012,0.06-0.012,0.096C252.913,151.347,258.23,156.677,264.943,156.665z");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M120.291,24.247c-6.821,0-11.838,5.113-11.838,11.934v96.242H12.03c-6.833,0-12.03,5.197-12.03,12.03c0,6.833,5.197,12.03,12.03,12.03h108.273c0.036,0,0.06-0.012,0.084-0.012c0.036,0,0.06,0.012,0.096,0.012c6.713,0,12.03-5.317,12.03-12.03V36.181C132.514,29.36,127.124,24.259,120.291,24.247z");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M120.387,228.666H12.115c-6.833,0.012-11.934,5.39-11.934,12.223c0,6.833,5.101,11.85,11.934,11.838h96.242v96.423c0,6.833,5.197,12.03,12.03,12.03c6.833,0,12.03-5.197,12.03-12.03V240.877c0-0.036-0.012-0.06-0.012-0.084c0-0.036,0.012-0.06,0.012-0.096C132.418,233.983,127.1,228.666,120.387,228.666z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M373.3,228.666H265.028c-0.036,0-0.06,0.012-0.084,0.012c-0.036,0-0.06-0.012-0.096-0.012c-6.713,0-12.03,5.317-12.03,12.03v108.273c0,6.833,5.39,11.922,12.223,11.934c6.821,0.012,11.838-5.101,11.838-11.922v-96.242H373.3c6.833,0,12.03-5.197,12.03-12.03S380.134,228.678,373.3,228.666z"),e.appendChild(t),e.appendChild(r),e.appendChild(n),e.appendChild(i)}return this._minimizeIcon}onFullscreenChange(){super.onFullscreenChange();const e=this.minimizeIcon,t=this.maximizeIcon;this.isFullscreen?(e.style.display="inline",e.style.transform="translate(0, 0)",t.style.display="none"):(e.style.display="none",t.style.display="inline",t.style.transform="translate(0, 0)")}}class C{get rootElement(){return this._rootElement||(this._rootElement=document.createElement("button"),this._rootElement.type="button",this._rootElement.classList.add("UiTool"),this._rootElement.id="settingsBtn",this._rootElement.appendChild(this.settingsIcon),this._rootElement.appendChild(this.tooltipText)),this._rootElement}get tooltipText(){return this._tooltipText||(this._tooltipText=document.createElement("span"),this._tooltipText.classList.add("tooltiptext"),this._tooltipText.innerHTML="Settings"),this._tooltipText}get settingsIcon(){if(!this._settingsIcon){this._settingsIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._settingsIcon.setAttributeNS(null,"id","settingsIcon"),this._settingsIcon.setAttributeNS(null,"x","0px"),this._settingsIcon.setAttributeNS(null,"y","0px"),this._settingsIcon.setAttributeNS(null,"viewBox","0 0 478.703 478.703");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._settingsIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M454.2,189.101l-33.6-5.7c-3.5-11.3-8-22.2-13.5-32.6l19.8-27.7c8.4-11.8,7.1-27.9-3.2-38.1l-29.8-29.8\t\t\tc-5.6-5.6-13-8.7-20.9-8.7c-6.2,0-12.1,1.9-17.1,5.5l-27.8,19.8c-10.8-5.7-22.1-10.4-33.8-13.9l-5.6-33.2\t\t\tc-2.4-14.3-14.7-24.7-29.2-24.7h-42.1c-14.5,0-26.8,10.4-29.2,24.7l-5.8,34c-11.2,3.5-22.1,8.1-32.5,13.7l-27.5-19.8\t\t\tc-5-3.6-11-5.5-17.2-5.5c-7.9,0-15.4,3.1-20.9,8.7l-29.9,29.8c-10.2,10.2-11.6,26.3-3.2,38.1l20,28.1\t\t\tc-5.5,10.5-9.9,21.4-13.3,32.7l-33.2,5.6c-14.3,2.4-24.7,14.7-24.7,29.2v42.1c0,14.5,10.4,26.8,24.7,29.2l34,5.8\t\t\tc3.5,11.2,8.1,22.1,13.7,32.5l-19.7,27.4c-8.4,11.8-7.1,27.9,3.2,38.1l29.8,29.8c5.6,5.6,13,8.7,20.9,8.7c6.2,0,12.1-1.9,17.1-5.5\t\t\tl28.1-20c10.1,5.3,20.7,9.6,31.6,13l5.6,33.6c2.4,14.3,14.7,24.7,29.2,24.7h42.2c14.5,0,26.8-10.4,29.2-24.7l5.7-33.6\t\t\tc11.3-3.5,22.2-8,32.6-13.5l27.7,19.8c5,3.6,11,5.5,17.2,5.5l0,0c7.9,0,15.3-3.1,20.9-8.7l29.8-29.8c10.2-10.2,11.6-26.3,3.2-38.1\t\t\tl-19.8-27.8c5.5-10.5,10.1-21.4,13.5-32.6l33.6-5.6c14.3-2.4,24.7-14.7,24.7-29.2v-42.1\t\t\tC478.9,203.801,468.5,191.501,454.2,189.101z M451.9,260.401c0,1.3-0.9,2.4-2.2,2.6l-42,7c-5.3,0.9-9.5,4.8-10.8,9.9\t\t\tc-3.8,14.7-9.6,28.8-17.4,41.9c-2.7,4.6-2.5,10.3,0.6,14.7l24.7,34.8c0.7,1,0.6,2.5-0.3,3.4l-29.8,29.8c-0.7,0.7-1.4,0.8-1.9,0.8\t\t\tc-0.6,0-1.1-0.2-1.5-0.5l-34.7-24.7c-4.3-3.1-10.1-3.3-14.7-0.6c-13.1,7.8-27.2,13.6-41.9,17.4c-5.2,1.3-9.1,5.6-9.9,10.8l-7.1,42\t\t\tc-0.2,1.3-1.3,2.2-2.6,2.2h-42.1c-1.3,0-2.4-0.9-2.6-2.2l-7-42c-0.9-5.3-4.8-9.5-9.9-10.8c-14.3-3.7-28.1-9.4-41-16.8\t\t\tc-2.1-1.2-4.5-1.8-6.8-1.8c-2.7,0-5.5,0.8-7.8,2.5l-35,24.9c-0.5,0.3-1,0.5-1.5,0.5c-0.4,0-1.2-0.1-1.9-0.8l-29.8-29.8\t\t\tc-0.9-0.9-1-2.3-0.3-3.4l24.6-34.5c3.1-4.4,3.3-10.2,0.6-14.8c-7.8-13-13.8-27.1-17.6-41.8c-1.4-5.1-5.6-9-10.8-9.9l-42.3-7.2\t\t\tc-1.3-0.2-2.2-1.3-2.2-2.6v-42.1c0-1.3,0.9-2.4,2.2-2.6l41.7-7c5.3-0.9,9.6-4.8,10.9-10c3.7-14.7,9.4-28.9,17.1-42\t\t\tc2.7-4.6,2.4-10.3-0.7-14.6l-24.9-35c-0.7-1-0.6-2.5,0.3-3.4l29.8-29.8c0.7-0.7,1.4-0.8,1.9-0.8c0.6,0,1.1,0.2,1.5,0.5l34.5,24.6\t\t\tc4.4,3.1,10.2,3.3,14.8,0.6c13-7.8,27.1-13.8,41.8-17.6c5.1-1.4,9-5.6,9.9-10.8l7.2-42.3c0.2-1.3,1.3-2.2,2.6-2.2h42.1\t\t\tc1.3,0,2.4,0.9,2.6,2.2l7,41.7c0.9,5.3,4.8,9.6,10,10.9c15.1,3.8,29.5,9.7,42.9,17.6c4.6,2.7,10.3,2.5,14.7-0.6l34.5-24.8\t\t\tc0.5-0.3,1-0.5,1.5-0.5c0.4,0,1.2,0.1,1.9,0.8l29.8,29.8c0.9,0.9,1,2.3,0.3,3.4l-24.7,34.7c-3.1,4.3-3.3,10.1-0.6,14.7\t\t\tc7.8,13.1,13.6,27.2,17.4,41.9c1.3,5.2,5.6,9.1,10.8,9.9l42,7.1c1.3,0.2,2.2,1.3,2.2,2.6v42.1H451.9z");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M239.4,136.001c-57,0-103.3,46.3-103.3,103.3s46.3,103.3,103.3,103.3s103.3-46.3,103.3-103.3S296.4,136.001,239.4,136.001z M239.4,315.601c-42.1,0-76.3-34.2-76.3-76.3s34.2-76.3,76.3-76.3s76.3,34.2,76.3,76.3S281.5,315.601,239.4,315.601z"),e.appendChild(t),e.appendChild(r)}return this._settingsIcon}}class S{get rootElement(){return this._rootElement||(this._rootElement=document.createElement("button"),this._rootElement.type="button",this._rootElement.classList.add("UiTool"),this._rootElement.id="statsBtn",this._rootElement.appendChild(this.statsIcon),this._rootElement.appendChild(this.tooltipText)),this._rootElement}get tooltipText(){return this._tooltipText||(this._tooltipText=document.createElement("span"),this._tooltipText.classList.add("tooltiptext"),this._tooltipText.innerHTML="Information"),this._tooltipText}get statsIcon(){if(!this._statsIcon){this._statsIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._statsIcon.setAttributeNS(null,"id","statsIcon"),this._statsIcon.setAttributeNS(null,"x","0px"),this._statsIcon.setAttributeNS(null,"y","0px"),this._statsIcon.setAttributeNS(null,"viewBox","0 0 330 330");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._statsIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M165,0.008C74.019,0.008,0,74.024,0,164.999c0,90.977,74.019,164.992,165,164.992s165-74.015,165-164.992C330,74.024,255.981,0.008,165,0.008z M165,299.992c-74.439,0-135-60.557-135-134.992S90.561,30.008,165,30.008s135,60.557,135,134.991C300,239.436,239.439,299.992,165,299.992z");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M165,130.008c-8.284,0-15,6.716-15,15v99.983c0,8.284,6.716,15,15,15s15-6.716,15-15v-99.983C180,136.725,173.284,130.008,165,130.008z");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M165,70.011c-3.95,0-7.811,1.6-10.61,4.39c-2.79,2.79-4.39,6.66-4.39,10.61s1.6,7.81,4.39,10.61c2.79,2.79,6.66,4.39,10.61,4.39s7.81-1.6,10.609-4.39c2.79-2.8,4.391-6.66,4.391-10.61s-1.601-7.82-4.391-10.61C172.81,71.61,168.95,70.011,165,70.011z"),e.appendChild(t),e.appendChild(r),e.appendChild(n)}return this._statsIcon}}class w$1{get rootElement(){return this._rootElement||(this._rootElement=document.createElement("button"),this._rootElement.type="button",this._rootElement.classList.add("UiTool"),this._rootElement.id="xrBtn",this._rootElement.appendChild(this.xrIcon),this._rootElement.appendChild(this.tooltipText)),this._rootElement}get tooltipText(){return this._tooltipText||(this._tooltipText=document.createElement("span"),this._tooltipText.classList.add("tooltiptext"),this._tooltipText.innerHTML="XR"),this._tooltipText}get xrIcon(){if(!this._xrIcon){this._xrIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._xrIcon.setAttributeNS(null,"id","xrIcon"),this._xrIcon.setAttributeNS(null,"x","0px"),this._xrIcon.setAttributeNS(null,"y","0px"),this._xrIcon.setAttributeNS(null,"viewBox","0 0 100 100");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._xrIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M29 41c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zm42-14c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zm12-31H17c-6.6 0-12 5.4-12 12v28c0 6.6 5.4 12 12 12h14.5c3.5 0 6.8-1.5 9-4.1l3.5-4c1.5-1.7 3.7-2.7 6-2.7s4.5 1 6 2.7l3.5 4c2.3 2.6 5.6 4.1 9 4.1H83c6.6 0 12-5.4 12-12V36c0-6.6-5.4-12-12-12zm8 40c0 4.4-3.6 8-8 8H68.5c-2.3 0-4.5-1-6-2.7l-3.5-4c-2.3-2.6-5.6-4.1-9-4.1-3.5 0-6.8 1.5-9 4.1l-3.5 4C36 71 33.8 72 31.5 72H17c-4.4 0-8-3.6-8-8V36c0-4.4 3.6-8 8-8h66c4.4 0 8 3.6 8 8v28z"),e.appendChild(t)}return this._xrIcon}}function T(e){return!e||!!e&&e.isEnabled}function _(e){return null==e||e.creationMode===c.CreateDefaultElement}!function(e){e[e.CreateDefaultElement=0]="CreateDefaultElement",e[e.UseCustomElement=1]="UseCustomElement",e[e.Disable=2]="Disable"}(c||(c={}));class L{constructor(e){e&&!_(e.statsButtonType)||(this.statsIcon=new S),e&&!_(e.fullscreenButtonType)||(this.settingsIcon=new C),e&&!_(e.settingsButtonType)||(this.fullscreenIcon=new x),e&&!_(e.xrIconType)||(this.xrIcon=new w$1)}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div"),this._rootElement.id="controls",this.fullscreenIcon&&this._rootElement.appendChild(this.fullscreenIcon.rootElement),this.settingsIcon&&this._rootElement.appendChild(this.settingsIcon.rootElement),this.statsIcon&&this._rootElement.appendChild(this.statsIcon.rootElement),this.xrIcon&&l.WebXRController.isSessionSupported("immersive-vr").then((e=>{e&&this._rootElement.appendChild(this.xrIcon.rootElement)}))),this._rootElement}}class I{constructor(e,t){this._label=e,this._buttonText=t}addOnClickListener(e){this.button.addEventListener("click",e)}get button(){return this._button||(this._button=document.createElement("input"),this._button.type="button",this._button.value=this._buttonText,this._button.classList.add("overlay-button"),this._button.classList.add("btn-flat")),this._button}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.classList.add("setting");const e=document.createElement("div");e.innerText=this._label,this._rootElement.appendChild(e);const t=document.createElement("label");t.classList.add("btn-overlay"),this._rootElement.appendChild(t),t.appendChild(this.button)}return this._rootElement}}class k{constructor(){this._rootElement=null}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id="settings-panel",this._rootElement.classList.add("panel-wrap");const e=document.createElement("div");e.classList.add("panel"),this._rootElement.appendChild(e);const t=document.createElement("div");t.id="settingsHeading",t.textContent="Settings",e.appendChild(t),e.appendChild(this.settingsCloseButton),e.appendChild(this.settingsContentElement)}return this._rootElement}get settingsContentElement(){return this._settingsContentElement||(this._settingsContentElement=document.createElement("div"),this._settingsContentElement.id="settingsContent"),this._settingsContentElement}get settingsCloseButton(){return this._settingsCloseButton||(this._settingsCloseButton=document.createElement("div"),this._settingsCloseButton.id="settingsClose"),this._settingsCloseButton}show(){this.rootElement.classList.contains("panel-wrap-visible")||this.rootElement.classList.add("panel-wrap-visible")}toggleVisibility(){this.rootElement.classList.toggle("panel-wrap-visible")}hide(){this.rootElement.classList.contains("panel-wrap-visible")&&this.rootElement.classList.remove("panel-wrap-visible")}}class F{get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("section"),this._rootElement.classList.add("settingsContainer");const e=document.createElement("div");e.id="latencyTestHeader",e.classList.add("settings-text"),e.classList.add("settingsHeader"),this._rootElement.appendChild(e);const t=document.createElement("div");t.innerHTML="Latency Test",e.appendChild(t),e.appendChild(this.latencyTestButton);const r=document.createElement("div");r.id="latencyTestContainer",r.classList.add("d-none"),this._rootElement.appendChild(r),r.appendChild(this.latencyTestResultsElement)}return this._rootElement}get latencyTestResultsElement(){return this._latencyTestResultsElement||(this._latencyTestResultsElement=document.createElement("div"),this._latencyTestResultsElement.id="latencyStatsResults",this._latencyTestResultsElement.classList.add("StatsResult")),this._latencyTestResultsElement}get latencyTestButton(){return this._latencyTestButton||(this._latencyTestButton=document.createElement("input"),this._latencyTestButton.type="button",this._latencyTestButton.value="Run Test",this._latencyTestButton.id="btn-start-latency-test",this._latencyTestButton.classList.add("streamTools-button"),this._latencyTestButton.classList.add("btn-flat")),this._latencyTestButton}handleTestResult(e){l.Logger.Log(l.Logger.GetStackTrace(),e.toString(),6);let t="";t+="<div>Net latency RTT (ms): "+e.networkLatency+"</div>",t+="<div>UE Encode (ms): "+e.EncodeMs+"</div>",t+="<div>UE Capture (ms): "+e.CaptureToSendMs+"</div>",t+="<div>Browser send latency (ms): "+e.browserSendLatency+"</div>",t+=e.frameDisplayDeltaTimeMs&&e.browserReceiptTimeMs?"<div>Browser receive latency (ms): "+e.frameDisplayDeltaTimeMs+"</div>":"",t+="<div>Total latency (excluding browser) (ms): "+e.latencyExcludingDecode+"</div>",t+=e.endToEndLatency?"<div>Total latency (ms): "+e.endToEndLatency+"</div>":"",this.latencyTestResultsElement.innerHTML=t}}class P{static formatBytes(e,t){if(0===e)return"0";const r=t<0?0:t,n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"][n]}}class A{}class O{constructor(){this.statsMap=new Map,this.latencyTest=new F}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id="stats-panel",this._rootElement.classList.add("panel-wrap");const e=document.createElement("div");e.classList.add("panel"),this._rootElement.appendChild(e);const t=document.createElement("div");t.id="statsHeading",t.textContent="Information",e.appendChild(t),e.appendChild(this.statsCloseButton),e.appendChild(this.statsContentElement)}return this._rootElement}get statsContentElement(){if(!this._statsContentElement){this._statsContentElement=document.createElement("div"),this._statsContentElement.id="statsContent";const e=document.createElement("div");e.id="streamToolsStats",e.classList.add("container");const t=document.createElement("div");t.id="ControlStats",t.classList.add("row");const r=document.createElement("section");r.id="statistics",r.classList.add("settingsContainer");const n=document.createElement("div");n.id="statisticsHeader",n.classList.add("settings-text"),n.classList.add("settingsHeader");const i=document.createElement("div");i.innerHTML="Session Stats",this._statsContentElement.appendChild(e),e.appendChild(t),t.appendChild(r),r.appendChild(n),n.appendChild(i),r.appendChild(this.statisticsContainer),t.appendChild(this.latencyTest.rootElement)}return this._statsContentElement}get statisticsContainer(){return this._statisticsContainer||(this._statisticsContainer=document.createElement("div"),this._statisticsContainer.id="statisticsContainer",this._statisticsContainer.classList.add("d-none"),this._statisticsContainer.appendChild(this.statsResult)),this._statisticsContainer}get statsResult(){return this._statsResult||(this._statsResult=document.createElement("div"),this._statsResult.id="statisticsResult",this._statsResult.classList.add("StatsResult")),this._statsResult}get statsCloseButton(){return this._statsCloseButton||(this._statsCloseButton=document.createElement("div"),this._statsCloseButton.id="statsClose"),this._statsCloseButton}show(){this.rootElement.classList.contains("panel-wrap-visible")||this.rootElement.classList.add("panel-wrap-visible")}toggleVisibility(){this.rootElement.classList.toggle("panel-wrap-visible")}hide(){this.rootElement.classList.contains("panel-wrap-visible")&&this.rootElement.classList.remove("panel-wrap-visible")}handleStats(e){var t,r,n,i,s;const a=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0}),o=P.formatBytes(e.inboundVideoStats.bytesReceived,2);this.addOrUpdateStat("InboundDataStat","Received",o);const c=Object.prototype.hasOwnProperty.call(e.inboundVideoStats,"packetsLost")?a.format(e.inboundVideoStats.packetsLost):"Chrome only";this.addOrUpdateStat("PacketsLostStat","Packets Lost",c),e.inboundVideoStats.bitrate&&this.addOrUpdateStat("VideoBitrateStat","Video Bitrate (kbps)",e.inboundVideoStats.bitrate.toString()),e.inboundAudioStats.bitrate&&this.addOrUpdateStat("AudioBitrateStat","Audio Bitrate (kbps)",e.inboundAudioStats.bitrate.toString());const h=Object.prototype.hasOwnProperty.call(e.inboundVideoStats,"frameWidth")&&e.inboundVideoStats.frameWidth&&Object.prototype.hasOwnProperty.call(e.inboundVideoStats,"frameHeight")&&e.inboundVideoStats.frameHeight?e.inboundVideoStats.frameWidth+"x"+e.inboundVideoStats.frameHeight:"Chrome only";this.addOrUpdateStat("VideoResStat","Video resolution",h);const d=Object.prototype.hasOwnProperty.call(e.inboundVideoStats,"framesDecoded")?a.format(e.inboundVideoStats.framesDecoded):"Chrome only";this.addOrUpdateStat("FramesDecodedStat","Frames Decoded",d),e.inboundVideoStats.framesPerSecond&&this.addOrUpdateStat("FramerateStat","Framerate",e.inboundVideoStats.framesPerSecond.toString()),this.addOrUpdateStat("FramesDroppedStat","Frames dropped",null===(t=e.inboundVideoStats.framesDropped)||void 0===t?void 0:t.toString()),e.inboundVideoStats.codecId&&this.addOrUpdateStat("VideoCodecStat","Video codec",null!==(n=null===(r=e.codecs.get(e.inboundVideoStats.codecId))||void 0===r?void 0:r.split(" ")[0])&&void 0!==n?n:""),e.inboundAudioStats.codecId&&this.addOrUpdateStat("AudioCodecStat","Audio codec",null!==(s=null===(i=e.codecs.get(e.inboundAudioStats.codecId))||void 0===i?void 0:i.split(" ")[0])&&void 0!==s?s:"");const u=Object.prototype.hasOwnProperty.call(e.candidatePair,"currentRoundTripTime")&&e.isNumber(e.candidatePair.currentRoundTripTime)?a.format(1e3*e.candidatePair.currentRoundTripTime):"Can't calculate";this.addOrUpdateStat("RTTStat","Net RTT (ms)",u),this.addOrUpdateStat("DurationStat","Duration",e.sessionStats.runTime),this.addOrUpdateStat("ControlsInputStat","Controls stream input",e.sessionStats.controlsStreamInput),this.addOrUpdateStat("QPStat","Video quantization parameter",e.sessionStats.videoEncoderAvgQP.toString()),l.Logger.Log(l.Logger.GetStackTrace(),`--------- Stats ---------\n ${e}\n------------------------`,6)}addOrUpdateStat(e,t,r){const n=`${t}: ${r}`;if(this.statsMap.has(e)){const t=this.statsMap.get(e);void 0!==t&&(t.element.innerHTML=n)}else{const i=new A;i.id=e,i.stat=r,i.title=t,i.element=document.createElement("div"),i.element.innerHTML=n,this.statsResult.appendChild(i.element),this.statsMap.set(e,i)}}}class M{constructor(){this.videoEncoderAvgQP=-1,this.statsText="",this.color="",this.orangeQP=26,this.redQP=35}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div"),this._rootElement.id="connection",this._rootElement.classList.add("UiTool"),this._rootElement.appendChild(this.qualityStatus),this._rootElement.appendChild(this.qualityText),this.updateQpTooltip(-1)),this._rootElement}get qualityText(){return this._qualityText||(this._qualityText=document.createElement("span"),this._qualityText.id="qualityText",this._qualityText.classList.add("tooltiptext")),this._qualityText}get qualityStatus(){return this._qualityStatus||(this._qualityStatus=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._qualityStatus.setAttributeNS(null,"id","connectionStrength"),this._qualityStatus.setAttributeNS(null,"x","0px"),this._qualityStatus.setAttributeNS(null,"y","0px"),this._qualityStatus.setAttributeNS(null,"viewBox","0 0 494.45 494.45"),this.qualityStatus.appendChild(this.dot),this.qualityStatus.appendChild(this.middle),this.qualityStatus.appendChild(this.outer),this.qualityStatus.appendChild(this.inner)),this._qualityStatus}get dot(){return this._dot||(this._dot=document.createElementNS("http://www.w3.org/2000/svg","circle"),this._dot.setAttributeNS(null,"id","dot"),this._dot.setAttributeNS(null,"cx","247.125"),this._dot.setAttributeNS(null,"cy","398.925"),this._dot.setAttributeNS(null,"r","35.3")),this._dot}get outer(){return this._outer||(this._outer=document.createElementNS("http://www.w3.org/2000/svg","path"),this._outer.setAttributeNS(null,"id","outer"),this._outer.setAttributeNS(null,"d","M467.925,204.625c-6.8,0-13.5-2.6-18.7-7.8c-111.5-111.4-292.7-111.4-404.1,0c-10.3,10.3-27.1,10.3-37.4,0s-10.3-27.1,0-37.4c64-64,149-99.2,239.5-99.2s175.5,35.2,239.5,99.2c10.3,10.3,10.3,27.1,0,37.4C481.425,202.025,474.625,204.625,467.925,204.625z")),this._outer}get middle(){return this._middle||(this._middle=document.createElementNS("http://www.w3.org/2000/svg","path"),this._middle.setAttributeNS(null,"id","middle"),this._middle.setAttributeNS(null,"d","M395.225,277.325c-6.8,0-13.5-2.6-18.7-7.8c-71.4-71.3-187.4-71.3-258.8,0c-10.3,10.3-27.1,10.3-37.4,0s-10.3-27.1,0-37.4c92-92,241.6-92,333.6,0c10.3,10.3,10.3,27.1,0,37.4C408.725,274.725,401.925,277.325,395.225,277.325z")),this._middle}get inner(){return this._inner||(this._inner=document.createElementNS("http://www.w3.org/2000/svg","path"),this._inner.setAttributeNS(null,"id","inner"),this._inner.setAttributeNS(null,"d","M323.625,348.825c-6.8,0-13.5-2.6-18.7-7.8c-15.4-15.4-36-23.9-57.8-23.9s-42.4,8.5-57.8,23.9c-10.3,10.3-27.1,10.3-37.4,0c-10.3-10.3-10.3-27.1,0-37.4c25.4-25.4,59.2-39.4,95.2-39.4s69.8,14,95.2,39.5c10.3,10.3,10.3,27.1,0,37.4C337.225,346.225,330.425,348.825,323.625,348.825z")),this._inner}blinkVideoQualityStatus(e){let t=e,r=1;const n=setInterval((()=>{r-=.1,this.qualityText.style.opacity=String(Math.abs(2*(r-.5))),r<=.1&&(0==--t?clearInterval(n):r=1)}),100/e)}updateQpTooltip(e){this.videoEncoderAvgQP=e,e>this.redQP?(this.color="red",this.blinkVideoQualityStatus(2),this.statsText=`<div style="color: ${this.color}">Poor encoding quality</div>`,this.outer.setAttributeNS(null,"fill","#3c3b40"),this.middle.setAttributeNS(null,"fill","#3c3b40"),this.inner.setAttributeNS(null,"fill",this.color),this.dot.setAttributeNS(null,"fill",this.color)):e>this.orangeQP?(this.color="orange",this.blinkVideoQualityStatus(1),this.statsText=`<div style="color: ${this.color}">Blocky encoding quality</div>`,this.outer.setAttributeNS(null,"fill","#3c3b40"),this.middle.setAttributeNS(null,"fill",this.color),this.inner.setAttributeNS(null,"fill",this.color),this.dot.setAttributeNS(null,"fill",this.color)):e<=0?(this.color="#b0b0b0",this.outer.setAttributeNS(null,"fill","#3c3b40"),this.middle.setAttributeNS(null,"fill","#3c3b40"),this.inner.setAttributeNS(null,"fill","#3c3b40"),this.dot.setAttributeNS(null,"fill","#3c3b40"),this.statsText=`<div style="color: ${this.color}">Not connected</div>`):(this.color="lime",this.qualityStatus.style.opacity="1",this.statsText=`<div style="color: ${this.color}">Clear encoding quality</div>`,this.outer.setAttributeNS(null,"fill",this.color),this.middle.setAttributeNS(null,"fill",this.color),this.inner.setAttributeNS(null,"fill",this.color),this.dot.setAttributeNS(null,"fill",this.color)),this.qualityText.innerHTML=this.statsText}}class N{constructor(e){this._setting=e}get setting(){return this._setting}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div")),this._rootElement}}class R extends N{constructor(e){super(e),this.label=e.label,this.flag=e.flag}get setting(){return this._setting}get settingsTextElem(){return this._settingsTextElem||(this._settingsTextElem=document.createElement("div"),this._settingsTextElem.innerText=this.setting._label,this._settingsTextElem.title=this.setting.description),this._settingsTextElem}get checkbox(){return this._checkbox||(this._checkbox=document.createElement("input"),this._checkbox.type="checkbox"),this._checkbox}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id=this.setting.id,this._rootElement.classList.add("setting"),this._rootElement.appendChild(this.settingsTextElem);const e=document.createElement("label");e.classList.add("tgl-switch"),this._rootElement.appendChild(e),this.checkbox.title=this.setting.description,this.checkbox.classList.add("tgl"),this.checkbox.classList.add("tgl-flat");const t=document.createElement("div");t.classList.add("tgl-slider"),e.appendChild(this.checkbox),e.appendChild(t),this.checkbox.addEventListener("change",(()=>{this.setting.flag!==this.checkbox.checked&&(this.setting.flag=this.checkbox.checked,this.setting.updateURLParams())}))}return this._rootElement}set flag(e){this.checkbox.checked=e}get flag(){return this.checkbox.checked}set label(e){this.settingsTextElem.innerText=e}get label(){return this.settingsTextElem.innerText}}class z$1 extends N{constructor(e){super(e),this.label=this.setting.label,this.number=this.setting.number}get setting(){return this._setting}get settingsTextElem(){return this._settingsTextElem||(this._settingsTextElem=document.createElement("label"),this._settingsTextElem.innerText=this.setting.label,this._settingsTextElem.title=this.setting.description),this._settingsTextElem}get spinner(){return this._spinner||(this._spinner=document.createElement("input"),this._spinner.type="number",this._spinner.min=this.setting.min.toString(),this._spinner.max=this.setting.max.toString(),this._spinner.value=this.setting.number.toString(),this._spinner.title=this.setting.description,this._spinner.classList.add("form-control")),this._spinner}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div"),this._rootElement.classList.add("setting"),this._rootElement.classList.add("form-group"),this._rootElement.appendChild(this.settingsTextElem),this._rootElement.appendChild(this.spinner),this.spinner.onchange=e=>{const t=e.target,r=Number.parseInt(t.value);Number.isNaN(r)?(l.Logger.Warning(l.Logger.GetStackTrace(),`Could not parse value change into a valid number - value was ${t.value}, resetting value to ${this.setting.min}`),this.setting.number!==this.setting.min&&(this.setting.number=this.setting.min)):this.setting.number!==r&&(this.setting.number=r,this.setting.updateURLParams())}),this._rootElement}set number(e){this.spinner.value=this.setting.clamp(e).toString()}get number(){return+this.spinner.value}set label(e){this.settingsTextElem.innerText=e}get label(){return this.settingsTextElem.innerText}}class B extends N{constructor(e){super(e),this.label=this.setting.label,this.text=this.setting.text}get setting(){return this._setting}get settingsTextElem(){return this._settingsTextElem||(this._settingsTextElem=document.createElement("div"),this._settingsTextElem.innerText=this.setting.label,this._settingsTextElem.title=this.setting.description),this._settingsTextElem}get textbox(){return this._textbox||(this._textbox=document.createElement("input"),this._textbox.classList.add("form-control"),this._textbox.type="textbox"),this._textbox}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id=this.setting.id,this._rootElement.classList.add("setting"),this._rootElement.appendChild(this.settingsTextElem);const e=document.createElement("label");this._rootElement.appendChild(e),this.textbox.title=this.setting.description,e.appendChild(this.textbox),this.textbox.addEventListener("input",(()=>{this.setting.text!==this.textbox.value&&(this.setting.text=this.textbox.value,this.setting.updateURLParams())}))}return this._rootElement}set text(e){this.textbox.value=e}get text(){return this.textbox.value}set label(e){this.settingsTextElem.innerText=e}get label(){return this.settingsTextElem.innerText}}class U extends N{constructor(e){super(e),this.label=this.setting.label,this.options=this.setting.options,this.selected=this.setting.selected}get setting(){return this._setting}get selector(){return this._selector||(this._selector=document.createElement("select"),this._selector.classList.add("form-control"),this._selector.classList.add("settings-option")),this._selector}get settingsTextElem(){return this._settingsTextElem||(this._settingsTextElem=document.createElement("div"),this._settingsTextElem.innerText=this.setting.label,this._settingsTextElem.title=this.setting.description),this._settingsTextElem}set label(e){this.settingsTextElem.innerText=e}get label(){return this.settingsTextElem.innerText}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id=this.setting.id,this._rootElement.classList.add("setting"),this._rootElement.classList.add("form-group"),this._rootElement.appendChild(this.settingsTextElem);const e=document.createElement("label");this._rootElement.appendChild(e),this.selector.title=this.setting.description,e.appendChild(this.selector),this.selector.onchange=()=>{this.setting.selected!==this.selector.value&&(this.setting.selected=this.selector.value,this.setting.updateURLParams())}}return this._rootElement}set options(e){for(let e=this.selector.options.length-1;e>=0;e--)this.selector.remove(e);e.forEach((e=>{const t=document.createElement("option");t.value=e,t.innerHTML=e,this.selector.appendChild(t)}))}get options(){return[...this.selector.options].map((e=>e.value))}set selected(e){const t=this.options.filter((t=>-1!==t.indexOf(e)));t.length&&(this.selector.value=t[0])}get selected(){return this.selector.value}disable(){this.selector.disabled=!0}enable(){this.selector.disabled=!1}}const D="LightMode";class H{constructor(e){this.customFlags=new Map,this.flagsUi=new Map,this.numericParametersUi=new Map,this.textParametersUi=new Map,this.optionParametersUi=new Map,this.createCustomUISettings(e.useUrlParams),this.registerSettingsUIComponents(e)}createCustomUISettings(e){this.customFlags.set(D,new l.SettingFlag(D,"Color Scheme: Dark Mode","Page styling will be either light or dark",!1,e,((e,t)=>{t.label=`Color Scheme: ${e?"Light":"Dark"} Mode`})))}registerSettingsUIComponents(e){for(const t of e.getFlags())this.flagsUi.set(t.id,new R(t));for(const e of Array.from(this.customFlags.values()))this.flagsUi.set(e.id,new R(e));for(const t of e.getTextSettings())this.textParametersUi.set(t.id,new B(t));for(const t of e.getNumericSettings())this.numericParametersUi.set(t.id,new z$1(t));for(const t of e.getOptionSettings())this.optionParametersUi.set(t.id,new U(t))}buildSectionWithHeading(e,t){const r=document.createElement("section");r.classList.add("settingsContainer");const n=document.createElement("div");return n.classList.add("settingsHeader"),n.classList.add("settings-text"),n.textContent=t,r.appendChild(n),e.appendChild(r),r}populateSettingsElement(e){const t=this.buildSectionWithHeading(e,"Pixel Streaming");this.addSettingText(t,this.textParametersUi.get(l.TextParameters.SignallingServerUrl)),this.addSettingOption(t,this.optionParametersUi.get(l.OptionParameters.StreamerId)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.AutoConnect)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.AutoPlayVideo)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.BrowserSendOffer)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.UseMic)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.StartVideoMuted)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.PreferSFU)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.IsQualityController)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.ForceMonoAudio)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.ForceTURN)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.SuppressBrowserKeys)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.AFKDetection)),this.addSettingNumeric(t,this.numericParametersUi.get(l.NumericParameters.AFKTimeoutSecs));const r=this.buildSectionWithHeading(e,"UI");this.addSettingFlag(r,this.flagsUi.get(l.Flags.MatchViewportResolution)),this.addSettingFlag(r,this.flagsUi.get(l.Flags.HoveringMouseMode)),this.addSettingFlag(r,this.flagsUi.get(D));const n=this.buildSectionWithHeading(e,"Input");this.addSettingFlag(n,this.flagsUi.get(l.Flags.KeyboardInput)),this.addSettingFlag(n,this.flagsUi.get(l.Flags.MouseInput)),this.addSettingFlag(n,this.flagsUi.get(l.Flags.TouchInput)),this.addSettingFlag(n,this.flagsUi.get(l.Flags.GamepadInput)),this.addSettingFlag(n,this.flagsUi.get(l.Flags.XRControllerInput));const i=this.buildSectionWithHeading(e,"Encoder");this.addSettingNumeric(i,this.numericParametersUi.get(l.NumericParameters.MinQP)),this.addSettingNumeric(i,this.numericParametersUi.get(l.NumericParameters.MaxQP));const s=this.optionParametersUi.get(l.OptionParameters.PreferredCodec);this.addSettingOption(i,this.optionParametersUi.get(l.OptionParameters.PreferredCodec)),s&&[...s.selector.options].map((e=>e.value)).includes("Only available on Chrome")&&s.disable();const a=this.buildSectionWithHeading(e,"WebRTC");this.addSettingNumeric(a,this.numericParametersUi.get(l.NumericParameters.WebRTCFPS)),this.addSettingNumeric(a,this.numericParametersUi.get(l.NumericParameters.WebRTCMinBitrate)),this.addSettingNumeric(a,this.numericParametersUi.get(l.NumericParameters.WebRTCMaxBitrate))}addSettingText(e,t){t&&(e.appendChild(t.rootElement),this.textParametersUi.set(t.setting.id,t))}addSettingFlag(e,t){t&&(e.appendChild(t.rootElement),this.flagsUi.set(t.setting.id,t))}addSettingNumeric(e,t){t&&(e.appendChild(t.rootElement),this.numericParametersUi.set(t.setting.id,t))}addSettingOption(e,t){t&&(e.appendChild(t.rootElement),this.optionParametersUi.set(t.setting.id,t))}onSettingsChanged({data:{id:e,target:t,type:r}}){if("flag"===r){const r=e,n=t,i=this.flagsUi.get(r);i&&(i.flag!==n.flag&&(i.flag=n.flag),i.label!==n.label&&(i.label=n.label))}else if("number"===r){const r=e,n=t,i=this.numericParametersUi.get(r);i&&(i.number!==n.number&&(i.number=n.number),i.label!==n.label&&(i.label=n.label))}else if("text"===r){const r=e,n=t,i=this.textParametersUi.get(r);i&&(i.text!==n.text&&(i.text=n.text),i.label!==n.label&&(i.label=n.label))}else if("option"===r){const r=e,n=t,i=this.optionParametersUi.get(r);if(i){const e=i.options,t=n.options;e.length===t.length&&e.every((e=>t.includes(e)))||(i.options=n.options),i.selected!==n.selected&&(i.selected=n.selected),i.label!==n.label&&(i.label=n.label)}}}addCustomFlagOnSettingChangedListener(e,t){this.customFlags.has(e)&&(this.customFlags.get(e).onChange=t)}setCustomFlagLabel(e,t){this.customFlags.has(e)?(this.customFlags.get(e).label=t,this.flagsUi.get(e).label=t):l.Logger.Warning(l.Logger.GetStackTrace(),`Cannot set label for flag called ${e} - it does not exist in the Config.flags map.`)}isCustomFlagEnabled(e){return this.customFlags.get(e).flag}}class Q{constructor(e){this._options=e,this.stream=e.stream,this.onColorModeChanged=e.onColorModeChanged,this.configUI=new H(this.stream.config),this.createOverlays(),T(e.statsPanelConfig)&&(this.statsPanel=new O,this.uiFeaturesElement.appendChild(this.statsPanel.rootElement)),T(e.settingsPanelConfig)&&(this.settingsPanel=new k,this.uiFeaturesElement.appendChild(this.settingsPanel.rootElement),this.configureSettings()),e.videoQpIndicatorConfig&&e.videoQpIndicatorConfig.disableIndicator||(this.videoQpIndicator=new M,this.uiFeaturesElement.appendChild(this.videoQpIndicator.rootElement)),this.createButtons(),this.registerCallbacks(),this.showConnectOrAutoConnectOverlays(),this.setColorMode(this.configUI.isCustomFlagEnabled(D))}createOverlays(){this.disconnectOverlay=new u(this.stream.videoElementParent),this.connectOverlay=new m(this.stream.videoElementParent),this.playOverlay=new g(this.stream.videoElementParent),this.infoOverlay=new E(this.stream.videoElementParent),this.errorOverlay=new v$1(this.stream.videoElementParent),this.afkOverlay=new b(this.stream.videoElementParent),this.disconnectOverlay.onAction((()=>this.stream.reconnect())),this.connectOverlay.onAction((()=>this.stream.connect())),this.playOverlay.onAction((()=>this.stream.play()))}createButtons(){const e={statsButtonType:this._options.statsPanelConfig?this._options.statsPanelConfig.visibilityButtonConfig:void 0,settingsButtonType:this._options.settingsPanelConfig?this._options.settingsPanelConfig.visibilityButtonConfig:void 0,fullscreenButtonType:this._options.fullScreenControlsConfig,xrIconType:this._options.xrControlsConfig},t=new L(e);this.uiFeaturesElement.appendChild(t.rootElement);const r=this._options.fullScreenControlsConfig&&this._options.fullScreenControlsConfig.creationMode===c.UseCustomElement?new y(this._options.fullScreenControlsConfig.customElement):t.fullscreenIcon;r&&(r.fullscreenElement=this.rootElement);const n=t.settingsIcon?t.settingsIcon.rootElement:this._options.settingsPanelConfig.visibilityButtonConfig.customElement;n&&(n.onclick=()=>this.settingsClicked()),this.settingsPanel&&(this.settingsPanel.settingsCloseButton.onclick=()=>this.settingsClicked());const i=t.xrIcon?t.xrIcon.rootElement:this._options.xrControlsConfig.creationMode===c.UseCustomElement?this._options.xrControlsConfig.customElement:void 0;i&&(i.onclick=()=>this.stream.toggleXR());const s=t.statsIcon?t.statsIcon.rootElement:this._options.statsPanelConfig.visibilityButtonConfig.customElement;if(s&&(s.onclick=()=>this.statsClicked()),this.statsPanel&&(this.statsPanel.statsCloseButton.onclick=()=>this.statsClicked()),this.settingsPanel){const e=new I("Show FPS","Toggle");e.addOnClickListener((()=>{this.stream.requestShowFps()}));const t=new I("Restart Stream","Restart");t.addOnClickListener((()=>{this.stream.reconnect()}));const r=new I("Request keyframe","Request");r.addOnClickListener((()=>{this.stream.requestIframe()}));const n=this.configUI.buildSectionWithHeading(this.settingsPanel.settingsContentElement,"Commands");n.appendChild(e.rootElement),n.appendChild(r.rootElement),n.appendChild(t.rootElement)}}configureSettings(){this.configUI.populateSettingsElement(this.settingsPanel.settingsContentElement),this.configUI.addCustomFlagOnSettingChangedListener(D,(e=>{this.configUI.setCustomFlagLabel(D,`Color Scheme: ${e?"Light":"Dark"} Mode`),this.setColorMode(e)}))}registerCallbacks(){this.stream.addEventListener("afkWarningActivate",(({data:{countDown:e,dismissAfk:t}})=>this.showAfkOverlay(e,t))),this.stream.addEventListener("afkWarningUpdate",(({data:{countDown:e}})=>this.afkOverlay.updateCountdown(e))),this.stream.addEventListener("afkWarningDeactivate",(()=>this.afkOverlay.hide())),this.stream.addEventListener("afkTimedOut",(()=>this.afkOverlay.hide())),this.stream.addEventListener("videoEncoderAvgQP",(({data:{avgQP:e}})=>this.onVideoEncoderAvgQP(e))),this.stream.addEventListener("webRtcSdp",(()=>this.onWebRtcSdp())),this.stream.addEventListener("webRtcAutoConnect",(()=>this.onWebRtcAutoConnect())),this.stream.addEventListener("webRtcConnecting",(()=>this.onWebRtcConnecting())),this.stream.addEventListener("webRtcConnected",(()=>this.onWebRtcConnected())),this.stream.addEventListener("webRtcFailed",(()=>this.onWebRtcFailed())),this.stream.addEventListener("webRtcDisconnected",(({data:{eventString:e,showActionOrErrorOnDisconnect:t}})=>this.onDisconnect(e,t))),this.stream.addEventListener("videoInitialized",(()=>this.onVideoInitialized())),this.stream.addEventListener("streamLoading",(()=>this.onStreamLoading())),this.stream.addEventListener("playStreamError",(({data:{message:e}})=>this.onPlayStreamError(e))),this.stream.addEventListener("playStream",(()=>this.onPlayStream())),this.stream.addEventListener("playStreamRejected",(({data:{reason:e}})=>this.onPlayStreamRejected(e))),this.stream.addEventListener("loadFreezeFrame",(({data:{shouldShowPlayOverlay:e}})=>this.onLoadFreezeFrame(e))),this.stream.addEventListener("statsReceived",(({data:{aggregatedStats:e}})=>this.onStatsReceived(e))),this.stream.addEventListener("latencyTestResult",(({data:{latencyTimings:e}})=>this.onLatencyTestResults(e))),this.stream.addEventListener("streamerListMessage",(({data:{messageStreamerList:e,autoSelectedStreamerId:t}})=>this.handleStreamerListMessage(e,t))),this.stream.addEventListener("settingsChanged",(e=>this.configUI.onSettingsChanged(e)))}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div"),this._rootElement.id="playerUI",this._rootElement.classList.add("noselect"),this._rootElement.appendChild(this.stream.videoElementParent),this._rootElement.appendChild(this.uiFeaturesElement)),this._rootElement}get uiFeaturesElement(){return this._uiFeatureElement||(this._uiFeatureElement=document.createElement("div"),this._uiFeatureElement.id="uiFeatures"),this._uiFeatureElement}showDisconnectOverlay(e){this.hideCurrentOverlay(),this.updateDisconnectOverlay(e),this.disconnectOverlay.show(),this.currentOverlay=this.disconnectOverlay}updateDisconnectOverlay(e){this.disconnectOverlay.update(e)}onDisconnectionAction(){this.disconnectOverlay.activate()}hideCurrentOverlay(){null!=this.currentOverlay&&(this.currentOverlay.hide(),this.currentOverlay=null)}showConnectOverlay(){this.hideCurrentOverlay(),this.connectOverlay.show(),this.currentOverlay=this.connectOverlay}showPlayOverlay(){this.hideCurrentOverlay(),this.playOverlay.show(),this.currentOverlay=this.playOverlay}showTextOverlay(e){this.hideCurrentOverlay(),this.infoOverlay.update(e),this.infoOverlay.show(),this.currentOverlay=this.infoOverlay}showErrorOverlay(e){this.hideCurrentOverlay(),this.errorOverlay.update(e),this.errorOverlay.show(),this.currentOverlay=this.errorOverlay}settingsClicked(){this.statsPanel.hide(),this.settingsPanel.toggleVisibility()}statsClicked(){this.settingsPanel.hide(),this.statsPanel.toggleVisibility()}onConnectAction(){this.connectOverlay.activate()}onPlayAction(){this.playOverlay.activate()}showAfkOverlay(e,t){this.hideCurrentOverlay(),this.afkOverlay.updateCountdown(e),this.afkOverlay.onAction((()=>t())),this.afkOverlay.show(),this.currentOverlay=this.afkOverlay}showConnectOrAutoConnectOverlays(){this.stream.config.isFlagEnabled(l.Flags.AutoConnect)||this.showConnectOverlay()}onWebRtcAutoConnect(){this.showTextOverlay("Auto Connecting Now")}onWebRtcSdp(){this.showTextOverlay("WebRTC Connection Negotiated")}onStreamLoading(){const e=document.createElement("span");e.className="visually-hidden",e.innerHTML="Loading...";const t=document.createElement("div");t.id="loading-spinner",t.className="spinner-border ms-2",t.setAttribute("role","status"),t.appendChild(e),this.showTextOverlay("Loading Stream "+t.outerHTML)}onDisconnect(e,t){0==t?this.showErrorOverlay(`Disconnected: ${e}`):this.showDisconnectOverlay(`Disconnected: ${e} <div class="clickableState">Click To Restart</div>`),this.statsPanel.latencyTest.latencyTestButton.onclick=()=>{}}onWebRtcConnecting(){this.showTextOverlay("Starting connection to server, please wait")}onWebRtcConnected(){this.showTextOverlay("WebRTC connected, waiting for video")}onWebRtcFailed(){this.showErrorOverlay("Unable to setup video")}onLoadFreezeFrame(e){!0===e&&(l.Logger.Log(l.Logger.GetStackTrace(),"showing play overlay"),this.showPlayOverlay())}onPlayStream(){this.hideCurrentOverlay()}onPlayStreamError(e){this.showErrorOverlay(e)}onPlayStreamRejected(e){this.showPlayOverlay()}onVideoInitialized(){this.stream.config.isFlagEnabled(l.Flags.AutoPlayVideo)||this.showPlayOverlay(),this.statsPanel.latencyTest.latencyTestButton.onclick=()=>{this.stream.requestLatencyTest()}}onVideoEncoderAvgQP(e){this.videoQpIndicator&&this.videoQpIndicator.updateQpTooltip(e)}onInitialSettings(e){e.PixelStreamingSettings&&e.PixelStreamingSettings.DisableLatencyTest&&(this.statsPanel.latencyTest.latencyTestButton.disabled=!0,this.statsPanel.latencyTest.latencyTestButton.title="Disabled by -PixelStreamingDisableLatencyTester=true",l.Logger.Info(l.Logger.GetStackTrace(),"-PixelStreamingDisableLatencyTester=true, requesting latency report from the the browser to UE is disabled."))}onStatsReceived(e){this.statsPanel.handleStats(e)}onLatencyTestResults(e){this.statsPanel.latencyTest.handleTestResult(e)}handleStreamerListMessage(e,t){null===t&&(0===e.ids.length?this.showDisconnectOverlay('No streamers connected. <div class="clickableState">Click To Restart</div>'):this.showTextOverlay("Multiple streamers detected. Use the dropdown in the settings menu to select the streamer"))}setColorMode(e){this.onColorModeChanged&&this.onColorModeChanged(e)}}const W=(e=>{var t={};return n.d(t,e),t})({default:()=>index$1}),Z=(e=>{var t={};return n.d(t,e),t})({default:()=>jssGlobal}),X=(e=>{var t={};return n.d(t,e),t})({default:()=>camelCase});class j{constructor(e){this.defaultLightModePalette={"--color0":"#e2e0dd80","--color1":"#FFFFFF","--color2":"#000000","--color3":"#0585fe","--color4":"#35b350","--color5":"#ffab00","--color6":"#e1e2dd","--color7":"#c3c4bf"},this.defaultDarkModePalette={"--color0":"#1D1F2280","--color1":"#000000","--color2":"#FFFFFF","--color3":"#0585fe","--color4":"#35b350","--color5":"#ffab00","--color6":"#1e1d22","--color7":"#3c3b40"},this.defaultStyles={":root":{"--color0":"#1D1F2280","--color1":"#000000","--color2":"#FFFFFF","--color3":"#0585fe","--color4":"#35b350","--color5":"#ffab00","--color6":"#1e1d22","--color7":"#3c3b40","--color8":"#41008c","--color9":"#3e0070","--color10":"#2e0052","--color11":"rgba(65,0,139,1)"},".noselect":{userSelect:"none"},"#playerUI":{width:"100%",height:"100%",position:"relative"},"#videoElementParent":{width:"100%",height:"100%",position:"absolute",backgroundColor:"var(--color1)"},"#uiFeatures":{width:"100%",height:"100%",zIndex:"30",position:"relative",color:"var(--color2)",pointerEvents:"none",overflow:"hidden"},".UiTool .tooltiptext":{visibility:"hidden",width:"auto",color:"var(--color2)",textAlign:"center",borderRadius:"15px",padding:"0px 10px",fontFamily:"'Montserrat', sans-serif",fontSize:"0.75rem",letterSpacing:"0.75px",position:"absolute",top:"0",transform:"translateY(25%)",left:"125%",zIndex:"20"},".UiTool:hover .tooltiptext":{visibility:"visible",backgroundColor:"var(--color7)"},"#connection .tooltiptext":{top:"125%",transform:"translateX(-25%)",left:"0",zIndex:"20",padding:"5px 10px"},"#connection":{position:"absolute",bottom:"8%",left:"5%",fontFamily:"'Michroma', sans-serif",height:"3rem",width:"3rem",pointerEvents:"all"},"#settings-panel .tooltiptext":{display:"block",top:"125%",transform:"translateX(-50%)",left:"0",zIndex:"20",padding:"5px 10px",border:"3px solid var(--color3)",width:"max-content",fallbacks:[{width:"max-content"},{border:"3px solid var(--color3)"},{padding:"5px 10px"},{zIndex:"20"},{left:"0"},{transform:"translateX(-50%)"},{top:"125%"},{display:"block"}]},"#controls":{position:"absolute",top:"3%",left:"2%",fontFamily:"'Michroma', sans-serif",pointerEvents:"all",display:"block"},"#controls>*":{marginBottom:"0.5rem",borderRadius:"50%",display:"block",height:"2rem",lineHeight:"1.75rem",padding:"0.5rem"},"#controls #additionalinfo":{textAlign:"center",fontFamily:"'Montserrat', sans-serif"},"#fullscreen-btn":{padding:"0.6rem !important"},"#minimizeIcon":{display:"none"},"#settingsBtn, #statsBtn":{cursor:"pointer"},"#uiFeatures button":{backgroundColor:"var(--color7)",border:"1px solid var(--color7)",color:"var(--color2)",position:"relative",width:"3rem",height:"3rem",padding:"0.5rem",textAlign:"center"},"#uiFeatures button:hover":{backgroundColor:"var(--color3)",border:"3px solid var(--color3)",transition:"0.25s ease",paddingLeft:"0.55rem",paddingTop:"0.55rem"},"#uiFeatures button:active":{border:"3px solid var(--color3)",backgroundColor:"var(--color7)",paddingLeft:"0.55rem",paddingTop:"0.55rem"},".btn-flat":{backgroundColor:"transparent",color:"var(--color2)",fontFamily:"'Montserrat'",fontWeight:"bold",border:"3px solid var(--color3)",borderRadius:"1rem",fontSize:"0.75rem",paddingLeft:"0.5rem",paddingRight:"0.5rem",cursor:"pointer",textAlign:"center"},".btn-flat:hover":{backgroundColor:"var(--color3)",transition:"ease 0.3s"},".btn-flat:disabled":{background:"var(--color7)",borderColor:"var(--color3)",color:"var(--color3)",cursor:"default"},".btn-flat:active":{backgroundColor:"transparent"},".btn-flat:focus":{outline:"none"},"#uiFeatures img":{width:"100%",height:"100%"},".panel-wrap":{position:"absolute",top:"0",bottom:"0",right:"0",height:"100%",minWidth:"20vw",maxWidth:"100vw",transform:"translateX(100%)",transition:".3s ease-out",pointerEvents:"all",backdropFilter:"blur(10px)",webkitBackdropFilter:"blur(10px)",overflowY:"auto",overflowX:"hidden",backgroundColor:"var(--color0)"},".panel-wrap-visible":{transform:"translateX(0%)"},".panel":{overflowY:"auto",padding:"1em"},"#settingsHeading, #statsHeading":{display:"inline-block",fontSize:"2em",marginBlockStart:"0.67em",marginBlockEnd:"0.67em",marginInlineStart:"0px",marginInlineEnd:"0px",position:"relative",padding:"0 0 0 2rem"},"#settingsClose, #statsClose":{margin:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",paddingRight:"0.5rem",fontSize:"2em",float:"right"},"#settingsClose:after, #statsClose:after":{paddingLeft:"0.5rem",display:"inline-block",content:'"\\00d7"'},"#settingsClose:hover, #statsClose:hover":{color:"var(--color3)",transition:"ease 0.3s"},"#settingsContent, #statsContent":{marginLeft:"2rem",marginRight:"2rem"},".setting":{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"0.15rem 10px 0.15rem 10px"},".settings-text":{color:"var(--color2)",verticalAlign:"middle",fontWeight:"normal"},".settings-option":{width:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap"},"#connectOverlay, #playOverlay, #infoOverlay, #errorOverlay, #afkOverlay, #disconnectOverlay":{zIndex:"30",position:"absolute",color:"var(--color2)",fontSize:"1.8em",width:"100%",height:"100%",backgroundColor:"var(--color1)",alignItems:"center",justifyContent:"center",textTransform:"uppercase"},".clickableState":{alignItems:"center",justifyContent:"center",display:"flex",cursor:"pointer"},".textDisplayState":{display:"flex"},".hiddenState":{display:"none"},"#playButton, #connectButton":{display:"inline-block",height:"auto",zIndex:"30"},"img#playButton":{maxWidth:"241px",width:"10%"},"#uiInteraction":{position:"fixed"},"#UIInteractionButtonBoundary":{padding:"2px"},"#UIInteractionButton":{cursor:"pointer"},"#hiddenInput":{position:"absolute",left:"-10%",width:"0px",opacity:"0"},"#editTextButton":{position:"absolute",height:"40px",width:"40px"},".btn-overlay":{verticalAlign:"middle",display:"inline-block"},".tgl-switch":{verticalAlign:"middle",display:"inline-block"},".tgl-switch .tgl":{display:"none"},".tgl, .tgl:after, .tgl:before, .tgl *, .tgl *:after, .tgl *:before, .tgl+.tgl-slider":{webkitBoxSizing:"border-box",boxSizing:"border-box"},".tgl::-moz-selection, .tgl:after::-moz-selection, .tgl:before::-moz-selection, .tgl *::-moz-selection, .tgl *:after::-moz-selection, .tgl *:before::-moz-selection, .tgl+.tgl-slider::-moz-selection":{background:"none"},".tgl::selection, .tgl:after::selection, .tgl:before::selection, .tgl *::selection, .tgl *:after::selection, .tgl *:before::selection, .tgl+.tgl-slider::selection":{background:"none"},".tgl-slider":{},".tgl+.tgl-slider":{outline:"0",display:"block",width:"40px",height:"18px",position:"relative",cursor:"pointer",userSelect:"none"},".tgl+.tgl-slider:after, .tgl+.tgl-slider:before":{position:"relative",display:"block",content:'""',width:"50%",height:"100%"},".tgl+.tgl-slider:after":{left:"0"},".tgl+.tgl-slider:before":{display:"none"},".tgl-flat+.tgl-slider":{padding:"2px",webkitTransition:"all .2s ease",transition:"all .2s ease",background:"var(--color6)",border:"3px solid var(--color7)",borderRadius:"2em"},".tgl-flat+.tgl-slider:after":{webkitTransition:"all .2s ease",transition:"all .2s ease",background:"var(--color7)",content:'""',borderRadius:"1em"},".tgl-flat:checked+.tgl-slider":{border:"3px solid var(--color3)"},".tgl-flat:checked+.tgl-slider:after":{left:"50%",background:"var(--color3)"},".btn-apply":{display:"block !important",marginLeft:"auto",marginRight:"auto",width:"40%"},".form-control":{backgroundColor:"var(--color7)",border:"2px solid var(--color7)",borderRadius:"4px",color:"var(--color2)",textAlign:"right",fontFamily:"inherit"},".form-control:hover":{borderColor:"var(--color7)"},".form-group":{paddingTop:"4px",display:"grid",gridTemplateColumns:"80% 20%",rowGap:"4px",paddingRight:"10px",paddingLeft:"10px"},".form-group label":{verticalAlign:"middle",fontWeight:"normal"},".settingsContainer":{display:"flex",flexDirection:"column",borderBottom:"1px solid var(--color7)",paddingTop:"10px",paddingBottom:"10px"},".settingsContainer> :first-child":{marginTop:"4px",marginBottom:"4px",fontWeight:"bold",justifyContent:"space-between",display:"flex",flexDirection:"row",alignItems:"baseline"},".collapse":{paddingLeft:"5%"},"#streamTools":{borderBottomRightRadius:"5px",borderBottomLeftRadius:"5px",userSelect:"none",position:"absolute",top:"0",right:"2%",zIndex:"100",border:"4px solid var(--colour8)",borderTopWidth:"0px"},".settingsHeader":{fontStyle:"italic"},"#streamToolsHeader":{display:"flex",flexDirection:"row",justifyContent:"space-between",borderBottom:"1px solid var(--colour8)",backgroundColor:"var(--color7)"},".streamTools":{backgroundColor:"var(--color2)",fontFamily:"var(--buttonFont)",fontWeight:"lighter",color:"var(--color7)"},".streamTools-shown>#streamToolsSettings, .streamTools-shown>#streamToolsStats":{display:"block"},"#streamToolsToggle":{width:"100%"},"#qualityStatus":{fontSize:"37px",paddingRight:"4px"},".svgIcon":{fill:"var(--color2)"}};const{customStyles:t,lightModePalette:r,darkModePalette:n}=null!=e?e:{},i={plugins:[(0,Z.default)(),(0,X.default)()]};W.default.setup(i),this.customStyles=t,this.lightModePalette=null!=r?r:this.defaultLightModePalette,this.darkModePalette=null!=n?n:this.defaultDarkModePalette}applyStyleSheet(){W.default.createStyleSheet({"@global":Object.assign(Object.assign({},this.defaultStyles),this.customStyles)}).attach()}applyPalette(e){const t=document.querySelector(":root");t.style.setProperty("--color0",e["--color0"]),t.style.setProperty("--color1",e["--color1"]),t.style.setProperty("--color2",e["--color2"]),t.style.setProperty("--color3",e["--color3"]),t.style.setProperty("--color4",e["--color4"]),t.style.setProperty("--color5",e["--color5"]),t.style.setProperty("--color6",e["--color6"]),t.style.setProperty("--color7",e["--color7"])}setColorMode(e){e?this.applyPalette(this.lightModePalette):this.applyPalette(this.darkModePalette)}}var q=o.ym,V=o.EW,G=o.Mx,J=o.L3,Y=o.rl,K=o.NR,$$9=o.f1,tt=o.IY,et=o.RZ,st=o.XY,it=o.Fk,nt=o.Zh,ot=o.ek,lt=o.MG,at=o.gE,rt=o.tW,ct=o.wr,check=function(e){return e&&e.Math==Math&&e},global$g=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$l=function(e){try{return!!e()}catch(e){return!0}},fails$k=fails$l,descriptors=!fails$k((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),fails$j=fails$l,functionBindNative=!fails$j((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$3=functionBindNative,call$g=Function.prototype.call,functionCall=NATIVE_BIND$3?call$g.bind(call$g):function(){return call$g.apply(call$g,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$3=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$3&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$3(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable;var createPropertyDescriptor$5=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},NATIVE_BIND$2=functionBindNative,FunctionPrototype$2=Function.prototype,call$f=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$2&&FunctionPrototype$2.bind.bind(call$f,call$f),functionUncurryThis=NATIVE_BIND$2?uncurryThisWithBind:function(e){return function(){return call$f.apply(e,arguments)}},uncurryThis$o=functionUncurryThis,toString$a=uncurryThis$o({}.toString),stringSlice$8=uncurryThis$o("".slice),classofRaw$2=function(e){return stringSlice$8(toString$a(e),8,-1)},uncurryThis$n=functionUncurryThis,fails$i=fails$l,classof$7=classofRaw$2,$Object$4=Object,split$3=uncurryThis$n("".split),indexedObject=fails$i((function(){return!$Object$4("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$7(e)?split$3(e,""):$Object$4(e)}:$Object$4,isNullOrUndefined$5=function(e){return null==e},isNullOrUndefined$4=isNullOrUndefined$5,$TypeError$b=TypeError,requireObjectCoercible$8=function(e){if(isNullOrUndefined$4(e))throw $TypeError$b("Can't call method on "+e);return e},IndexedObject$1=indexedObject,requireObjectCoercible$7=requireObjectCoercible$8,toIndexedObject$5=function(e){return IndexedObject$1(requireObjectCoercible$7(e))},documentAll$2="object"==typeof document&&document.all,IS_HTMLDDA=void 0===documentAll$2&&void 0!==documentAll$2,documentAll_1={all:documentAll$2,IS_HTMLDDA:IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$j=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},isCallable$i=isCallable$j,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$8=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$i(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$i(e)},global$f=global$g,isCallable$h=isCallable$j,aFunction=function(e){return isCallable$h(e)?e:void 0},getBuiltIn$4=function(e,t){return arguments.length<2?aFunction(global$f[e]):global$f[e]&&global$f[e][t]},uncurryThis$m=functionUncurryThis,objectIsPrototypeOf=uncurryThis$m({}.isPrototypeOf),engineUserAgent="undefined"!=typeof navigator&&String(navigator.userAgent)||"",global$e=global$g,userAgent=engineUserAgent,process=global$e.process,Deno=global$e.Deno,versions=process&&process.versions||Deno&&Deno.version,v8=versions&&versions.v8,match,version;v8&&(match=v8.split("."),version=match[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&userAgent&&(match=userAgent.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent.match(/Chrome\/(\d+)/),match&&(version=+match[1])));var engineV8Version=version,V8_VERSION=engineV8Version,fails$h=fails$l,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$h((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION&&V8_VERSION<41})),NATIVE_SYMBOL$1=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$1&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$3=getBuiltIn$4,isCallable$g=isCallable$j,isPrototypeOf$2=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$2=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$3("Symbol");return isCallable$g(t)&&isPrototypeOf$2(t.prototype,$Object$3(e))},$String$4=String,tryToString$2=function(e){try{return $String$4(e)}catch(e){return"Object"}},isCallable$f=isCallable$j,tryToString$1=tryToString$2,$TypeError$a=TypeError,aCallable$4=function(e){if(isCallable$f(e))return e;throw $TypeError$a(tryToString$1(e)+" is not a function")},aCallable$3=aCallable$4,isNullOrUndefined$3=isNullOrUndefined$5,getMethod$5=function(e,t){var r=e[t];return isNullOrUndefined$3(r)?void 0:aCallable$3(r)},call$e=functionCall,isCallable$e=isCallable$j,isObject$7=isObject$8,$TypeError$9=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$e(r=e.toString)&&!isObject$7(n=call$e(r,e)))return n;if(isCallable$e(r=e.valueOf)&&!isObject$7(n=call$e(r,e)))return n;if("string"!==t&&isCallable$e(r=e.toString)&&!isObject$7(n=call$e(r,e)))return n;throw $TypeError$9("Can't convert object to primitive value")},shared$4={exports:{}},isPure=!1,global$d=global$g,defineProperty$6=Object.defineProperty,defineGlobalProperty$3=function(e,t){try{defineProperty$6(global$d,e,{value:t,configurable:!0,writable:!0})}catch(r){global$d[e]=t}return t},global$c=global$g,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$c[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$4.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.29.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE",source:"https://github.com/zloirock/core-js"});var requireObjectCoercible$6=requireObjectCoercible$8,$Object$2=Object,toObject$5=function(e){return $Object$2(requireObjectCoercible$6(e))},uncurryThis$l=functionUncurryThis,toObject$4=toObject$5,hasOwnProperty=uncurryThis$l({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$4(e),t)},uncurryThis$k=functionUncurryThis,id=0,postfix=Math.random(),toString$9=uncurryThis$k(1..toString),uid$2=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$9(++id+postfix,36)},global$b=global$g,shared$3=shared$4.exports,hasOwn$b=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$1=global$b.Symbol,WellKnownSymbolsStore=shared$3("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$1.for||Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$1,wellKnownSymbol$g=function(e){return hasOwn$b(WellKnownSymbolsStore,e)||(WellKnownSymbolsStore[e]=NATIVE_SYMBOL&&hasOwn$b(Symbol$1,e)?Symbol$1[e]:createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore[e]},call$d=functionCall,isObject$6=isObject$8,isSymbol$1=isSymbol$2,getMethod$4=getMethod$5,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$f=wellKnownSymbol$g,$TypeError$8=TypeError,TO_PRIMITIVE=wellKnownSymbol$f("toPrimitive"),toPrimitive$1=function(e,t){if(!isObject$6(e)||isSymbol$1(e))return e;var r,n=getMethod$4(e,TO_PRIMITIVE);if(n){if(void 0===t&&(t="default"),r=call$d(n,e,t),!isObject$6(r)||isSymbol$1(r))return r;throw $TypeError$8("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive=toPrimitive$1,isSymbol=isSymbol$2,toPropertyKey$3=function(e){var t=toPrimitive(e,"string");return isSymbol(t)?t:t+""},global$a=global$g,isObject$5=isObject$8,document$1=global$a.document,EXISTS$1=isObject$5(document$1)&&isObject$5(document$1.createElement),documentCreateElement$2=function(e){return EXISTS$1?document$1.createElement(e):{}},DESCRIPTORS$c=descriptors,fails$g=fails$l,createElement=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$c&&!fails$g((function(){return 7!=Object.defineProperty(createElement("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$b=descriptors,call$c=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$4=createPropertyDescriptor$5,toIndexedObject$4=toIndexedObject$5,toPropertyKey$2=toPropertyKey$3,hasOwn$a=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$b?$getOwnPropertyDescriptor$1:function(e,t){if(e=toIndexedObject$4(e),t=toPropertyKey$2(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(e,t)}catch(e){}if(hasOwn$a(e,t))return createPropertyDescriptor$4(!call$c(propertyIsEnumerableModule$1.f,e,t),e[t])};var objectDefineProperty={},DESCRIPTORS$a=descriptors,fails$f=fails$l,v8PrototypeDefineBug=DESCRIPTORS$a&&fails$f((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$4=isObject$8,$String$3=String,$TypeError$7=TypeError,anObject$e=function(e){if(isObject$4(e))return e;throw $TypeError$7($String$3(e)+" is not an object")},DESCRIPTORS$9=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$d=anObject$e,toPropertyKey$1=toPropertyKey$3,$TypeError$6=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$9?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$d(e),t=toPropertyKey$1(t),anObject$d(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var n=$getOwnPropertyDescriptor(e,t);n&&n[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:n[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:n[ENUMERABLE],writable:!1})}return $defineProperty(e,t,r)}:$defineProperty:function(e,t,r){if(anObject$d(e),t=toPropertyKey$1(t),anObject$d(r),IE8_DOM_DEFINE)try{return $defineProperty(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$6("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var DESCRIPTORS$8=descriptors,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$3=createPropertyDescriptor$5,createNonEnumerableProperty$5=DESCRIPTORS$8?function(e,t,r){return definePropertyModule$4.f(e,t,createPropertyDescriptor$3(1,r))}:function(e,t,r){return e[t]=r,e},makeBuiltIn$3={exports:{}},DESCRIPTORS$7=descriptors,hasOwn$9=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$7&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$9(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$7||DESCRIPTORS$7&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},uncurryThis$j=functionUncurryThis,isCallable$d=isCallable$j,store$1=sharedStore,functionToString=uncurryThis$j(Function.toString);isCallable$d(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)});var inspectSource$2=store$1.inspectSource,global$9=global$g,isCallable$c=isCallable$j,WeakMap$1=global$9.WeakMap,weakMapBasicDetection=isCallable$c(WeakMap$1)&&/native code/.test(String(WeakMap$1)),shared$2=shared$4.exports,uid=uid$2,keys=shared$2("keys"),sharedKey$3=function(e){return keys[e]||(keys[e]=uid(e))},hiddenKeys$4={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$8=global$g,isObject$3=isObject$8,createNonEnumerableProperty$4=createNonEnumerableProperty$5,hasOwn$8=hasOwnProperty_1,shared$1=sharedStore,sharedKey$2=sharedKey$3,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$3=global$8.TypeError,WeakMap=global$8.WeakMap,set,get,has,enforce=function(e){return has(e)?get(e):set(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$3(t)||(r=get(t)).type!==e)throw TypeError$3("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$1.state){var store=shared$1.state||(shared$1.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set=function(e,t){if(store.has(e))throw TypeError$3(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get=function(e){return store.get(e)||{}},has=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$3[STATE]=!0,set=function(e,t){if(hasOwn$8(e,STATE))throw TypeError$3(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$4(e,STATE,t),t},get=function(e){return hasOwn$8(e,STATE)?e[STATE]:{}},has=function(e){return hasOwn$8(e,STATE)}}var internalState={set:set,get:get,has:has,enforce:enforce,getterFor:getterFor},uncurryThis$i=functionUncurryThis,fails$e=fails$l,isCallable$b=isCallable$j,hasOwn$7=hasOwnProperty_1,DESCRIPTORS$6=descriptors,CONFIGURABLE_FUNCTION_NAME$1=functionName.CONFIGURABLE,inspectSource$1=inspectSource$2,InternalStateModule$4=internalState,enforceInternalState=InternalStateModule$4.enforce,getInternalState$3=InternalStateModule$4.get,$String$2=String,defineProperty$5=Object.defineProperty,stringSlice$7=uncurryThis$i("".slice),replace$6=uncurryThis$i("".replace),join$3=uncurryThis$i([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$6&&!fails$e((function(){return 8!==defineProperty$5((function(){}),"length",{value:8}).length})),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function(e,t,r){"Symbol("===stringSlice$7($String$2(t),0,7)&&(t="["+replace$6($String$2(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!hasOwn$7(e,"name")||CONFIGURABLE_FUNCTION_NAME$1&&e.name!==t)&&(DESCRIPTORS$6?defineProperty$5(e,"name",{value:t,configurable:!0}):e.name=t),CONFIGURABLE_LENGTH&&r&&hasOwn$7(r,"arity")&&e.length!==r.arity&&defineProperty$5(e,"length",{value:r.arity});try{r&&hasOwn$7(r,"constructor")&&r.constructor?DESCRIPTORS$6&&defineProperty$5(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=enforceInternalState(e);return hasOwn$7(n,"source")||(n.source=join$3(TEMPLATE,"string"==typeof t?t:"")),e};Function.prototype.toString=makeBuiltIn$2((function(){return isCallable$b(this)&&getInternalState$3(this).source||inspectSource$1(this)}),"toString");var isCallable$a=isCallable$j,definePropertyModule$3=objectDefineProperty,makeBuiltIn$1=makeBuiltIn$3.exports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$8=function(e,t,r,n){n||(n={});var i=n.enumerable,s=void 0!==n.name?n.name:t;if(isCallable$a(r)&&makeBuiltIn$1(r,s,n),n.global)i?e[t]=r:defineGlobalProperty$1(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:definePropertyModule$3.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},objectGetOwnPropertyNames={},ceil=Math.ceil,floor$4=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$4:ceil)(t)},trunc=mathTrunc,toIntegerOrInfinity$4=function(e){var t=+e;return t!=t||0===t?0:trunc(t)},toIntegerOrInfinity$3=toIntegerOrInfinity$4,max$2=Math.max,min$3=Math.min,toAbsoluteIndex$2=function(e,t){var r=toIntegerOrInfinity$3(e);return r<0?max$2(r+t,0):min$3(r,t)},toIntegerOrInfinity$2=toIntegerOrInfinity$4,min$2=Math.min,toLength$3=function(e){return e>0?min$2(toIntegerOrInfinity$2(e),9007199254740991):0},toLength$2=toLength$3,lengthOfArrayLike$3=function(e){return toLength$2(e.length)},toIndexedObject$3=toIndexedObject$5,toAbsoluteIndex$1=toAbsoluteIndex$2,lengthOfArrayLike$2=lengthOfArrayLike$3,createMethod$2=function(e){return function(t,r,n){var i,s=toIndexedObject$3(t),a=lengthOfArrayLike$2(s),o=toAbsoluteIndex$1(n,a);if(e&&r!=r){for(;a>o;)if((i=s[o++])!=i)return!0}else for(;a>o;o++)if((e||o in s)&&s[o]===r)return e||o||0;return!e&&-1}},arrayIncludes={includes:createMethod$2(!0),indexOf:createMethod$2(!1)},uncurryThis$h=functionUncurryThis,hasOwn$6=hasOwnProperty_1,toIndexedObject$2=toIndexedObject$5,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$4=uncurryThis$h([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$2(e),i=0,s=[];for(r in n)!hasOwn$6(hiddenKeys$2,r)&&hasOwn$6(n,r)&&push$4(s,r);for(;t.length>i;)hasOwn$6(n,r=t[i++])&&(~indexOf$1(s,r)||push$4(s,r));return s},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$1)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$2=getBuiltIn$4,uncurryThis$g=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$c=anObject$e,concat$2=uncurryThis$g([].concat),ownKeys$1=getBuiltIn$2("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule.f(anObject$c(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$2(t,r(e)):t},hasOwn$5=hasOwnProperty_1,ownKeys=ownKeys$1,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$2=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var n=ownKeys(t),i=definePropertyModule$2.f,s=getOwnPropertyDescriptorModule.f,a=0;a<n.length;a++){var o=n[a];hasOwn$5(e,o)||r&&hasOwn$5(r,o)||i(e,o,s(t,o))}},fails$d=fails$l,isCallable$9=isCallable$j,replacement=/#|\.prototype\./,isForced$1=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$9(t)?fails$d(t):!!t)},normalize=isForced$1.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$1.data={},NATIVE=isForced$1.NATIVE="N",POLYFILL=isForced$1.POLYFILL="P",isForced_1=isForced$1,global$7=global$g,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn$7=defineBuiltIn$8,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties=copyConstructorProperties$1,isForced=isForced_1,_export=function(e,t){var r,n,i,s,a,o=e.target,l=e.global,c=e.stat;if(r=l?global$7:c?global$7[o]||defineGlobalProperty(o,{}):(global$7[o]||{}).prototype)for(n in t){if(s=t[n],i=e.dontCallGetSet?(a=getOwnPropertyDescriptor$2(r,n))&&a.value:r[n],!isForced(l?n:o+(c?".":"#")+n,e.forced)&&void 0!==i){if(typeof s==typeof i)continue;copyConstructorProperties(s,i)}(e.sham||i&&i.sham)&&createNonEnumerableProperty$3(s,"sham",!0),defineBuiltIn$7(r,n,s,e)}},wellKnownSymbol$e=wellKnownSymbol$g,TO_STRING_TAG$3=wellKnownSymbol$e("toStringTag"),test={};test[TO_STRING_TAG$3]="z";var toStringTagSupport="[object z]"===String(test),TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$8=isCallable$j,classofRaw$1=classofRaw$2,wellKnownSymbol$d=wellKnownSymbol$g,TO_STRING_TAG$2=wellKnownSymbol$d("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw$1(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$6=TO_STRING_TAG_SUPPORT?classofRaw$1:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$1(e),TO_STRING_TAG$2))?r:CORRECT_ARGUMENTS?classofRaw$1(t):"Object"==(n=classofRaw$1(t))&&isCallable$8(t.callee)?"Arguments":n},classof$5=classof$6,$String$1=String,toString$8=function(e){if("Symbol"===classof$5(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$1(e)},anObject$b=anObject$e,regexpFlags$1=function(){var e=anObject$b(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},fails$c=fails$l,global$6=global$g,$RegExp$2=global$6.RegExp,UNSUPPORTED_Y$1=fails$c((function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),MISSED_STICKY=UNSUPPORTED_Y$1||fails$c((function(){return!$RegExp$2("a","y").sticky})),BROKEN_CARET=UNSUPPORTED_Y$1||fails$c((function(){var e=$RegExp$2("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY,UNSUPPORTED_Y:UNSUPPORTED_Y$1},objectDefineProperties={},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$2=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},DESCRIPTORS$5=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$1=objectDefineProperty,anObject$a=anObject$e,toIndexedObject$1=toIndexedObject$5,objectKeys$1=objectKeys$2;objectDefineProperties.f=DESCRIPTORS$5&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$a(e);for(var r,n=toIndexedObject$1(t),i=objectKeys$1(t),s=i.length,a=0;s>a;)definePropertyModule$1.f(e,r=i[a++],n[r]);return e};var getBuiltIn$1=getBuiltIn$4,html$1=getBuiltIn$1("document","documentElement"),anObject$9=anObject$e,definePropertiesModule=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys=hiddenKeys$4,html=html$1,documentCreateElement$1=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$1("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement$1("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[e]];return NullProtoObject()};hiddenKeys[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE]=anObject$9(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule.f(r,t)},fails$b=fails$l,global$5=global$g,$RegExp$1=global$5.RegExp,regexpUnsupportedDotAll=fails$b((function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),fails$a=fails$l,global$4=global$g,$RegExp=global$4.RegExp,regexpUnsupportedNcg=fails$a((function(){var e=$RegExp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),call$b=functionCall,uncurryThis$f=functionUncurryThis,toString$7=toString$8,regexpFlags=regexpFlags$1,stickyHelpers=regexpStickyHelpers,shared=shared$4.exports,create$3=objectCreate,getInternalState$2=internalState.get,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,nativeReplace=shared("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$6=uncurryThis$f("".charAt),indexOf=uncurryThis$f("".indexOf),replace$5=uncurryThis$f("".replace),stringSlice$6=uncurryThis$f("".slice),UPDATES_LAST_INDEX_WRONG=(re1=/a/,re2=/b*/g,call$b(nativeExec,re1,"a"),call$b(nativeExec,re2,"a"),0!==re1.lastIndex||0!==re2.lastIndex),re1,re2,UNSUPPORTED_Y=stickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG;PATCH&&(patchedExec=function(e){var t,r,n,i,s,a,o,l=this,c=getInternalState$2(l),h=toString$7(e),d=c.raw;if(d)return d.lastIndex=l.lastIndex,t=call$b(patchedExec,d,h),l.lastIndex=d.lastIndex,t;var u=c.groups,p=UNSUPPORTED_Y&&l.sticky,f=call$b(regexpFlags,l),m=l.source,g=0,y=h;if(p&&(f=replace$5(f,"y",""),-1===indexOf(f,"g")&&(f+="g"),y=stringSlice$6(h,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==charAt$6(h,l.lastIndex-1))&&(m="(?: "+m+")",y=" "+y,g++),r=new RegExp("^(?:"+m+")",f)),NPCG_INCLUDED&&(r=new RegExp("^"+m+"$(?!\\s)",f)),UPDATES_LAST_INDEX_WRONG&&(n=l.lastIndex),i=call$b(nativeExec,p?r:l,y),p?i?(i.input=stringSlice$6(i.input,g),i[0]=stringSlice$6(i[0],g),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),NPCG_INCLUDED&&i&&i.length>1&&call$b(nativeReplace,i[0],r,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)})),i&&u)for(i.groups=a=create$3(null),s=0;s<u.length;s++)a[(o=u[s])[0]]=i[o[1]];return i});var regexpExec$2=patchedExec,$$8=_export,exec$3=regexpExec$2;$$8({target:"RegExp",proto:!0,forced:/./.exec!==exec$3},{exec:exec$3});var NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$1=FunctionPrototype.apply,call$a=FunctionPrototype.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$1?call$a.bind(apply$1):function(){return call$a.apply(apply$1,arguments)}),classofRaw=classofRaw$2,uncurryThis$e=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw(e))return uncurryThis$e(e)},uncurryThis$d=functionUncurryThisClause,defineBuiltIn$6=defineBuiltIn$8,regexpExec$1=regexpExec$2,fails$9=fails$l,wellKnownSymbol$c=wellKnownSymbol$g,createNonEnumerableProperty$2=createNonEnumerableProperty$5,SPECIES=wellKnownSymbol$c("species"),RegExpPrototype$2=RegExp.prototype,fixRegexpWellKnownSymbolLogic=function(e,t,r,n){var i=wellKnownSymbol$c(e),s=!fails$9((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=s&&!fails$9((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[SPECIES]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!s||!a||r){var o=uncurryThis$d(/./[i]),l=t(i,""[e],(function(e,t,r,n,i){var a=uncurryThis$d(e),l=t.exec;return l===regexpExec$1||l===RegExpPrototype$2.exec?s&&!i?{done:!0,value:o(t,r,n)}:{done:!0,value:a(r,t,n)}:{done:!1}}));defineBuiltIn$6(String.prototype,e,l[0]),defineBuiltIn$6(RegExpPrototype$2,i,l[1])}n&&createNonEnumerableProperty$2(RegExpPrototype$2[i],"sham",!0)},uncurryThis$c=functionUncurryThis,toIntegerOrInfinity$1=toIntegerOrInfinity$4,toString$6=toString$8,requireObjectCoercible$5=requireObjectCoercible$8,charAt$5=uncurryThis$c("".charAt),charCodeAt$1=uncurryThis$c("".charCodeAt),stringSlice$5=uncurryThis$c("".slice),createMethod$1=function(e){return function(t,r){var n,i,s=toString$6(requireObjectCoercible$5(t)),a=toIntegerOrInfinity$1(r),o=s.length;return a<0||a>=o?e?"":void 0:(n=charCodeAt$1(s,a))<55296||n>56319||a+1===o||(i=charCodeAt$1(s,a+1))<56320||i>57343?e?charAt$5(s,a):n:e?stringSlice$5(s,a,a+2):i-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},charAt$4=stringMultibyte.charAt,advanceStringIndex$1=function(e,t,r){return t+(r?charAt$4(e,t).length:1)},uncurryThis$b=functionUncurryThis,toObject$3=toObject$5,floor$3=Math.floor,charAt$3=uncurryThis$b("".charAt),replace$4=uncurryThis$b("".replace),stringSlice$4=uncurryThis$b("".slice),SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution$1=function(e,t,r,n,i,s){var a=r+e.length,o=n.length,l=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==i&&(i=toObject$3(i),l=SUBSTITUTION_SYMBOLS),replace$4(s,l,(function(s,l){var c;switch(charAt$3(l,0)){case"$":return"$";case"&":return e;case"`":return stringSlice$4(t,0,r);case"'":return stringSlice$4(t,a);case"<":c=i[stringSlice$4(l,1,-1)];break;default:var h=+l;if(0===h)return s;if(h>o){var d=floor$3(h/10);return 0===d?s:d<=o?void 0===n[d-1]?charAt$3(l,1):n[d-1]+charAt$3(l,1):s}c=n[h-1]}return void 0===c?"":c}))},call$9=functionCall,anObject$8=anObject$e,isCallable$7=isCallable$j,classof$4=classofRaw$2,regexpExec=regexpExec$2,$TypeError$5=TypeError,regexpExecAbstract=function(e,t){var r=e.exec;if(isCallable$7(r)){var n=call$9(r,e,t);return null!==n&&anObject$8(n),n}if("RegExp"===classof$4(e))return call$9(regexpExec,e,t);throw $TypeError$5("RegExp#exec called on incompatible receiver")},apply=functionApply,call$8=functionCall,uncurryThis$a=functionUncurryThis,fixRegExpWellKnownSymbolLogic$1=fixRegexpWellKnownSymbolLogic,fails$8=fails$l,anObject$7=anObject$e,isCallable$6=isCallable$j,isNullOrUndefined$2=isNullOrUndefined$5,toIntegerOrInfinity=toIntegerOrInfinity$4,toLength$1=toLength$3,toString$5=toString$8,requireObjectCoercible$4=requireObjectCoercible$8,advanceStringIndex=advanceStringIndex$1,getMethod$3=getMethod$5,getSubstitution=getSubstitution$1,regExpExec$1=regexpExecAbstract,wellKnownSymbol$b=wellKnownSymbol$g,REPLACE=wellKnownSymbol$b("replace"),max$1=Math.max,min$1=Math.min,concat$1=uncurryThis$a([].concat),push$3=uncurryThis$a([].push),stringIndexOf$1=uncurryThis$a("".indexOf),stringSlice$3=uncurryThis$a("".slice),maybeToString=function(e){return void 0===e?e:String(e)},REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails$8((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));fixRegExpWellKnownSymbolLogic$1("replace",(function(e,t,r){var n=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function(e,r){var n=requireObjectCoercible$4(this),i=isNullOrUndefined$2(e)?void 0:getMethod$3(e,REPLACE);return i?call$8(i,e,n,r):call$8(t,toString$5(n),e,r)},function(e,i){var s=anObject$7(this),a=toString$5(e);if("string"==typeof i&&-1===stringIndexOf$1(i,n)&&-1===stringIndexOf$1(i,"$<")){var o=r(t,s,a,i);if(o.done)return o.value}var l=isCallable$6(i);l||(i=toString$5(i));var c=s.global;if(c){var h=s.unicode;s.lastIndex=0}for(var d=[];;){var u=regExpExec$1(s,a);if(null===u)break;if(push$3(d,u),!c)break;""===toString$5(u[0])&&(s.lastIndex=advanceStringIndex(a,toLength$1(s.lastIndex),h))}for(var p="",f=0,m=0;m<d.length;m++){for(var g=toString$5((u=d[m])[0]),y=max$1(min$1(toIntegerOrInfinity(u.index),a.length),0),v=[],b=1;b<u.length;b++)push$3(v,maybeToString(u[b]));var S=u.groups;if(l){var E=concat$1([g],v,y,a);void 0!==S&&push$3(E,S);var C=toString$5(apply(i,void 0,E))}else C=getSubstitution(g,a,y,v,S,i);y>=f&&(p+=stringSlice$3(a,f,y)+C,f=y+g.length)}return p+stringSlice$3(a,f)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var whitespaces$2="\t\n\v\f\r \u2028\u2029\ufeff",uncurryThis$9=functionUncurryThis,requireObjectCoercible$3=requireObjectCoercible$8,toString$4=toString$8,whitespaces$1=whitespaces$2,replace$3=uncurryThis$9("".replace),ltrim=RegExp("^["+whitespaces$1+"]+"),rtrim=RegExp("(^|[^"+whitespaces$1+"])["+whitespaces$1+"]+$"),createMethod=function(e){return function(t){var r=toString$4(requireObjectCoercible$3(t));return 1&e&&(r=replace$3(r,ltrim,"")),2&e&&(r=replace$3(r,rtrim,"$1")),r}},stringTrim={start:createMethod(1),end:createMethod(2),trim:createMethod(3)},PROPER_FUNCTION_NAME$2=functionName.PROPER,fails$7=fails$l,whitespaces=whitespaces$2,non="
",stringTrimForced=function(e){return fails$7((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME$2&&whitespaces[e].name!==e}))},$$7=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$7({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var wellKnownSymbol$a=wellKnownSymbol$g,create$2=objectCreate,defineProperty$4=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$a("unscopables"),ArrayPrototype$1=Array.prototype;null==ArrayPrototype$1[UNSCOPABLES]&&defineProperty$4(ArrayPrototype$1,UNSCOPABLES,{configurable:!0,value:create$2(null)});var addToUnscopables$2=function(e){ArrayPrototype$1[UNSCOPABLES][e]=!0},$$6=_export,$includes=arrayIncludes.includes,fails$6=fails$l,addToUnscopables$1=addToUnscopables$2,BROKEN_ON_SPARSE=fails$6((function(){return!Array(1).includes()}));$$6({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables$1("includes");var isObject$2=isObject$8,classof$3=classofRaw$2,wellKnownSymbol$9=wellKnownSymbol$g,MATCH$1=wellKnownSymbol$9("match"),isRegexp=function(e){var t;return isObject$2(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$3(e))},isRegExp=isRegexp,$TypeError$4=TypeError,notARegexp=function(e){if(isRegExp(e))throw $TypeError$4("The method doesn't accept regular expressions");return e},wellKnownSymbol$8=wellKnownSymbol$g,MATCH=wellKnownSymbol$8("match"),correctIsRegexpLogic=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[MATCH]=!1,"/./"[e](t)}catch(e){}}return!1},$$5=_export,uncurryThis$8=functionUncurryThis,notARegExp$1=notARegexp,requireObjectCoercible$2=requireObjectCoercible$8,toString$3=toString$8,correctIsRegExpLogic$1=correctIsRegexpLogic,stringIndexOf=uncurryThis$8("".indexOf);function __setFunctionName(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}$$5({target:"String",proto:!0,forced:!correctIsRegExpLogic$1("includes")},{includes:function(e){return!!~stringIndexOf(toString$3(requireObjectCoercible$2(this)),toString$3(notARegExp$1(e)),arguments.length>1?arguments[1]:void 0)}});const ArcwareStyles={customStyles:{":root":{"--color0":"#18181A !important","--color1":"#000000","--color2":"#FFFFFF","--color3":"#DAF693 !important","--color4":"#35b350","--color5":"#ffab00","--color6":"#858588 !important","--color7":"#B5B5B7 !important","--color8":"#41008c","--color9":"#3e0070","--color10":"#2e0052","--color11":"rgba(65,0,139,1) !important","--color12":"#222224 !important","--color13":"#f0f0f2 !important","--colorBoxShadow":"rgba(0, 0, 0, 0.20) !important"},"*":{fontFamily:"system-ui"},"#shared-stream-container":{boxSizing:"border-box"},"#shared-stream-container::-webkit-scrollbar":{width:"10px"},"#shared-stream-container::-webkit-scrollbar-track":{background:"var(--color13)",opacity:"0.5",borderRadius:"30px",borderTop:"20px solid var(--color0)",borderRight:"5px solid var(--color0)",borderBottom:"20px solid var(--color0)",borderLeft:"5px solid var(--color0)"},"#shared-stream-container::-webkit-scrollbar-track-piece":{background:"transparent"},"#shared-stream-container::-webkit-scrollbar-thumb":{background:"var(--color13)",width:"8px",borderRight:"2px solid var(--color0)",borderLeft:"2px solid var(--color0)",transition:"all ease-in-out 0.3s",borderRadius:"7px"},"#shared-stream-container::-webkit-scrollbar-thumb:hover":{transition:"all ease-in-out 0.3s",background:"var(--color3)"},"#playerUI, #videoElementParent":{position:"absolute",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",top:0,right:0,bottom:0,left:0,margin:"auto",boxSizing:"border-box",pointerEvents:"all"},"#streamingVideo":{maxWidth:"100%",maxHeight:"100%",boxSizing:"border-box",background:"#18181A"},"#uiFeatures #controls":{top:"auto",left:"auto",bottom:"10px",right:"20px",display:"flex",flexDirection:"column-reverse"},"#uiFeatures #connection":{bottom:"5px",left:"10px",width:"2.5rem",heihgt:"2.5rem"},"#uiFeatures button":{backgroundColor:"var(--color12)",border:"none",position:"relative",width:"45px",height:"45px",padding:"0.5rem",textAlign:"center",cursor:"pointer",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",boxShadow:"0px 0px 24px 0px var(--colorBoxShadow)",borderRadius:"3px",outline:"none"},"#uiFeatures button:hover, #uiFeatures button:active":{padding:"0 !important",border:"none"},"#uiFeatures button #audioIconMuted, #uiFeatures button #audioIconUnmuted, #uiFeatures button #micIconMuted, #uiFeatures button #micIconUnmuted":{width:"31px",height:"28px"},"#uiFeatures button #maximizeIcon, #uiFeatures button #minimizeIcon":{width:"25px",height:"25px"},"#stopIcon, #playIcon":{width:"30px",height:"30px"},"#uiFeatures button .tooltiptext":{right:"125%",left:"auto",boxShadow:"0px 0px 24px 0px var(--colorBoxShadow)",borderRadius:"3px",backgroundColor:"var(--color12)",width:"95px",visibility:"hidden!important"},"@media (hover: hover) and (pointer: fine)":{"#uiFeatures button:hover .tooltiptext":{visibility:"visible!important"}},"#controls>*":{marginBottom:"0.5rem",display:"block",lineHeight:"1.75rem",padding:"0.5rem",backgroundColor:"var(--color12)"},"#uiFeatures #settingsIcon, #uiFeatures #statsIcon":{width:"27px",height:"27px"},".svgIcon":{fill:"var(--color13)"},"#uiFeatures button:hover .svgIcon, #uiFeatures button:active .svgIcon":{fill:"var(--color12)"},".tgl-switch .tgl-slider, .tgl-flat:checked+.tgl-slider":{border:"3px solid transparent"},".tgl-switch .tgl-slider":{background:"none"},".tgl-switch .tgl-slider::before":{content:"''",display:"block",background:"var(--color6)",position:"absolute",height:"50%",width:"90%",borderRadius:"5px",margin:"auto",top:"0",bottom:"0",left:"0",right:"0"},".tgl-switch .tgl-slider::after":{height:"13px",width:"13px",borderRadius:"50%",top:"-2px",left:"-1%"},".tgl-flat:checked+.tgl-slider:after":{left:"62%",background:"var(--color3)"},".form-control":{backgroundColor:"transparent",border:"1px solid var(--color13)",borderRadius:"2px",color:"var(--color13)",textAlign:"left",fontFamily:"inherit",padding:"5px 15px "},".btn-flat":{background:"var(--color3)",color:"var(--color12)",border:"none",padding:"7px 50px",cursor:"pointer",borderRadius:"4px",textTransform:"uppercase",minWidth:"175px"},".btn-flat:disabled":{background:"var(--color7)",borderColor:"var(--color3)",color:"var(--color3)",cursor:"default"},".btn-flat:focus":{outline:"none"},".arcware-logo-loader":{position:"relative",display:"block",width:"12.5%",height:"12.5%"},"#playOverlay img#playButton":{width:"5%"},"#disconnectOverlay, #errorOverlay":{textTransform:"initial",textAlign:"center",fontSize:"20px",lineHeight:2.5},"#disconnectOverlay .clickableState":{textTransform:"initial",textAlign:"center",color:"#DAF693",padding:"5px",fontSize:"18px",border:"1px solid #DAF693",margin:"25px auto 0",width:"180px"},"#afkOverlay":{background:"none",transition:"all ease-in-out 0.5s",opacity:1,pointerEvents:"initial"},"#afkOverlayInner":{textTransform:"initial",background:"#18181A",padding:"20px 10px 30px",fontSize:"18px",width:"360px",textAlign:"center",lineHeight:2.5},"#afkOverlayInner center::first-line":{textTransform:"uppercase",color:"#FF8461",fontWeight:"bold",fontSize:"24px"},"#afkOverlayInner #afkCountDownNumber":{color:"#DAF693",fontSize:"26px",lineHeight:"22px"},"#afkOverlayInner center .retry-button":{textTransform:"initial",textAlign:"center",color:"#DAF693",padding:"5px",fontSize:"18px",border:"1px solid #DAF693",margin:"25px auto 0",width:"180px"},"#connectOverlay #connectButton":{textTransform:"initial",textAlign:"center",color:"#DAF693",padding:"5px 5px 8px",fontSize:"18px",border:"1px solid #DAF693",margin:"25px auto 0",width:"180px"},"#connectOverlay .connection-text":{textTransform:"initial",textAlign:"center",margin:"25px auto 0"},"#connectOverlay .connection-text .title":{color:"#ffffff",fontSize:"18px",margin:"5px 0"},"#connectOverlay .connection-text .subtitle":{color:"#ffffff",opacity:.5,fontSize:"12px",margin:"10px 0"},"#infoOverlay.hiddenState":{display:"none"},"#disconnectOverlay, #playOverlay, #errorOverlay, #microphoneOverlay, #connectOverlay":{background:"#18181A",display:"flex",transition:"all ease-in-out 0.5s",opacity:1,pointerEvents:"initial"},"#microphoneOverlay":{textTransform:"initial",padding:"20px 30px",fontSize:"14px",height:"230px",width:"360px",textAlign:"center",lineHeight:1.25,position:"absolute",margin:"auto",top:"0",bottom:"0",left:"0",right:"0",justifyContent:"center",alignItems:"center",flexDirection:"column",zIndex:99999},"#microphoneOverlay .title":{fontSize:"24px",position:"relative",marginBottom:"20px",color:"#F0F0F2"},"#microphoneOverlay .title:after":{content:"''",display:"inline-block",animation:"dotty steps(1,end) 1s infinite",position:"absolute"},"#microphoneOverlay p":{margin:0,color:"#858588"},"#microphoneOverlay svg":{height:"65px",marginBottom:"15px",marginTop:"-5px"},"#microphoneOverlay .svgIcon":{fill:"#DAF693"},"#disconnectOverlay.hiddenState, #playOverlay.hiddenState, #errorOverlay.hiddenState, #afkOverlay.hiddenState, #microphoneOverlay.hiddenState":{opacity:0,pointerEvents:"none"},"#disconnectOverlay.mic-overlay-is-visible, #errorOverlay.mic-overlay-is-visible, #infoOverlay.mic-overlay-is-visible":{opacity:0,pointerEvents:"none"},"#infoOverlay.hiddenState, #connectOverlay.hiddenState":{display:"none"},"#connectOverlay":{display:"flex",flexDirection:"column-reverse",alignItems:"center",justifyContent:"center"},"#infoOverlay":{display:"none"},".love-letters-box-root":{display:"flex",position:"absolute",width:"100%",height:"100%",color:"#ffffff",justifyContent:"center",alignItems:"center",flexDirection:"column",background:"#18181A",zIndex:1},".love-letters-box-root.fade-out":{opacity:0,transition:"opacity 0.5s"},"#letters-block":{position:"absolute",top:0,left:0,right:0,bottom:0,margin:"auto",color:"#ffffff",zIndex:4,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",fontSize:"16px",textTransform:"initial",textAlign:"center"},"#letters-wrapper":{height:"77px",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",marginTop:"10px",paddingBottom:"2px"},"#letters-wrapper p":{textAlign:"center",lineHeight:1.25,fontSize:"16px"},".letter-animation:nth-last-of-type(1)::after":{display:"inline-block",animation:"dotty steps(1,end) 1s infinite",content:"''",position:"absolute"},".letter-animation":{transition:"all 0.5s ease-in-out",transformOrigin:"bottom",margin:"0 auto"},".letter-animation-enter":{animation:"fadeInUp 0.75s ease-out"},".letter-animation-exit":{opacity:0,scale:.9,transition:"all ease-in-out 1s",margin:0},"@keyframes dotty":{"0%":{content:"''"},"25%":{content:"'.'"},"50%":{content:"'..'"},"75%":{content:"'...'"},"100%":{content:"''"}},"@keyframes fadeInUp":{from:{opacity:0,transform:" translateY(5px)",scale:.9},to:{opacity:1,transform:"translateY(0)",scale:1}},".hidden":{display:"none",opacity:0},".visible":{display:"block",opacity:1,transition:"opacity 1s ease-out"}}};class AudioIcon{constructor(){this.audioIconUnmuted=this.createAudioIconUnmuted(),this.audioIconMuted=this.createAudioIconMuted()}createAudioIconUnmuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","audioIconUnmuted"),t.setAttributeNS(null,"x","31px"),t.setAttributeNS(null,"y","28px"),t.setAttributeNS(null,"viewBox","0 0 31 28");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M21.0008,0.0720318C20.556,-0.117811,20.0379,0.0805569,19.8435,0.514827C19.6492,0.949098,19.8522,1.45512,20.297,1.6449C25.1233,3.70434,28.242,8.35761,28.2422,13.4998C28.2422,18.6423,25.1234,23.2957,20.2966,25.3551C19.8518,25.5448,19.6488,26.0508,19.8431,26.4852C19.9874,26.8077,20.3102,27,20.649,27C20.7664,27,20.8859,26.9769,21.0004,26.928C26.4674,24.5954,30,19.3246,30,13.4997C29.9998,7.67531,26.4674,2.40462,21.0008,0.0720318Z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M21.2351,6.69434C20.8735,6.37822,20.3179,6.4082,19.9941,6.76134C19.6703,7.11454,19.701,7.65706,20.0627,7.97324C21.6712,9.37932,22.5937,11.3937,22.5937,13.5C22.5937,15.6062,21.6711,17.6206,20.0627,19.0267C19.701,19.3428,19.6703,19.8854,19.9941,20.2386C20.1677,20.4279,20.4079,20.5244,20.6492,20.5244C20.8579,20.5244,21.0674,20.4522,21.2351,20.3056C23.2157,18.5744,24.3515,16.0937,24.3515,13.4999C24.3515,10.9061,23.2156,8.42553,21.2351,6.69434Z");const s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttributeNS(null,"d","M15.3973,2.16277C15.1018,2.01658,14.7473,2.04502,14.4803,2.23623L7.65176,7.12598H0.878906C0.393516,7.12598,0,7.51024,0,7.98422V19.0155C0,19.4895,0.393516,19.8738,0.878906,19.8738H7.6517L14.4802,24.7637C14.6339,24.8737,14.8164,24.9298,15.0001,24.9298C15.1356,24.9298,15.2718,24.8992,15.3973,24.8371C15.6927,24.6909,15.8789,24.395,15.8789,24.0716V2.9282C15.8789,2.60482,15.6927,2.30884,15.3973,2.16277ZM14.121,22.3778L8.45918,18.3234C8.30842,18.2154,8.12637,18.1572,7.93939,18.1572H1.75781V8.84246H7.93939C8.12631,8.84246,8.30842,8.78422,8.45912,8.67636L14.121,4.62197V22.3778Z"),r.appendChild(n),r.appendChild(i),r.appendChild(s),t}createAudioIconMuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","audioIconMuted"),t.setAttributeNS(null,"x","31px"),t.setAttributeNS(null,"y","28px"),t.setAttributeNS(null,"viewBox","0 -1 31 28");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M16.3501,0.829286C16.046,0.678799,15.6811,0.708072,15.4062,0.904912L8.37681,5.93848H1.40476C0.90509,5.93848,0.5,6.33404,0.5,6.82196V18.1777C0.5,18.6657,0.90509,19.0612,1.40476,19.0612H8.37675L15.4061,24.0949C15.5643,24.2082,15.7522,24.2659,15.9412,24.2659C16.0808,24.2659,16.221,24.2344,16.3501,24.1705C16.6542,24.02,16.8459,23.7154,16.8459,23.3825V1.61724C16.8459,1.28434,16.6542,0.979655,16.3501,0.829286ZM15.0364,21.6389L9.20798,17.4652C9.05278,17.3541,8.86538,17.2942,8.6729,17.2942H2.30951V7.70544H8.6729C8.86532,7.70544,9.05278,7.64548,9.20792,7.53446L15.0364,3.36082V21.6389Z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d","M25.2799,11.7634L21.8442,8.32748C21.6206,8.10399,21.6206,7.74264,21.8442,7.51915C22.0676,7.29566,22.429,7.29566,22.6525,7.51915L26.0883,10.955L29.524,7.51915C29.7476,7.29566,30.1088,7.29566,30.3323,7.51915C30.5559,7.74264,30.5559,8.10399,30.3323,8.32748L26.8966,11.7634L30.3323,15.1992C30.5559,15.4227,30.5559,15.7841,30.3323,16.0076C30.2209,16.1191,30.0745,16.1751,29.9281,16.1751C29.7818,16.1751,29.6355,16.1191,29.524,16.0076L26.0883,12.5717L22.6525,16.0076C22.541,16.1191,22.3947,16.1751,22.2483,16.1751C22.102,16.1751,21.9556,16.1191,21.8442,16.0076C21.6206,15.7841,21.6206,15.4227,21.8442,15.1992L25.2799,11.7634Z"),r.appendChild(n),r.appendChild(i),t}}class AudioButton{constructor(e){this.stream=e,this.setAudioMutedByDefault(),this.button=this.createButton(),this.audioIcon=new AudioIcon,this.tooltipText=this.createTooltipText(),this.button.appendChild(this.tooltipText),this.button.appendChild(this.audioIcon.audioIconMuted),this.button.appendChild(this.audioIcon.audioIconUnmuted),this.audioIcon.audioIconUnmuted.style.display="none",this.button.addEventListener("click",this.toggleAudio.bind(this)),this.onVolumeChange=this.onVolumeChange.bind(this);this.stream.webRtcController.videoPlayer.videoElement.addEventListener("volumechange",this.onVolumeChange.bind(this))}setAudioMutedByDefault(){const e=this.stream.videoElementParent;if(e){const t=e.querySelector("video");t&&this.stream.toggleAudio(t,!0)}}createButton(){var e;const t=document.createElement("button");return null==t||t.setAttribute("id","audioBtn"),null==t||t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Mute/Unmute",t}toggleAudio(){const e=this.stream.videoElementParent;if(e){const t=e.querySelector("video");if(t){const e=!t.muted;this.stream.toggleAudio(t,e),this.updateAudioIcon(e)}}}updateAudioIcon(e){e?(this.audioIcon.audioIconUnmuted.style.display="none",this.audioIcon.audioIconMuted.style.display="block"):(this.audioIcon.audioIconMuted.style.display="none",this.audioIcon.audioIconUnmuted.style.display="block")}get element(){return this.button}onVolumeChange(e){const t=e.target;this.updateAudioIcon(t.muted)}}class MicIcon{constructor(){this.micIconUnmuted=this.createMicIconUnmuted(),this.micIconMuted=this.createMicIconMuted()}createMicIconUnmuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","micIconUnmuted"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M12 14c1.66,0,2.99-1.34,2.99-3L15,5c0-1.66-1.34-3-3-3S9,3.34,9,5v6c0,1.66,1.34,3,3,3zm5.3-3c0,3-2.54,5.1-5.3,5.1S6.7,14,6.7,11H5c0,3.41,2.72,6.23,6,6.72V21h2v-3.28c3.28-.48,6-3.3,6-6.72h-1.7z"),r.appendChild(n),t}createMicIconMuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","micIconMuted"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M19,11h-1.7c0,.74-.16,1.43-.43,2.05l1.23,1.23c.56-.98.9-2.09.9-3.28zm-4.02.17c0-.06.02-.11.02-.17V5c0-1.66-1.34-3-3-3S9,3.34,9,5v.18l5.98,5.99zM4.27,3,3,4.27l6.01,6.01V11c0,1.66,1.33,3,2.99,3,.22,0,.44-.03.65-.08l1.66,1.66c-.71.33-1.5.52-2.31.52-2.76,0-5.3-2.1-5.3-5.1H5c0,3.41,2.72,6.23,6,6.72V21h2v-3.28c.91-.13,1.77-.45,2.54-.9L19.73,21,21,19.73,4.27,3z"),r.appendChild(n),t}}class MicButton{constructor(e){this.stream=e,this.setMicMutedByDefault(),this.button=this.createButton(),this.micIcon=new MicIcon,this.tooltipText=this.createTooltipText(),this.button.appendChild(this.tooltipText),this.button.appendChild(this.micIcon.micIconMuted),this.button.appendChild(this.micIcon.micIconUnmuted),this.micIcon.micIconUnmuted.style.display="none",this.button.addEventListener("click",this.toggleMic.bind(this))}setMicMutedByDefault(){const e=this.stream.videoElementParent;if(e){e.querySelector("video")&&this.stream.toggleMic(!1,!0)}}createButton(){var e;const t=document.createElement("button");return t.setAttribute("id","micBtn"),t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Mic on/off",t}toggleMic(){var e,t;const r=null===(t=null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.isFlagEnabled(Ot.UseMic);this.stream.toggleMic(!r,!1),this.updateMicIcon(!r)}updateMicIcon(e){e?(this.micIcon.micIconMuted.style.display="none",this.micIcon.micIconUnmuted.style.display="block"):(this.micIcon.micIconUnmuted.style.display="none",this.micIcon.micIconMuted.style.display="block")}get element(){return this.button}}class StopIcon{constructor(){this.stopIcon=this.createStopIcon()}createStopIcon(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","stopIcon"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),null==t||t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M6 6h12v12H6z"),r.appendChild(n),t}}class PlayIcon{constructor(){this.playIcon=this.createPlayIcon()}createPlayIcon(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","playIcon"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 0 24 24");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M8 5v14l11-7z"),r.appendChild(n),t}}class StopButton{constructor(e){this.isStreaming=!0,this.stream=e,this.button=this.createButton(),this.stopIcon=new StopIcon,this.playIcon=new PlayIcon,this.tooltipText=this.createTooltipText(),this.button.appendChild(this.tooltipText),this.button.appendChild(this.stopIcon.stopIcon),this.button.addEventListener("click",this.toggleStreaming.bind(this)),e.onStreamingStateChange(this.updateButtonState.bind(this))}createButton(){var e;const t=document.createElement("button");return null==t||t.setAttribute("id","stopBtn"),null==t||t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Disconnect",t}toggleStreaming(){var e;this.isStreaming=!this.isStreaming,this.updateButtonIcon(),this.isStreaming?null===(e=this.stream)||void 0===e||e.webRtcController.restartStreamAutomatically():this.stream.disconnect()}updateButtonIcon(){const e=this.isStreaming?this.stopIcon.stopIcon:this.playIcon.playIcon,t=this.isStreaming?"Disconnect":"Reconnect";this.tooltipText.innerHTML=t,this.button.firstChild&&this.button.removeChild(this.button.children[1]),this.button.appendChild(e)}get element(){return this.button}updateButtonState(e){this.isStreaming=e,this.updateButtonIcon()}}var _a;const TextKeyRegex=/^(\['([a-zA-Z 0-9-_]+)'\] )/;function findElementByTextContent(e,t){const r=TextKeyRegex.exec(t);if(!r)return null;const n=t.replace(r[1],""),i=r[2].trim(),s=(e||document).querySelectorAll(n);let a=null;return s.forEach((e=>{var t;null==e||e.innerHTML.trim(),!a&&(null===(t=null==e?void 0:e.innerHTML)||void 0===t?void 0:t.includes(`>${i}<`))&&(a=e)})),a}const removals={"#StreamerId":!0,"#ss":!0,"#TimeoutIfIdle":!0,"#OfferToReceive":!0,"#preferSFU":!0,"#ForceTURN":!0,"#LightMode":!0,"#UseMic":!0,"#MatchViewportRes":!0,"#HoveringMouse":!0,"['AFK timeout'] div.setting.form-group:not([id])":!0,"['Encoder'] section.settingsContainer:not([id])":!0,"['WebRTC'] section.settingsContainer:not([id])":!0,"['UI'] section.settingsContainer:not([id])":!0};function remove(e,t){!0===removals[e]&&t&&(t.style.display="none")}class ArcwareApplication extends G{get rootElement(){return super.rootElement}constructor(e){var t,r,n,i,s,a,o,l,c,h,d,u;super(e),this.responseCallback=null,this.ArcwareSection=this.configUI.buildSectionWithHeading(this.settingsPanel.settingsContentElement,"Arcware Cloud"),this.stream=null==e?void 0:e.stream,this.emitUIInteraction=this.emitUIInteraction.bind(this),this.adjustSettingsPanel(),this.createAudioToggleButton(),this.createMicToggleButton(),this.createStopButton(),this.applyArcwareStyles(),this.videoElementParent=null===(t=null==this?void 0:this.stream)||void 0===t?void 0:t.videoElementParent,this.parentElement=null===(r=null==this?void 0:this.videoElementParent)||void 0===r?void 0:r.parentElement,this.webRtcController=null===(n=null==this?void 0:this.stream)||void 0===n?void 0:n._webRtcController,null===(s=null===(i=null==this?void 0:this.stream)||void 0===i?void 0:i.loveLetterHandler)||void 0===s||s.add((e=>{var t,r,n;if((null==this?void 0:this.playOverlay)&&e&&(null==this?void 0:this.parentElement)){const i=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#infoOverlay");if(i){null===(r=null==i?void 0:i.classList)||void 0===r||r.remove("hiddenState");const t=null==i?void 0:i.querySelector("#messageOverlayInner");t&&(t.innerHTML=null===(n=null==e?void 0:e.reason)||void 0===n?void 0:n.replace("LL: ",""))}}})),null===(a=null==this?void 0:this.stream)||void 0===a||a.addResponseEventListener("ue-response",(e=>null==this?void 0:this.applicationResponse(e))),null===(l=null===(o=null==this?void 0:this.stream)||void 0===o?void 0:o.sessionIdHandler)||void 0===l||l.add((e=>{var t;null===(t=null==this?void 0:this.statsPanel)||void 0===t||t.addOrUpdateStat("sessionId","SessionId",e)})),null===(h=null===(c=null==this?void 0:this.stream)||void 0===c?void 0:c.videoInitializedHandler)||void 0===h||h.add((()=>{var e,t,r;null===(e=null==this?void 0:this.currentOverlay)||void 0===e||e.hide(),(null===(t=null==this?void 0:this.stream)||void 0===t?void 0:t.streamInfo)&&(null==this||this.autoPlayHandler(null===(r=null==this?void 0:this.stream)||void 0===r?void 0:r.streamInfo))}));null===(u=null===(d=null==this?void 0:this.stream)||void 0===d?void 0:d.videoInitializedHandler)||void 0===u||u.add((()=>{null==this||this.uiDefaultButtonVisibilty("fullscreenButton","#fullscreen-btn"),null==this||this.uiDefaultButtonVisibilty("settingsButton","#settingsBtn"),null==this||this.uiDefaultButtonVisibilty("infoButton","#statsBtn"),null==this||this.uiDefaultButtonVisibilty("audioButton","#audioBtn"),null==this||this.uiDefaultButtonVisibilty("stopButton","#stopBtn"),null==this||this.uiDefaultButtonVisibilty("connectionStrengthIcon","#connection"),null==this||this.uiDefaultButtonVisibilty("micButton","#micBtn"),this.uiElementsVisibility(!0)}).bind(this)),this.uiElementsVisibility(!1),this.addTextToConnectOverlay(),this.preventDefaultKeyboardEvents()}uiElementsVisibility(e){var t,r,n,i,s,a,o,l,c,h;const d=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#controls");d&&(e?(null===(r=null==d?void 0:d.classList)||void 0===r||r.remove("hidden"),null===(n=null==d?void 0:d.classList)||void 0===n||n.add("visible")):(null===(i=null==d?void 0:d.classList)||void 0===i||i.remove("visible"),null===(s=null==d?void 0:d.classList)||void 0===s||s.add("hidden")));const u=null===(a=null==this?void 0:this.parentElement)||void 0===a?void 0:a.querySelector("#connection");u&&(e?(null===(o=null==u?void 0:u.classList)||void 0===o||o.remove("hidden"),null===(l=null==u?void 0:u.classList)||void 0===l||l.add("visible")):(null===(c=null==u?void 0:u.classList)||void 0===c||c.remove("visible"),null===(h=null==u?void 0:u.classList)||void 0===h||h.add("hidden")))}adjustSettingsPanel(){var e,t,r,n,i,s,a,o,l,c,h,d,u,p;const f=null===(e=null==this?void 0:this.ArcwareSection)||void 0===e?void 0:e.parentElement;f&&(null==f||f.removeChild(null==this?void 0:this.ArcwareSection),null==f||f.insertBefore(null==this?void 0:this.ArcwareSection,null==f?void 0:f.firstChild));const m=null===(t=null==this?void 0:this.settingsPanel)||void 0===t?void 0:t.settingsContentElement;if(m){m.style.minWidth="400px";for(const e in removals)if(TextKeyRegex.test(e)){remove(e,findElementByTextContent(m,e))}else{remove(e,m.querySelector(e))}const e=findElementByTextContent(m,"['Restart Stream'] section > div.setting");if(e){const t=null==e?void 0:e.querySelector("div");t&&(t.textContent="Reconnect to Stream");const r=null==e?void 0:e.querySelector("label > input");r&&(r.value="reconnect")}}{const e=document.createElement("div");null===(r=null==e?void 0:e.classList)||void 0===r||r.add("setting"),e.textContent="Keep in mind, these settings will be applied in your current session only.",e.style.paddingBottom="15px",null===(n=null==this?void 0:this.ArcwareSection)||void 0===n||n.appendChild(e)}null===(i=null==this?void 0:this.ArcwareSection)||void 0===i||i.appendChild(new ot(new ts(null===(s=null==ArcwareApplication?void 0:ArcwareApplication.Flags)||void 0===s?void 0:s.noSession,"Disable SessionId","Disable sessionId based reconnection.",null===(o=null===(a=null==this?void 0:this.stream)||void 0===a?void 0:a.session)||void 0===o?void 0:o.noSession,!0)).rootElement),null===(l=null==this?void 0:this.ArcwareSection)||void 0===l||l.appendChild(new rt(new rs("signalling-url","Signalling URL","Signalling URL",`${null===(h=null===(c=null==this?void 0:this.stream)||void 0===c?void 0:c.config)||void 0===h?void 0:h.getTextSettingValue("ss")}?${null===(p=null===(u=null===(d=null==this?void 0:this.stream)||void 0===d?void 0:d.config)||void 0===u?void 0:u.urlFlags)||void 0===p?void 0:p.slice(1)}`,!1)).rootElement)}createAudioToggleButton(){var e;const t=new AudioButton(null==this?void 0:this.stream),r=(null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.videoElementParent).parentElement;if(r){const e=null==r?void 0:r.querySelector("#uiFeatures");if(e){const r=null==e?void 0:e.querySelector("#controls");r&&(null==r||r.appendChild(null==t?void 0:t.element))}}}createMicToggleButton(){var e;const t=new MicButton(null==this?void 0:this.stream),r=(null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.videoElementParent).parentElement;if(r){const e=null==r?void 0:r.querySelector("#uiFeatures");if(e){const r=null==e?void 0:e.querySelector("#controls");r&&(null==r||r.appendChild(null==t?void 0:t.element))}}}createStopButton(){var e,t,r,n;if(!0===(null===(r=null===(t=null===(e=this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.settings)||void 0===r?void 0:r.stopButton)){const e=new StopButton(null==this?void 0:this.stream),t=(null===(n=null==this?void 0:this.stream)||void 0===n?void 0:n.videoElementParent).parentElement;if(t){const r=null==t?void 0:t.querySelector("#uiFeatures");if(r){const t=null==r?void 0:r.querySelector("#controls");t&&(null==t||t.appendChild(null==e?void 0:e.element))}}}}uiDefaultButtonVisibilty(e,t){var r,n,i;if(null==this?void 0:this.parentElement){const s=null===(r=null==this?void 0:this.parentElement)||void 0===r?void 0:r.querySelector(t);if(!1===(null===(i=null===(n=null==this?void 0:this.stream)||void 0===n?void 0:n.config)||void 0===i?void 0:i.settings[e])&&s){null==s||s.remove();const t=this.uiFeaturesElement,r=t.querySelector("#stats-panel"),n=t.querySelector("#settings-panel");t&&("infoButton"===e&&(null==r||r.remove()),"settingsButton"===e&&(null==n||n.remove()))}const a=/iPad|iPhone|iPod/.test(null===navigator||void 0===navigator?void 0:navigator.userAgent);"fullscreenButton"===e&&a&&s&&(null==s||s.remove())}}preventDefaultKeyboardEvents(){if(this.videoElementParent){this.videoElementParent.addEventListener("keydown",(function(e){"Tab"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),e.stopPropagation())}),!0);this.uiFeaturesElement.querySelectorAll("button").forEach((e=>{e.addEventListener("keydown",(function(t){" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),e.blur())}))}))}}autoPlayHandler(e){var t;const{videoPlayer:r}=null==this?void 0:this.webRtcController,n=null===(t=null==e?void 0:e.streamInfo)||void 0===t?void 0:t.autoPlay,i=null==r?void 0:r.isPaused();if(n&&i&&r){const e=null==r?void 0:r.getVideoElement();if(e){const t=null==e?void 0:e.parentElement;if(t){const e=null==t?void 0:t.querySelector("#playOverlay");e&&(null==e||e.remove())}null==e||e.play()}}}getApplicationResponse(e){var t;null===(t=null==this?void 0:this.stream)||void 0===t||t.addResponseEventListener("ue-response",(t=>{e(t)}))}applicationResponse(e){(null==this?void 0:this.responseCallback)&&(null==this||this.responseCallback(e))}applyArcwareStyles(){const e=new st(ArcwareStyles);null==e||e.applyStyleSheet()}emitUIInteraction(e){var t;e&&(null===(t=null==this?void 0:this.webRtcController)||void 0===t||t.emitUIInteraction(e))}addTextToConnectOverlay(){var e,t,r,n;if(!(null===(r=null===(t=null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.initialSettings)||void 0===r?void 0:r.AutoConnect)&&this.videoElementParent){const e=null===(n=null==this?void 0:this.parentElement)||void 0===n?void 0:n.querySelector("#connectOverlay");if(e){const t=document.createElement("div");t.className="connection-text",e.appendChild(t);const r=document.createElement("p");r.className="title",r.textContent="Click on the button below to start the connection to the streaming.",t.appendChild(r);const n=document.createElement("p");n.className="subtitle",n.textContent="After clicking the button, it may take a few seconds for the connection to start. Don't worry if you don't see an immediate reaction.",t.appendChild(n)}}}}ArcwareApplication.Flags=(_a=class{},__setFunctionName(_a,"Flags"),_a.noSession="noSession",_a);var $$4=_export,uncurryThis$7=functionUncurryThisClause,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,toLength=toLength$3,toString$2=toString$8,notARegExp=notARegexp,requireObjectCoercible$1=requireObjectCoercible$8,correctIsRegExpLogic=correctIsRegexpLogic,nativeStartsWith=uncurryThis$7("".startsWith),stringSlice$2=uncurryThis$7("".slice),min=Math.min,CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic("startsWith"),MDN_POLYFILL_BUG=!(CORRECT_IS_REGEXP_LOGIC||(descriptor=getOwnPropertyDescriptor$1(String.prototype,"startsWith"),!descriptor||descriptor.writable)),descriptor;$$4({target:"String",proto:!0,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{startsWith:function(e){var t=toString$2(requireObjectCoercible$1(this));notARegExp(e);var r=toLength(min(arguments.length>1?arguments[1]:void 0,t.length)),n=toString$2(e);return nativeStartsWith?nativeStartsWith(t,n,r):stringSlice$2(t,r,r+n.length)===n}});var iterators={},fails$5=fails$l,correctPrototypeGetter=!fails$5((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$4=hasOwnProperty_1,isCallable$5=isCallable$j,toObject$2=toObject$5,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(e){var t=toObject$2(e);if(hasOwn$4(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$5(r)&&t instanceof r?r.prototype:t instanceof $Object?ObjectPrototype:null},fails$4=fails$l,isCallable$4=isCallable$j,isObject$1=isObject$8,getPrototypeOf$1=objectGetPrototypeOf,defineBuiltIn$5=defineBuiltIn$8,wellKnownSymbol$7=wellKnownSymbol$g,ITERATOR$6=wellKnownSymbol$7("iterator"),BUGGY_SAFARI_ITERATORS$1=!1,IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator;[].keys&&(arrayIterator=[].keys(),"next"in arrayIterator?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$1(getPrototypeOf$1(arrayIterator)),PrototypeOfArrayIteratorPrototype!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype)):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$1(IteratorPrototype$2)||fails$4((function(){var e={};return IteratorPrototype$2[ITERATOR$6].call(e)!==e}));NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={}),isCallable$4(IteratorPrototype$2[ITERATOR$6])||defineBuiltIn$5(IteratorPrototype$2,ITERATOR$6,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},defineProperty$3=objectDefineProperty.f,hasOwn$3=hasOwnProperty_1,wellKnownSymbol$6=wellKnownSymbol$g,TO_STRING_TAG$1=wellKnownSymbol$6("toStringTag"),setToStringTag$4=function(e,t,r){e&&!r&&(e=e.prototype),e&&!hasOwn$3(e,TO_STRING_TAG$1)&&defineProperty$3(e,TO_STRING_TAG$1,{configurable:!0,value:t})},IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$1=objectCreate,createPropertyDescriptor$2=createPropertyDescriptor$5,setToStringTag$3=setToStringTag$4,Iterators$4=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,n){var i=t+" Iterator";return e.prototype=create$1(IteratorPrototype$1,{next:createPropertyDescriptor$2(+!n,r)}),setToStringTag$3(e,i,!1),Iterators$4[i]=returnThis$1,e},uncurryThis$6=functionUncurryThis,aCallable$2=aCallable$4,functionUncurryThisAccessor=function(e,t,r){try{return uncurryThis$6(aCallable$2(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},isCallable$3=isCallable$j,$String=String,$TypeError$3=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$3(e))return e;throw $TypeError$3("Can't set "+$String(e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$6=anObject$e,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThisAccessor(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject$6(r),aPossiblePrototype(n),t?e(r,n):r.__proto__=n,r}}():void 0),$$3=_export,call$7=functionCall,FunctionName=functionName,isCallable$2=isCallable$j,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf=objectSetPrototypeOf,setToStringTag$2=setToStringTag$4,createNonEnumerableProperty$1=createNonEnumerableProperty$5,defineBuiltIn$4=defineBuiltIn$8,wellKnownSymbol$5=wellKnownSymbol$g,Iterators$3=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$5=wellKnownSymbol$5("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,n,i,s,a){createIteratorConstructor$1(r,t,n);var o,l,c,h=function(e){if(e===i&&m)return m;if(!BUGGY_SAFARI_ITERATORS&&e in p)return p[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",u=!1,p=e.prototype,f=p[ITERATOR$5]||p["@@iterator"]||i&&p[i],m=!BUGGY_SAFARI_ITERATORS&&f||h(i),g="Array"==t&&p.entries||f;if(g&&(o=getPrototypeOf(g.call(new e)))!==Object.prototype&&o.next&&(getPrototypeOf(o)!==IteratorPrototype&&(setPrototypeOf?setPrototypeOf(o,IteratorPrototype):isCallable$2(o[ITERATOR$5])||defineBuiltIn$4(o,ITERATOR$5,returnThis)),setToStringTag$2(o,d,!0)),PROPER_FUNCTION_NAME$1&&i==VALUES&&f&&f.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME?createNonEnumerableProperty$1(p,"name",VALUES):(u=!0,m=function(){return call$7(f,this)})),i)if(l={values:h(VALUES),keys:s?m:h(KEYS),entries:h(ENTRIES)},a)for(c in l)(BUGGY_SAFARI_ITERATORS||u||!(c in p))&&defineBuiltIn$4(p,c,l[c]);else $$3({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||u},l);return p[ITERATOR$5]!==m&&defineBuiltIn$4(p,ITERATOR$5,m,{name:i}),Iterators$3[t]=m,l},createIterResultObject$2=function(e,t){return{value:e,done:t}},toIndexedObject=toIndexedObject$5,addToUnscopables=addToUnscopables$2,Iterators$2=iterators,InternalStateModule$3=internalState,defineProperty$2=objectDefineProperty.f,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$2,DESCRIPTORS$4=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$3=InternalStateModule$3.set,getInternalState$1=InternalStateModule$3.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",(function(e,t){setInternalState$3(this,{type:ARRAY_ITERATOR,target:toIndexedObject(e),index:0,kind:t})}),(function(){var e=getInternalState$1(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,createIterResultObject$1(void 0,!0)):createIterResultObject$1("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),values=Iterators$2.Arguments=Iterators$2.Array;if(addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries"),DESCRIPTORS$4&&"values"!==values.name)try{defineProperty$2(values,"name",{value:"values"})}catch(e){}var domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},documentCreateElement=documentCreateElement$2,classList=documentCreateElement("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,global$3=global$g,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty=createNonEnumerableProperty$5,wellKnownSymbol$4=wellKnownSymbol$g,ITERATOR$4=wellKnownSymbol$4("iterator"),TO_STRING_TAG=wellKnownSymbol$4("toStringTag"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function(e,t){if(e){if(e[ITERATOR$4]!==ArrayValues)try{createNonEnumerableProperty(e,ITERATOR$4,ArrayValues)}catch(t){e[ITERATOR$4]=ArrayValues}if(e[TO_STRING_TAG]||createNonEnumerableProperty(e,TO_STRING_TAG,t),DOMIterables[t])for(var r in ArrayIteratorMethods)if(e[r]!==ArrayIteratorMethods[r])try{createNonEnumerableProperty(e,r,ArrayIteratorMethods[r])}catch(t){e[r]=ArrayIteratorMethods[r]}}};for(var COLLECTION_NAME in DOMIterables)handlePrototype(global$3[COLLECTION_NAME]&&global$3[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");var charAt$2=stringMultibyte.charAt,toString$1=toString$8,InternalStateModule$2=internalState,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$2,STRING_ITERATOR="String Iterator",setInternalState$2=InternalStateModule$2.set,getInternalState=InternalStateModule$2.getterFor(STRING_ITERATOR);defineIterator(String,"String",(function(e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString$1(e),index:0})}),(function(){var e,t=getInternalState(this),r=t.string,n=t.index;return n>=r.length?createIterResultObject(void 0,!0):(e=charAt$2(r,n),t.index+=e.length,createIterResultObject(e,!1))}));var fails$3=fails$l,wellKnownSymbol$3=wellKnownSymbol$g,DESCRIPTORS$3=descriptors,IS_PURE=isPure,ITERATOR$3=wellKnownSymbol$3("iterator"),urlConstructorDetection=!fails$3((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),IS_PURE&&!e.toJSON||!t.size&&(IS_PURE||!DESCRIPTORS$3)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$3]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),uncurryThis$5=functionUncurryThisClause,aCallable$1=aCallable$4,NATIVE_BIND=functionBindNative,bind$3=uncurryThis$5(uncurryThis$5.bind),functionBindContext=function(e,t){return aCallable$1(e),void 0===t?e:NATIVE_BIND?bind$3(e,t):function(){return e.apply(t,arguments)}},makeBuiltIn=makeBuiltIn$3.exports,defineProperty$1=objectDefineProperty,defineBuiltInAccessor$2=function(e,t,r){return r.get&&makeBuiltIn(r.get,t,{getter:!0}),r.set&&makeBuiltIn(r.set,t,{setter:!0}),defineProperty$1.f(e,t,r)},isPrototypeOf$1=objectIsPrototypeOf,$TypeError$2=TypeError,anInstance$2=function(e,t){if(isPrototypeOf$1(t,e))return e;throw $TypeError$2("Incorrect invocation")},DESCRIPTORS$2=descriptors,uncurryThis$4=functionUncurryThis,call$6=functionCall,fails$2=fails$l,objectKeys=objectKeys$2,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$1=toObject$5,IndexedObject=indexedObject,$assign=Object.assign,defineProperty=Object.defineProperty,concat=uncurryThis$4([].concat),objectAssign=!$assign||fails$2((function(){if(DESCRIPTORS$2&&1!==$assign({b:1},$assign(defineProperty({},"a",{enumerable:!0,get:function(){defineProperty(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys($assign({},t)).join("")!=n}))?function(e,t){for(var r=toObject$1(e),n=arguments.length,i=1,s=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;n>i;)for(var o,l=IndexedObject(arguments[i++]),c=s?concat(objectKeys(l),s(l)):objectKeys(l),h=c.length,d=0;h>d;)o=c[d++],DESCRIPTORS$2&&!call$6(a,l,o)||(r[o]=l[o]);return r}:$assign,call$5=functionCall,anObject$5=anObject$e,getMethod$2=getMethod$5,iteratorClose$1=function(e,t,r){var n,i;anObject$5(e);try{if(!(n=getMethod$2(e,"return"))){if("throw"===t)throw r;return r}n=call$5(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return anObject$5(n),r},anObject$4=anObject$e,iteratorClose=iteratorClose$1,callWithSafeIterationClosing$1=function(e,t,r,n){try{return n?t(anObject$4(r)[0],r[1]):t(r)}catch(t){iteratorClose(e,"throw",t)}},wellKnownSymbol$2=wellKnownSymbol$g,Iterators$1=iterators,ITERATOR$2=wellKnownSymbol$2("iterator"),ArrayPrototype=Array.prototype,isArrayIteratorMethod$1=function(e){return void 0!==e&&(Iterators$1.Array===e||ArrayPrototype[ITERATOR$2]===e)},uncurryThis$3=functionUncurryThis,fails$1=fails$l,isCallable$1=isCallable$j,classof$2=classof$6,getBuiltIn=getBuiltIn$4,inspectSource=inspectSource$2,noop=function(){},empty=[],construct=getBuiltIn("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$2=uncurryThis$3(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$1(e))return!1;try{return construct(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$1(e))return!1;switch(classof$2(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$2(constructorRegExp,inspectSource(e))}catch(e){return!0}};isConstructorLegacy.sham=!0;var isConstructor$1=!construct||fails$1((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,toPropertyKey=toPropertyKey$3,definePropertyModule=objectDefineProperty,createPropertyDescriptor$1=createPropertyDescriptor$5,createProperty$2=function(e,t,r){var n=toPropertyKey(t);n in e?definePropertyModule.f(e,n,createPropertyDescriptor$1(0,r)):e[n]=r},classof$1=classof$6,getMethod$1=getMethod$5,isNullOrUndefined$1=isNullOrUndefined$5,Iterators=iterators,wellKnownSymbol$1=wellKnownSymbol$g,ITERATOR$1=wellKnownSymbol$1("iterator"),getIteratorMethod$3=function(e){if(!isNullOrUndefined$1(e))return getMethod$1(e,ITERATOR$1)||getMethod$1(e,"@@iterator")||Iterators[classof$1(e)]},call$4=functionCall,aCallable=aCallable$4,anObject$3=anObject$e,tryToString=tryToString$2,getIteratorMethod$2=getIteratorMethod$3,$TypeError$1=TypeError,getIterator$2=function(e,t){var r=arguments.length<2?getIteratorMethod$2(e):t;if(aCallable(r))return anObject$3(call$4(r,e));throw $TypeError$1(tryToString(e)+" is not iterable")},bind$2=functionBindContext,call$3=functionCall,toObject=toObject$5,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$1,isConstructor=isConstructor$1,lengthOfArrayLike$1=lengthOfArrayLike$3,createProperty$1=createProperty$2,getIterator$1=getIterator$2,getIteratorMethod$1=getIteratorMethod$3,$Array$1=Array,arrayFrom$1=function(e){var t=toObject(e),r=isConstructor(this),n=arguments.length,i=n>1?arguments[1]:void 0,s=void 0!==i;s&&(i=bind$2(i,n>2?arguments[2]:void 0));var a,o,l,c,h,d,u=getIteratorMethod$1(t),p=0;if(!u||this===$Array$1&&isArrayIteratorMethod(u))for(a=lengthOfArrayLike$1(t),o=r?new this(a):$Array$1(a);a>p;p++)d=s?i(t[p],p):t[p],createProperty$1(o,p,d);else for(h=(c=getIterator$1(t,u)).next,o=r?new this:[];!(l=call$3(h,c)).done;p++)d=s?callWithSafeIterationClosing(c,i,[l.value,p],!0):l.value,createProperty$1(o,p,d);return o.length=p,o},toAbsoluteIndex=toAbsoluteIndex$2,lengthOfArrayLike=lengthOfArrayLike$3,createProperty=createProperty$2,$Array=Array,max=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike(e),i=toAbsoluteIndex(t,n),s=toAbsoluteIndex(void 0===r?n:r,n),a=$Array(max(s-i,0)),o=0;i<s;i++,o++)createProperty(a,o,e[i]);return a.length=o,a},uncurryThis$2=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError=RangeError,exec$1=uncurryThis$2(regexSeparators.exec),floor$2=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$2("".charCodeAt),join$2=uncurryThis$2([].join),push$2=uncurryThis$2([].push),replace$2=uncurryThis$2("".replace),split$2=uncurryThis$2("".split),toLowerCase$1=uncurryThis$2("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=charCodeAt(e,r++);if(i>=55296&&i<=56319&&r<n){var s=charCodeAt(e,r++);56320==(64512&s)?push$2(t,((1023&i)<<10)+(1023&s)+65536):(push$2(t,i),r--)}else push$2(t,i)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$2(e/damp):e>>1,e+=floor$2(e/t);e>baseMinusTMin*tMax>>1;)e=floor$2(e/baseMinusTMin),n+=base;return floor$2(n+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,r,n=[],i=(e=ucs2decode(e)).length,s=initialN,a=0,o=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$2(n,fromCharCode(r));var l=n.length,c=l;for(l&&push$2(n,delimiter);c<i;){var h=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=s&&r<h&&(h=r);var d=c+1;if(h-s>floor$2((maxInt-a)/d))throw $RangeError(OVERFLOW_ERROR);for(a+=(h-s)*d,s=h,t=0;t<e.length;t++){if((r=e[t])<s&&++a>maxInt)throw $RangeError(OVERFLOW_ERROR);if(r==s){for(var u=a,p=base;;){var f=p<=o?tMin:p>=o+tMax?tMax:p-o;if(u<f)break;var m=u-f,g=base-f;push$2(n,fromCharCode(digitToBasic(f+m%g))),u=floor$2(m/g),p+=base}push$2(n,fromCharCode(digitToBasic(u))),o=adapt(a,d,c==l),a=0,c++}}a++,s++}return join$2(n,"")},stringPunycodeToAscii=function(e){var t,r,n=[],i=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<i.length;t++)r=i[t],push$2(n,exec$1(regexNonASCII,r)?"xn--"+encode(r):r);return join$2(n,".")},$TypeError=TypeError,validateArgumentsLength$2=function(e,t){if(e<t)throw $TypeError("Not enough arguments");return e},defineBuiltIn$3=defineBuiltIn$8,defineBuiltIns$1=function(e,t,r){for(var n in t)defineBuiltIn$3(e,n,t[n],r);return e},arraySlice$1=arraySliceSimple,floor$1=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$1(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$1(e,0,n),t),mergeSort(arraySlice$1(e,n),t),t)},insertionSort=function(e,t){for(var r,n,i=e.length,s=1;s<i;){for(n=s,r=e[s];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==s++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var i=t.length,s=r.length,a=0,o=0;a<i||o<s;)e[a+o]=a<i&&o<s?n(t[a],r[o])<=0?t[a++]:r[o++]:a<i?t[a++]:r[o++];return e},arraySort$1=mergeSort,$$2=_export,global$2=global$g,call$2=functionCall,uncurryThis$1=functionUncurryThis,DESCRIPTORS$1=descriptors,USE_NATIVE_URL$1=urlConstructorDetection,defineBuiltIn$2=defineBuiltIn$8,defineBuiltInAccessor$1=defineBuiltInAccessor$2,defineBuiltIns=defineBuiltIns$1,setToStringTag$1=setToStringTag$4,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$1=internalState,anInstance$1=anInstance$2,isCallable=isCallable$j,hasOwn$2=hasOwnProperty_1,bind$1=functionBindContext,classof=classof$6,anObject$2=anObject$e,isObject=isObject$8,$toString$2=toString$8,create=objectCreate,createPropertyDescriptor=createPropertyDescriptor$5,getIterator=getIterator$2,getIteratorMethod=getIteratorMethod$3,validateArgumentsLength$1=validateArgumentsLength$2,wellKnownSymbol=wellKnownSymbol$g,arraySort=arraySort$1,ITERATOR=wellKnownSymbol("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$1=InternalStateModule$1.set,getInternalParamsState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$1)return global$2[e];var t=getOwnPropertyDescriptor(global$2,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,RegExp$1=global$2.RegExp,TypeError$2=global$2.TypeError,decodeURIComponent$1=global$2.decodeURIComponent,encodeURIComponent$1=global$2.encodeURIComponent,charAt$1=uncurryThis$1("".charAt),join$1=uncurryThis$1([].join),push$1=uncurryThis$1([].push),replace$1=uncurryThis$1("".replace),shift$1=uncurryThis$1([].shift),splice=uncurryThis$1([].splice),split$1=uncurryThis$1("".split),stringSlice$1=uncurryThis$1("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent$1(e)}catch(t){return e}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent$1(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$1(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$1(e,1):e:$toString$2(e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,s,a,o,l=getIteratorMethod(e);if(l)for(r=(t=getIterator(e,l)).next;!(n=call$2(r,t)).done;){if(s=(i=getIterator(anObject$2(n.value))).next,(a=call$2(s,i)).done||(o=call$2(s,i)).done||!call$2(s,i).done)throw TypeError$2("Expected sequence with length 2");push$1(this.entries,{key:$toString$2(a.value),value:$toString$2(o.value)})}else for(var c in e)hasOwn$2(e,c)&&push$1(this.entries,{key:c,value:$toString$2(e[c])})},parseQuery:function(e){if(e)for(var t,r,n=split$1(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=split$1(t,"="),push$1(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$1(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$1(r,serialize(e.key)+"="+serialize(e.value));return join$1(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$1(this,URLSearchParamsPrototype);var e=setInternalState$1(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));DESCRIPTORS$1||(this.length=e.entries.length)},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$1(arguments.length,2);var r=getInternalParamsState(this);push$1(r.entries,{key:$toString$2(e),value:$toString$2(t)}),DESCRIPTORS$1||this.length++,r.updateURL()},delete:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$2(e),i=0;i<r.length;)r[i].key===n?splice(r,i,1):i++;DESCRIPTORS$1||(this.length=r.length),t.updateURL()},get:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$2(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$2(e),n=[],i=0;i<t.length;i++)t[i].key===r&&push$1(n,t[i].value);return n},has:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$2(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$1(arguments.length,1);for(var r,n=getInternalParamsState(this),i=n.entries,s=!1,a=$toString$2(e),o=$toString$2(t),l=0;l<i.length;l++)(r=i[l]).key===a&&(s?splice(i,l--,1):(s=!0,r.value=o));s||push$1(i,{key:a,value:o}),DESCRIPTORS$1||(this.length=i.length),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$1(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$2(URLSearchParamsPrototype,ITERATOR,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$2(URLSearchParamsPrototype,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),DESCRIPTORS$1&&defineBuiltInAccessor$1(URLSearchParamsPrototype,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0}),setToStringTag$1(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$2({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$1&&isCallable(Headers)){var headersHas=uncurryThis$1(HeadersPrototype.has),headersSet=uncurryThis$1(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject(e)){var t,r=e.body;if(classof(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers(e.headers):new Headers,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create(e,{body:createPropertyDescriptor(0,$toString$2(r)),headers:createPropertyDescriptor(0,t)})}return e};if(isCallable(nativeFetch)&&$$2({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable(NativeRequest)){var RequestConstructor=function(e){return anInstance$1(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$2({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$1=_export,DESCRIPTORS=descriptors,USE_NATIVE_URL=urlConstructorDetection,global$1=global$g,bind=functionBindContext,uncurryThis=functionUncurryThis,defineBuiltIn$1=defineBuiltIn$8,defineBuiltInAccessor=defineBuiltInAccessor$2,anInstance=anInstance$2,hasOwn$1=hasOwnProperty_1,assign$1=objectAssign,arrayFrom=arrayFrom$1,arraySlice=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString$1=toString$8,setToStringTag=setToStringTag$4,validateArgumentsLength=validateArgumentsLength$2,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule=internalState,setInternalState=InternalStateModule.set,getInternalURLState=InternalStateModule.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$1.URL,TypeError$1=global$1.TypeError,parseInt$1=global$1.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis("".charAt),exec=uncurryThis(/./.exec),join=uncurryThis([].join),numberToString=uncurryThis(1..toString),pop=uncurryThis([].pop),push=uncurryThis([].push),replace=uncurryThis("".replace),shift=uncurryThis([].shift),split=uncurryThis("".split),stringSlice=uncurryThis("".slice),toLowerCase=uncurryThis("".toLowerCase),unshift=uncurryThis([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,EOF,parseIPv4=function(e){var t,r,n,i,s,a,o,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=l[n]))return e;if(s=10,i.length>1&&"0"==charAt(i,0)&&(s=exec(HEX_START,i)?16:8,i=stringSlice(i,8==s?1:2)),""===i)a=0;else{if(!exec(10==s?DEC:8==s?OCT:HEX,i))return e;a=parseInt$1(i,s)}push(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=pow(256,5-t))return null}else if(a>255)return null;for(o=pop(r),n=0;n<r.length;n++)o+=r[n]*pow(256,3-n);return o},parseIPv6=function(e){var t,r,n,i,s,a,o,l=[0,0,0,0,0,0,0,0],c=0,h=null,d=0,u=function(){return charAt(e,d)};if(":"==u()){if(":"!=charAt(e,1))return;d+=2,h=++c}for(;u();){if(8==c)return;if(":"!=u()){for(t=r=0;r<4&&exec(HEX,u());)t=16*t+parseInt$1(u(),16),d++,r++;if("."==u()){if(0==r)return;if(d-=r,c>6)return;for(n=0;u();){if(i=null,n>0){if(!("."==u()&&n<4))return;d++}if(!exec(DIGIT,u()))return;for(;exec(DIGIT,u());){if(s=parseInt$1(u(),10),null===i)i=s;else{if(0==i)return;i=10*i+s}if(i>255)return;d++}l[c]=256*l[c]+i,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==u()){if(d++,!u())return}else if(u())return;l[c++]=t}else{if(null!==h)return;d++,h=++c}}if(null!==h)for(a=c-h,c=7;0!=c&&a>0;)o=l[c],l[c--]=l[h+a-1],l[h+--a]=o;else if(8!=c)return;return l},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,i=0,s=0;s<8;s++)0!==e[s]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=s),++i);return i>r&&(t=n,r=i),t},serializeHost=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor(e/256);return join(t,".")}if("object"==typeof e){for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign$1({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign$1({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign$1({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return r>32&&r<127&&!hasOwn$1(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(r=charAt(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var n,i,s,a=$toString$1(e);if(t){if(i=this.parse(a))throw TypeError$1(i);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),i=this.parse(a,null,n))throw TypeError$1(i);(s=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=s}};URLState.prototype={type:"URL",parse:function(e,t,r){var n,i,s,a,o=this,l=t||SCHEME_START,c=0,h="",d=!1,u=!1,p=!1;for(e=$toString$1(e),t||(o.scheme="",o.username="",o.password="",o.host=null,o.port=null,o.path=[],o.query=null,o.fragment=null,o.cannotBeABaseURL=!1,e=replace(e,LEADING_C0_CONTROL_OR_SPACE,""),e=replace(e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),e=replace(e,TAB_AND_NEW_LINE,""),n=arrayFrom(e);c<=n.length;){switch(i=n[c],l){case SCHEME_START:if(!i||!exec(ALPHA,i)){if(t)return INVALID_SCHEME;l=NO_SCHEME;continue}h+=toLowerCase(i),l=SCHEME;break;case SCHEME:if(i&&(exec(ALPHANUMERIC,i)||"+"==i||"-"==i||"."==i))h+=toLowerCase(i);else{if(":"!=i){if(t)return INVALID_SCHEME;h="",l=NO_SCHEME,c=0;continue}if(t&&(o.isSpecial()!=hasOwn$1(specialSchemes,h)||"file"==h&&(o.includesCredentials()||null!==o.port)||"file"==o.scheme&&!o.host))return;if(o.scheme=h,t)return void(o.isSpecial()&&specialSchemes[o.scheme]==o.port&&(o.port=null));h="","file"==o.scheme?l=FILE:o.isSpecial()&&r&&r.scheme==o.scheme?l=SPECIAL_RELATIVE_OR_AUTHORITY:o.isSpecial()?l=SPECIAL_AUTHORITY_SLASHES:"/"==n[c+1]?(l=PATH_OR_AUTHORITY,c++):(o.cannotBeABaseURL=!0,push(o.path,""),l=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=i)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==i){o.scheme=r.scheme,o.path=arraySlice(r.path),o.query=r.query,o.fragment="",o.cannotBeABaseURL=!0,l=FRAGMENT;break}l="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=i||"/"!=n[c+1]){l=RELATIVE;continue}l=SPECIAL_AUTHORITY_IGNORE_SLASHES,c++;break;case PATH_OR_AUTHORITY:if("/"==i){l=AUTHORITY;break}l=PATH;continue;case RELATIVE:if(o.scheme=r.scheme,i==EOF)o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,o.path=arraySlice(r.path),o.query=r.query;else if("/"==i||"\\"==i&&o.isSpecial())l=RELATIVE_SLASH;else if("?"==i)o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,o.path=arraySlice(r.path),o.query="",l=QUERY;else{if("#"!=i){o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,o.path=arraySlice(r.path),o.path.length--,l=PATH;continue}o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,o.path=arraySlice(r.path),o.query=r.query,o.fragment="",l=FRAGMENT}break;case RELATIVE_SLASH:if(!o.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,l=PATH;continue}l=AUTHORITY}else l=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(l=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=i||"/"!=charAt(h,c+1))continue;c++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=i&&"\\"!=i){l=AUTHORITY;continue}break;case AUTHORITY:if("@"==i){d&&(h="%40"+h),d=!0,s=arrayFrom(h);for(var f=0;f<s.length;f++){var m=s[f];if(":"!=m||p){var g=percentEncode(m,userinfoPercentEncodeSet);p?o.password+=g:o.username+=g}else p=!0}h=""}else if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&o.isSpecial()){if(d&&""==h)return INVALID_AUTHORITY;c-=arrayFrom(h).length+1,h="",l=HOST}else h+=i;break;case HOST:case HOSTNAME:if(t&&"file"==o.scheme){l=FILE_HOST;continue}if(":"!=i||u){if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&o.isSpecial()){if(o.isSpecial()&&""==h)return INVALID_HOST;if(t&&""==h&&(o.includesCredentials()||null!==o.port))return;if(a=o.parseHost(h))return a;if(h="",l=PATH_START,t)return;continue}"["==i?u=!0:"]"==i&&(u=!1),h+=i}else{if(""==h)return INVALID_HOST;if(a=o.parseHost(h))return a;if(h="",l=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,i)){if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&o.isSpecial()||t){if(""!=h){var y=parseInt$1(h,10);if(y>65535)return INVALID_PORT;o.port=o.isSpecial()&&y===specialSchemes[o.scheme]?null:y,h=""}if(t)return;l=PATH_START;continue}return INVALID_PORT}h+=i;break;case FILE:if(o.scheme="file","/"==i||"\\"==i)l=FILE_SLASH;else{if(!r||"file"!=r.scheme){l=PATH;continue}if(i==EOF)o.host=r.host,o.path=arraySlice(r.path),o.query=r.query;else if("?"==i)o.host=r.host,o.path=arraySlice(r.path),o.query="",l=QUERY;else{if("#"!=i){startsWithWindowsDriveLetter(join(arraySlice(n,c),""))||(o.host=r.host,o.path=arraySlice(r.path),o.shortenPath()),l=PATH;continue}o.host=r.host,o.path=arraySlice(r.path),o.query=r.query,o.fragment="",l=FRAGMENT}}break;case FILE_SLASH:if("/"==i||"\\"==i){l=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join(arraySlice(n,c),""))&&(isWindowsDriveLetter(r.path[0],!0)?push(o.path,r.path[0]):o.host=r.host),l=PATH;continue;case FILE_HOST:if(i==EOF||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&isWindowsDriveLetter(h))l=PATH;else if(""==h){if(o.host="",t)return;l=PATH_START}else{if(a=o.parseHost(h))return a;if("localhost"==o.host&&(o.host=""),t)return;h="",l=PATH_START}continue}h+=i;break;case PATH_START:if(o.isSpecial()){if(l=PATH,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=EOF&&(l=PATH,"/"!=i))continue}else o.fragment="",l=FRAGMENT;else o.query="",l=QUERY;break;case PATH:if(i==EOF||"/"==i||"\\"==i&&o.isSpecial()||!t&&("?"==i||"#"==i)){if(isDoubleDot(h)?(o.shortenPath(),"/"==i||"\\"==i&&o.isSpecial()||push(o.path,"")):isSingleDot(h)?"/"==i||"\\"==i&&o.isSpecial()||push(o.path,""):("file"==o.scheme&&!o.path.length&&isWindowsDriveLetter(h)&&(o.host&&(o.host=""),h=charAt(h,0)+":"),push(o.path,h)),h="","file"==o.scheme&&(i==EOF||"?"==i||"#"==i))for(;o.path.length>1&&""===o.path[0];)shift(o.path);"?"==i?(o.query="",l=QUERY):"#"==i&&(o.fragment="",l=FRAGMENT)}else h+=percentEncode(i,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==i?(o.query="",l=QUERY):"#"==i?(o.fragment="",l=FRAGMENT):i!=EOF&&(o.path[0]+=percentEncode(i,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=i?i!=EOF&&("'"==i&&o.isSpecial()?o.query+="%27":o.query+="#"==i?"%23":percentEncode(i,C0ControlPercentEncodeSet)):(o.fragment="",l=FRAGMENT);break;case FRAGMENT:i!=EOF&&(o.fragment+=percentEncode(i,fragmentPercentEncodeSet))}c++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn$1(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,s=e.port,a=e.path,o=e.query,l=e.fragment,c=t+":";return null!==i?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=serializeHost(i),null!==s&&(c+=":"+s)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+join(a,"/"):"",null!==o&&(c+="?"+o),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$1(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString$1(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString$1(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString$1(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString$1(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString$1(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString$1(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=$toString$1(e))?("#"==charAt(e,0)&&(e=stringSlice(e,1)),this.fragment="",this.parse(e,FRAGMENT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=anInstance(this,URLPrototype),r=validateArgumentsLength(arguments.length,1)>1?arguments[1]:void 0,n=setInternalState(t,new URLState(e,!1,r));DESCRIPTORS||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS&&(defineBuiltInAccessor(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn$1(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn$1(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn$1(URLConstructor,"createObjectURL",bind(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn$1(URLConstructor,"revokeObjectURL",bind(nativeRevokeObjectURL,NativeURL))}setToStringTag(URLConstructor,"URL"),$$1({global:!0,constructor:!0,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS},{URL:URLConstructor});var sameValue$1=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},call$1=functionCall,fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic,anObject$1=anObject$e,isNullOrUndefined=isNullOrUndefined$5,requireObjectCoercible=requireObjectCoercible$8,sameValue=sameValue$1,toString=toString$8,getMethod=getMethod$5,regExpExec=regexpExecAbstract,util,objectUtil;fixRegExpWellKnownSymbolLogic("search",(function(e,t,r){return[function(t){var r=requireObjectCoercible(this),n=isNullOrUndefined(t)?void 0:getMethod(t,e);return n?call$1(n,t,r):new RegExp(t)[e](toString(r))},function(e){var n=anObject$1(this),i=toString(e),s=r(t,n,i);if(s.done)return s.value;var a=n.lastIndex;sameValue(a,0)||(n.lastIndex=0);var o=regExpExec(n,i);return sameValue(n.lastIndex,a)||(n.lastIndex=a),null===o?-1:o.index}]})),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(util||(util={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:null===e?ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){const r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let r;switch(e.code){case ZodIssueCode.invalid_type:r=e.received===ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${util.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${util.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${util.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,util.assertNever(e)}return{message:r}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],a={...i,path:s};let o="";const l=n.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(a,{data:t,defaultError:o}).message;return{...i,path:s,message:i.message||o}},EMPTY_PATH=[];function addIssueToContext(e,t){const r=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e))});e.common.issues.push(r)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return INVALID;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t)r.push({key:await e.key,value:await e.value});return ParseStatus.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:i}=n;if("aborted"===t.status)return INVALID;if("aborted"===i.status)return INVALID;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||void 0===i.value&&!n.alwaysSet||(r[t.value]=i.value)}return{status:e.value,value:r}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>"aborted"===e.status,isDirty=e=>"dirty"===e.status,isValid=e=>"valid"===e.status,isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise;var errorUtil;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError},description:i}}class ZodType{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},i=this._parseSync({data:e,path:n.path,parent:n});return handleResult(n,i)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await(isAsync(n)?n:Promise.resolve(n));return handleResult(r,i)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const i=e(t),s=()=>n.addIssue({code:ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(s(),!1))):!!i||(s(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[a-z][a-z0-9]*$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,datetimeRegex=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function isValidIP(e,t){return!("v4"!==t&&t||!ipv4Regex.test(e))||!("v6"!==t&&t||!ipv6Regex.test(e))}class ZodString extends ZodType{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==ZodParsedType.string){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:t.parsedType}),INVALID}const t=new ParseStatus;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const i=e.data.length>n.value,s=e.data.length<n.value;(i||s)&&(r=this._getOrReturnCtx(e,r),i?addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)emailRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"email",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"emoji",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)uuidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"uuid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)cuidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"cuid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)cuid2Regex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)ulidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"ulid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch(i){r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"url",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"regex",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){datetimeRegex(n).test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else"ip"===n.kind?isValidIP(e.data,n.version)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"ip",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()):util.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(r)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...errorUtil.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...errorUtil.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...errorUtil.errToObj(t)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==ZodParsedType.number){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:t.parsedType}),INVALID}let t;const r=new ParseStatus;for(const n of this._def.checks)if("int"===n.kind)util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==floatSafeRemainder(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_finite,message:n.message}),r.dirty()):util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,r,n){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:errorUtil.toString(n)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:t.parsedType}),INVALID}let t;const r=new ParseStatus;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,r,n){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:errorUtil.toString(n)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:t.parsedType}),INVALID}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==ZodParsedType.date){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:t.parsedType}),INVALID}if(isNaN(e.data.getTime())){return addIssueToContext(this._getOrReturnCtx(e),{code:ZodIssueCode.invalid_date}),INVALID}const t=new ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):util.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:t.parsedType}),INVALID}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:t.parsedType}),INVALID}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.null){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:t.parsedType}),INVALID}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:t.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:t.parsedType}),INVALID}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==ZodParsedType.array)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:t.parsedType}),INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(e||i)&&(addIssueToContext(t,{code:e?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new ParseInputLazyPath(t,e,t.path,r))))).then((e=>ParseStatus.mergeArray(r,e)));const i=[...t.data].map(((e,r)=>n.type._parseSync(new ParseInputLazyPath(t,e,t.path,r))));return ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map((e=>deepPartialify(e)))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ZodParsedType.object){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||s.push(e);const a=[];for(const e of i){const t=n[e],i=r.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)a.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)s.length>0&&(addIssueToContext(r,{code:ZodIssueCode.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const n=r.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>ParseStatus.mergeObjectSync(t,e))):ParseStatus.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,s,a;const o=null!==(s=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=errorUtil.errToObj(e).message)&&void 0!==a?a:o}:{message:o}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};return util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};return util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};return util.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new ZodObject({...this._def,shape:()=>t})}required(e){const t={};return util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ZodOptional;)e=e._def.innerType;t[r]=e}})),new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new ZodError(e.ctx.common.issues)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:r}),INVALID}));{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null},s=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new ZodError(e)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:i}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?Object.keys(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:null;class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.object)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(addIssueToContext(t,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=getDiscriminator(r.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...processCreateParams(r)})}}function mergeValues(e,t){const r=getParsedType(e),n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===ZodParsedType.object&&n===ZodParsedType.object){const r=util.objectKeys(t),n=util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),i={...e,...t};for(const r of n){const n=mergeValues(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const i=mergeValues(e[n],t[n]);if(!i.valid)return{valid:!1};r.push(i.data)}return{valid:!0,data:r}}return r===ZodParsedType.date&&n===ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(isAborted(e)||isAborted(n))return INVALID;const i=mergeValues(e.value,n.value);return i.valid?((isDirty(e)||isDirty(n))&&t.dirty(),{status:t.value,value:i.data}):(addIssueToContext(r,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ZodIntersection.create=(e,t,r)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(r)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(r.data.length<this._def.items.length)return addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&r.data.length>this._def.items.length&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new ParseInputLazyPath(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>ParseStatus.mergeArray(t,e))):ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;const n=[],i=this._def.keyType,s=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new ParseInputLazyPath(r,e,r.path,e)),value:s._parse(new ParseInputLazyPath(r,r.data[e],r.path,e))});return r.common.async?ParseStatus.mergeObjectAsync(t,n):ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(r)}:{keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.map)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:r.parsedType}),INVALID;const n=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map((([e,t],s)=>({key:n._parse(new ParseInputLazyPath(r,e,r.path,[s,"key"])),value:i._parse(new ParseInputLazyPath(r,t,r.path,[s,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of s){const n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of s){const n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,r)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(r)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.set)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:r.parsedType}),INVALID;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function s(e){const r=new Set;for(const n of e){if("aborted"===n.status)return INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const a=[...r.data.values()].map(((e,t)=>i._parse(new ParseInputLazyPath(r,e,r.path,t))));return r.common.async?Promise.all(a).then((e=>s(e))):s(a)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.function)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:t.parsedType}),INVALID;function r(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return OK((async function(...t){const a=new ZodError([]),o=await e._def.args.parseAsync(t,i).catch((e=>{throw a.addIssue(r(t,e)),a})),l=await Reflect.apply(s,this,o),c=await e._def.returns._def.type.parseAsync(l,i).catch((e=>{throw a.addIssue(n(l,e)),a}));return c}))}{const e=this;return OK((function(...t){const a=e._def.args.safeParse(t,i);if(!a.success)throw new ZodError([r(t,a.error)]);const o=Reflect.apply(s,this,a.data),l=e._def.returns.safeParse(o,i);if(!l.success)throw new ZodError([n(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(r)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});class ZodEnum extends ZodType{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{expected:util.joinValues(r),received:t.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:r}),INVALID}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return ZodEnum.create(e)}exclude(e){return ZodEnum.create(this.options.filter((t=>!e.includes(t))))}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(e){const t=util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ZodParsedType.string&&r.parsedType!==ZodParsedType.number){const e=util.objectValues(t);return addIssueToContext(r,{expected:util.joinValues(e),received:r.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(-1===t.indexOf(e.data)){const e=util.objectValues(t);return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:e}),INVALID}return OK(e.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.promise&&!1===t.common.async)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:t.parsedType}),INVALID;const r=t.parsedType===ZodParsedType.promise?t.data:Promise.resolve(t.data);return OK(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{addIssueToContext(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){const e=n.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r}))):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!isValid(e))return e;const s=n.transform(e.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>isValid(e)?Promise.resolve(n.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}util.assertNever(n)}}ZodEffects.create=(e,t,r)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(r)}),ZodEffects.createWithPreprocess=(e,t,r)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(r)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return isAsync(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.nan){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:t.parsedType}),INVALID}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e);return isValid(t)&&(t.value=Object.freeze(t.value)),t}}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});const custom=(e,t={},r)=>e?ZodAny.create().superRefine(((n,i)=>{var s,a;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(a=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===a||a,l="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...l,fatal:o})}})):ZodAny.create(),late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom((t=>t instanceof e),t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap:setErrorMap,getErrorMap:getErrorMap,makeIssue:makeIssue,EMPTY_PATH:EMPTY_PATH,addIssueToContext:addIssueToContext,ParseStatus:ParseStatus,INVALID:INVALID,DIRTY:DIRTY,OK:OK,isAborted:isAborted,isDirty:isDirty,isValid:isValid,isAsync:isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType:ZodParsedType,getParsedType:getParsedType,ZodType:ZodType,ZodString:ZodString,ZodNumber:ZodNumber,ZodBigInt:ZodBigInt,ZodBoolean:ZodBoolean,ZodDate:ZodDate,ZodSymbol:ZodSymbol,ZodUndefined:ZodUndefined,ZodNull:ZodNull,ZodAny:ZodAny,ZodUnknown:ZodUnknown,ZodNever:ZodNever,ZodVoid:ZodVoid,ZodArray:ZodArray,ZodObject:ZodObject,ZodUnion:ZodUnion,ZodDiscriminatedUnion:ZodDiscriminatedUnion,ZodIntersection:ZodIntersection,ZodTuple:ZodTuple,ZodRecord:ZodRecord,ZodMap:ZodMap,ZodSet:ZodSet,ZodFunction:ZodFunction,ZodLazy:ZodLazy,ZodLiteral:ZodLiteral,ZodEnum:ZodEnum,ZodNativeEnum:ZodNativeEnum,ZodPromise:ZodPromise,ZodEffects:ZodEffects,ZodTransformer:ZodEffects,ZodOptional:ZodOptional,ZodNullable:ZodNullable,ZodDefault:ZodDefault,ZodCatch:ZodCatch,ZodNaN:ZodNaN,BRAND:BRAND,ZodBranded:ZodBranded,ZodPipeline:ZodPipeline,ZodReadonly:ZodReadonly,custom:custom,Schema:ZodType,ZodSchema:ZodType,late:late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean:oboolean,onumber:onumber,optional:optionalType,ostring:ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER,ZodIssueCode:ZodIssueCode,quotelessJson:quotelessJson,ZodError:ZodError}),moment$1={exports:{}},module;module=moment$1,module.exports=function(){var e,t;function r(){return e.apply(null,arguments)}function n(t){e=t}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(a(e,t))return!1;return!0}function l(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var r,n=[],i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function u(e,t){for(var r in t)a(t,r)&&(e[r]=t[r]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,r,n){return Zr(e,t,r,n,!0).utc()}function f(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function m(e){return null==e._pf&&(e._pf=f()),e._pf}function g(e){if(null==e._isValid){var r=m(e),n=t.call(r.parsedDateParts,(function(e){return null!=e})),i=!isNaN(e._d.getTime())&&r.overflow<0&&!r.empty&&!r.invalidEra&&!r.invalidMonth&&!r.invalidWeekday&&!r.weekdayMismatch&&!r.nullInput&&!r.invalidFormat&&!r.userInvalidated&&(!r.meridiem||r.meridiem&&n);if(e._strict&&(i=i&&0===r.charsLeftOver&&0===r.unusedTokens.length&&void 0===r.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function y(e){var t=p(NaN);return null!=e?u(m(t),e):m(t).userInvalidated=!0,t}t=Array.prototype.some?Array.prototype.some:function(e){var t,r=Object(this),n=r.length>>>0;for(t=0;t<n;t++)if(t in r&&e.call(this,r[t],t,r))return!0;return!1};var v=r.momentProperties=[],b=!1;function S(e,t){var r,n,i,s=v.length;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=m(t)),l(t._locale)||(e._locale=t._locale),s>0)for(r=0;r<s;r++)l(i=t[n=v[r]])||(e[n]=i);return e}function E(e){S(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,r.updateOffset(this),b=!1)}function C(e){return e instanceof E||null!=e&&null!=e._isAMomentObject}function _(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function T(e,t){var n=!0;return u((function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var i,s,o,l=[],c=arguments.length;for(s=0;s<c;s++){if(i="","object"==typeof arguments[s]){for(o in i+="\n["+s+"] ",arguments[0])a(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[s];l.push(i)}_(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var x,P={};function w(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),P[e]||(_(t),P[e]=!0)}function I(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function k(e){var t,r;for(r in e)a(e,r)&&(I(t=e[r])?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function A(e,t){var r,n=u({},e);for(r in t)a(t,r)&&(s(e[r])&&s(t[r])?(n[r]={},u(n[r],e[r]),u(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)a(e,r)&&!a(t,r)&&s(e[r])&&(n[r]=u({},n[r]));return n}function M(e){null!=e&&this.set(e)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,x=Object.keys?Object.keys:function(e){var t,r=[];for(t in e)a(e,t)&&r.push(t);return r};var R={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function O(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return I(n)?n.call(t,r):n}function $(e,t,r){var n=""+Math.abs(e),i=t-n.length;return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var D=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,F={},N={};function B(e,t,r,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&(N[e]=i),t&&(N[t[0]]=function(){return $(i.apply(this,arguments),t[1],t[2])}),r&&(N[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function V(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function U(e){var t,r,n=e.match(D);for(t=0,r=n.length;t<r;t++)N[n[t]]?n[t]=N[n[t]]:n[t]=V(n[t]);return function(t){var i,s="";for(i=0;i<r;i++)s+=I(n[i])?n[i].call(t,e):n[i];return s}}function z(e,t){return e.isValid()?(t=j(t,e.localeData()),F[t]=F[t]||U(t),F[t](e)):e.localeData().invalidDate()}function j(e,t){var r=5;function n(e){return t.longDateFormat(e)||e}for(L.lastIndex=0;r>=0&&L.test(e);)e=e.replace(L,n),L.lastIndex=0,r-=1;return e}var G={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function H(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(D).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var Z="Invalid date";function W(){return this._invalidDate}var K="%d",Y=/\d{1,2}/;function q(e){return this._ordinal.replace("%d",e)}var Q={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function X(e,t,r,n){var i=this._relativeTime[r];return I(i)?i(e,t,r,n):i.replace(/%d/i,e)}function J(e,t){var r=this._relativeTime[e>0?"future":"past"];return I(r)?r(t):r.replace(/%s/i,t)}var ee={};function te(e,t){var r=e.toLowerCase();ee[r]=ee[r+"s"]=ee[t]=e}function re(e){return"string"==typeof e?ee[e]||ee[e.toLowerCase()]:void 0}function ne(e){var t,r,n={};for(r in e)a(e,r)&&(t=re(r))&&(n[t]=e[r]);return n}var ie={};function se(e,t){ie[e]=t}function ae(e){var t,r=[];for(t in e)a(e,t)&&r.push({unit:t,priority:ie[t]});return r.sort((function(e,t){return e.priority-t.priority})),r}function oe(e){return e%4==0&&e%100!=0||e%400==0}function le(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ce(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=le(t)),r}function he(e,t){return function(n){return null!=n?(ue(this,e,n),r.updateOffset(this,t),this):de(this,e)}}function de(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function ue(e,t,r){e.isValid()&&!isNaN(r)&&("FullYear"===t&&oe(e.year())&&1===e.month()&&29===e.date()?(r=ce(r),e._d["set"+(e._isUTC?"UTC":"")+t](r,e.month(),Xe(r,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](r))}function pe(e){return I(this[e=re(e)])?this[e]():this}function fe(e,t){if("object"==typeof e){var r,n=ae(e=ne(e)),i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(I(this[e=re(e)]))return this[e](t);return this}var me,ge=/\d/,ye=/\d\d/,ve=/\d{3}/,be=/\d{4}/,Se=/[+-]?\d{6}/,Ee=/\d\d?/,Ce=/\d\d\d\d?/,_e=/\d\d\d\d\d\d?/,Te=/\d{1,3}/,xe=/\d{1,4}/,Pe=/[+-]?\d{1,6}/,we=/\d+/,Ie=/[+-]?\d+/,ke=/Z|[+-]\d\d:?\d\d/gi,Ae=/Z|[+-]\d\d(?::?\d\d)?/gi,Me=/[+-]?\d+(\.\d{1,3})?/,Re=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function Oe(e,t,r){me[e]=I(t)?t:function(e,n){return e&&r?r:t}}function $e(e,t){return a(me,e)?me[e](t._strict,t._locale):new RegExp(De(e))}function De(e){return Le(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,r,n,i){return t||r||n||i})))}function Le(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}me={};var Fe={};function Ne(e,t){var r,n,i=t;for("string"==typeof e&&(e=[e]),c(t)&&(i=function(e,r){r[t]=ce(e)}),n=e.length,r=0;r<n;r++)Fe[e[r]]=i}function Be(e,t){Ne(e,(function(e,r,n,i){n._w=n._w||{},t(e,n._w,n,i)}))}function Ve(e,t,r){null!=t&&a(Fe,e)&&Fe[e](t,r._a,r,e)}var Ue,ze=0,je=1,Ge=2,He=3,Ze=4,We=5,Ke=6,Ye=7,qe=8;function Qe(e,t){return(e%t+t)%t}function Xe(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=Qe(t,12);return e+=(t-r)/12,1===r?oe(e)?29:28:31-r%7%2}Ue=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},B("M",["MM",2],"Mo",(function(){return this.month()+1})),B("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),B("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),te("month","M"),se("month",8),Oe("M",Ee),Oe("MM",Ee,ye),Oe("MMM",(function(e,t){return t.monthsShortRegex(e)})),Oe("MMMM",(function(e,t){return t.monthsRegex(e)})),Ne(["M","MM"],(function(e,t){t[je]=ce(e)-1})),Ne(["MMM","MMMM"],(function(e,t,r,n){var i=r._locale.monthsParse(e,n,r._strict);null!=i?t[je]=i:m(r).invalidMonth=e}));var Je="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),et="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),tt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,rt=Re,nt=Re;function it(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||tt).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone}function st(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[tt.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function at(e,t,r){var n,i,s,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)s=p([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return r?"MMM"===t?-1!==(i=Ue.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ue.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ue.call(this._shortMonthsParse,a))||-1!==(i=Ue.call(this._longMonthsParse,a))?i:null:-1!==(i=Ue.call(this._longMonthsParse,a))||-1!==(i=Ue.call(this._shortMonthsParse,a))?i:null}function ot(e,t,r){var n,i,s;if(this._monthsParseExact)return at.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=p([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),r&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(r&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}}function lt(e,t){var r;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=ce(t);else if(!c(t=e.localeData().monthsParse(t)))return e;return r=Math.min(e.date(),Xe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,r),e}function ct(e){return null!=e?(lt(this,e),r.updateOffset(this,!0),this):de(this,"Month")}function ht(){return Xe(this.year(),this.month())}function dt(e){return this._monthsParseExact?(a(this,"_monthsRegex")||pt.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=rt),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function ut(e){return this._monthsParseExact?(a(this,"_monthsRegex")||pt.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=nt),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function pt(){function e(e,t){return t.length-e.length}var t,r,n=[],i=[],s=[];for(t=0;t<12;t++)r=p([2e3,t]),n.push(this.monthsShort(r,"")),i.push(this.months(r,"")),s.push(this.months(r,"")),s.push(this.monthsShort(r,""));for(n.sort(e),i.sort(e),s.sort(e),t=0;t<12;t++)n[t]=Le(n[t]),i[t]=Le(i[t]);for(t=0;t<24;t++)s[t]=Le(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function ft(e){return oe(e)?366:365}B("Y",0,0,(function(){var e=this.year();return e<=9999?$(e,4):"+"+e})),B(0,["YY",2],0,(function(){return this.year()%100})),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),te("year","y"),se("year",1),Oe("Y",Ie),Oe("YY",Ee,ye),Oe("YYYY",xe,be),Oe("YYYYY",Pe,Se),Oe("YYYYYY",Pe,Se),Ne(["YYYYY","YYYYYY"],ze),Ne("YYYY",(function(e,t){t[ze]=2===e.length?r.parseTwoDigitYear(e):ce(e)})),Ne("YY",(function(e,t){t[ze]=r.parseTwoDigitYear(e)})),Ne("Y",(function(e,t){t[ze]=parseInt(e,10)})),r.parseTwoDigitYear=function(e){return ce(e)+(ce(e)>68?1900:2e3)};var mt=he("FullYear",!0);function gt(){return oe(this.year())}function yt(e,t,r,n,i,s,a){var o;return e<100&&e>=0?(o=new Date(e+400,t,r,n,i,s,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,r,n,i,s,a),o}function vt(e){var t,r;return e<100&&e>=0?((r=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function bt(e,t,r){var n=7+t-r;return-(7+vt(e,0,n).getUTCDay()-t)%7+n-1}function St(e,t,r,n,i){var s,a,o=1+7*(t-1)+(7+r-n)%7+bt(e,n,i);return o<=0?a=ft(s=e-1)+o:o>ft(e)?(s=e+1,a=o-ft(e)):(s=e,a=o),{year:s,dayOfYear:a}}function Et(e,t,r){var n,i,s=bt(e.year(),t,r),a=Math.floor((e.dayOfYear()-s-1)/7)+1;return a<1?n=a+Ct(i=e.year()-1,t,r):a>Ct(e.year(),t,r)?(n=a-Ct(e.year(),t,r),i=e.year()+1):(i=e.year(),n=a),{week:n,year:i}}function Ct(e,t,r){var n=bt(e,t,r),i=bt(e+1,t,r);return(ft(e)-n+i)/7}function _t(e){return Et(e,this._week.dow,this._week.doy).week}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),te("week","w"),te("isoWeek","W"),se("week",5),se("isoWeek",5),Oe("w",Ee),Oe("ww",Ee,ye),Oe("W",Ee),Oe("WW",Ee,ye),Be(["w","ww","W","WW"],(function(e,t,r,n){t[n.substr(0,1)]=ce(e)}));var Tt={dow:0,doy:6};function xt(){return this._week.dow}function Pt(){return this._week.doy}function wt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function It(e){var t=Et(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function kt(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function At(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Mt(e,t){return e.slice(t,7).concat(e.slice(0,t))}B("d",0,"do","day"),B("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),B("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),B("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),te("day","d"),te("weekday","e"),te("isoWeekday","E"),se("day",11),se("weekday",11),se("isoWeekday",11),Oe("d",Ee),Oe("e",Ee),Oe("E",Ee),Oe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Oe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Oe("dddd",(function(e,t){return t.weekdaysRegex(e)})),Be(["dd","ddd","dddd"],(function(e,t,r,n){var i=r._locale.weekdaysParse(e,n,r._strict);null!=i?t.d=i:m(r).invalidWeekday=e})),Be(["d","e","E"],(function(e,t,r,n){t[n]=ce(e)}));var Rt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ot="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$t="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Dt=Re,Lt=Re,Ft=Re;function Nt(e,t){var r=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Mt(r,this._week.dow):e?r[e.day()]:r}function Bt(e){return!0===e?Mt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Vt(e){return!0===e?Mt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ut(e,t,r){var n,i,s,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return r?"dddd"===t?-1!==(i=Ue.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ue.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ue.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ue.call(this._weekdaysParse,a))||-1!==(i=Ue.call(this._shortWeekdaysParse,a))||-1!==(i=Ue.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ue.call(this._shortWeekdaysParse,a))||-1!==(i=Ue.call(this._weekdaysParse,a))||-1!==(i=Ue.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ue.call(this._minWeekdaysParse,a))||-1!==(i=Ue.call(this._weekdaysParse,a))||-1!==(i=Ue.call(this._shortWeekdaysParse,a))?i:null}function zt(e,t,r){var n,i,s;if(this._weekdaysParseExact)return Ut.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=p([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function jt(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=kt(e,this.localeData()),this.add(e-t,"d")):t}function Gt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ht(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=At(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Zt(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Yt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Dt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Wt(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Yt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Lt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Kt(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Yt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ft),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yt(){function e(e,t){return t.length-e.length}var t,r,n,i,s,a=[],o=[],l=[],c=[];for(t=0;t<7;t++)r=p([2e3,1]).day(t),n=Le(this.weekdaysMin(r,"")),i=Le(this.weekdaysShort(r,"")),s=Le(this.weekdays(r,"")),a.push(n),o.push(i),l.push(s),c.push(n),c.push(i),c.push(s);a.sort(e),o.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function qt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function Xt(e,t){B(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Jt(e,t){return t._meridiemParse}function er(e){return"p"===(e+"").toLowerCase().charAt(0)}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,qt),B("k",["kk",2],0,Qt),B("hmm",0,0,(function(){return""+qt.apply(this)+$(this.minutes(),2)})),B("hmmss",0,0,(function(){return""+qt.apply(this)+$(this.minutes(),2)+$(this.seconds(),2)})),B("Hmm",0,0,(function(){return""+this.hours()+$(this.minutes(),2)})),B("Hmmss",0,0,(function(){return""+this.hours()+$(this.minutes(),2)+$(this.seconds(),2)})),Xt("a",!0),Xt("A",!1),te("hour","h"),se("hour",13),Oe("a",Jt),Oe("A",Jt),Oe("H",Ee),Oe("h",Ee),Oe("k",Ee),Oe("HH",Ee,ye),Oe("hh",Ee,ye),Oe("kk",Ee,ye),Oe("hmm",Ce),Oe("hmmss",_e),Oe("Hmm",Ce),Oe("Hmmss",_e),Ne(["H","HH"],He),Ne(["k","kk"],(function(e,t,r){var n=ce(e);t[He]=24===n?0:n})),Ne(["a","A"],(function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e})),Ne(["h","hh"],(function(e,t,r){t[He]=ce(e),m(r).bigHour=!0})),Ne("hmm",(function(e,t,r){var n=e.length-2;t[He]=ce(e.substr(0,n)),t[Ze]=ce(e.substr(n)),m(r).bigHour=!0})),Ne("hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2;t[He]=ce(e.substr(0,n)),t[Ze]=ce(e.substr(n,2)),t[We]=ce(e.substr(i)),m(r).bigHour=!0})),Ne("Hmm",(function(e,t,r){var n=e.length-2;t[He]=ce(e.substr(0,n)),t[Ze]=ce(e.substr(n))})),Ne("Hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2;t[He]=ce(e.substr(0,n)),t[Ze]=ce(e.substr(n,2)),t[We]=ce(e.substr(i))}));var tr=/[ap]\.?m?\.?/i,rr=he("Hours",!0);function nr(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var ir,sr={calendar:R,longDateFormat:G,invalidDate:Z,ordinal:K,dayOfMonthOrdinalParse:Y,relativeTime:Q,months:Je,monthsShort:et,week:Tt,weekdays:Rt,weekdaysMin:$t,weekdaysShort:Ot,meridiemParse:tr},ar={},or={};function lr(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}function cr(e){return e?e.toLowerCase().replace("_","-"):e}function hr(e){for(var t,r,n,i,s=0;s<e.length;){for(t=(i=cr(e[s]).split("-")).length,r=(r=cr(e[s+1]))?r.split("-"):null;t>0;){if(n=ur(i.slice(0,t).join("-")))return n;if(r&&r.length>=t&&lr(i,r)>=t-1)break;t--}s++}return ir}function dr(e){return null!=e.match("^[^/\\\\]*$")}function ur(e){var t=null;if(void 0===ar[e]&&module&&module.exports&&dr(e))try{t=ir._abbr,commonjsRequire("./locale/"+e),pr(t)}catch(t){ar[e]=null}return ar[e]}function pr(e,t){var r;return e&&((r=l(t)?gr(e):fr(e,t))?ir=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ir._abbr}function fr(e,t){if(null!==t){var r,n=sr;if(t.abbr=e,null!=ar[e])w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ar[e]._config;else if(null!=t.parentLocale)if(null!=ar[t.parentLocale])n=ar[t.parentLocale]._config;else{if(null==(r=ur(t.parentLocale)))return or[t.parentLocale]||(or[t.parentLocale]=[]),or[t.parentLocale].push({name:e,config:t}),null;n=r._config}return ar[e]=new M(A(n,t)),or[e]&&or[e].forEach((function(e){fr(e.name,e.config)})),pr(e),ar[e]}return delete ar[e],null}function mr(e,t){if(null!=t){var r,n,i=sr;null!=ar[e]&&null!=ar[e].parentLocale?ar[e].set(A(ar[e]._config,t)):(null!=(n=ur(e))&&(i=n._config),t=A(i,t),null==n&&(t.abbr=e),(r=new M(t)).parentLocale=ar[e],ar[e]=r),pr(e)}else null!=ar[e]&&(null!=ar[e].parentLocale?(ar[e]=ar[e].parentLocale,e===pr()&&pr(e)):null!=ar[e]&&delete ar[e]);return ar[e]}function gr(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ir;if(!i(e)){if(t=ur(e))return t;e=[e]}return hr(e)}function yr(){return x(ar)}function vr(e){var t,r=e._a;return r&&-2===m(e).overflow&&(t=r[je]<0||r[je]>11?je:r[Ge]<1||r[Ge]>Xe(r[ze],r[je])?Ge:r[He]<0||r[He]>24||24===r[He]&&(0!==r[Ze]||0!==r[We]||0!==r[Ke])?He:r[Ze]<0||r[Ze]>59?Ze:r[We]<0||r[We]>59?We:r[Ke]<0||r[Ke]>999?Ke:-1,m(e)._overflowDayOfYear&&(t<ze||t>Ge)&&(t=Ge),m(e)._overflowWeeks&&-1===t&&(t=Ye),m(e)._overflowWeekday&&-1===t&&(t=qe),m(e).overflow=t),e}var br=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Er=/Z|[+-]\d\d(?::?\d\d)?/,Cr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],_r=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Tr=/^\/?Date\((-?\d+)/i,xr=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Pr={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function wr(e){var t,r,n,i,s,a,o=e._i,l=br.exec(o)||Sr.exec(o),c=Cr.length,h=_r.length;if(l){for(m(e).iso=!0,t=0,r=c;t<r;t++)if(Cr[t][1].exec(l[1])){i=Cr[t][0],n=!1!==Cr[t][2];break}if(null==i)return void(e._isValid=!1);if(l[3]){for(t=0,r=h;t<r;t++)if(_r[t][1].exec(l[3])){s=(l[2]||" ")+_r[t][0];break}if(null==s)return void(e._isValid=!1)}if(!n&&null!=s)return void(e._isValid=!1);if(l[4]){if(!Er.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=i+(s||"")+(a||""),Br(e)}else e._isValid=!1}function Ir(e,t,r,n,i,s){var a=[kr(e),et.indexOf(t),parseInt(r,10),parseInt(n,10),parseInt(i,10)];return s&&a.push(parseInt(s,10)),a}function kr(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ar(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Mr(e,t,r){return!e||Ot.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(m(r).weekdayMismatch=!0,r._isValid=!1,!1)}function Rr(e,t,r){if(e)return Pr[e];if(t)return 0;var n=parseInt(r,10),i=n%100;return(n-i)/100*60+i}function Or(e){var t,r=xr.exec(Ar(e._i));if(r){if(t=Ir(r[4],r[3],r[2],r[5],r[6],r[7]),!Mr(r[1],t,e))return;e._a=t,e._tzm=Rr(r[8],r[9],r[10]),e._d=vt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0}else e._isValid=!1}function $r(e){var t=Tr.exec(e._i);null===t?(wr(e),!1===e._isValid&&(delete e._isValid,Or(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Dr(e,t,r){return null!=e?e:null!=t?t:r}function Lr(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Fr(e){var t,r,n,i,s,a=[];if(!e._d){for(n=Lr(e),e._w&&null==e._a[Ge]&&null==e._a[je]&&Nr(e),null!=e._dayOfYear&&(s=Dr(e._a[ze],n[ze]),(e._dayOfYear>ft(s)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),r=vt(s,0,e._dayOfYear),e._a[je]=r.getUTCMonth(),e._a[Ge]=r.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=n[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[He]&&0===e._a[Ze]&&0===e._a[We]&&0===e._a[Ke]&&(e._nextDay=!0,e._a[He]=0),e._d=(e._useUTC?vt:yt).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[He]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(m(e).weekdayMismatch=!0)}}function Nr(e){var t,r,n,i,s,a,o,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(s=1,a=4,r=Dr(t.GG,e._a[ze],Et(Wr(),1,4).year),n=Dr(t.W,1),((i=Dr(t.E,1))<1||i>7)&&(l=!0)):(s=e._locale._week.dow,a=e._locale._week.doy,c=Et(Wr(),s,a),r=Dr(t.gg,e._a[ze],c.year),n=Dr(t.w,c.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+s,(t.e<0||t.e>6)&&(l=!0)):i=s),n<1||n>Ct(r,s,a)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(o=St(r,n,i,s,a),e._a[ze]=o.year,e._dayOfYear=o.dayOfYear)}function Br(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,n,i,s,a,o,l,c=""+e._i,h=c.length,d=0;for(l=(i=j(e._f,e._locale).match(D)||[]).length,t=0;t<l;t++)s=i[t],(n=(c.match($e(s,e))||[])[0])&&((a=c.substr(0,c.indexOf(n))).length>0&&m(e).unusedInput.push(a),c=c.slice(c.indexOf(n)+n.length),d+=n.length),N[s]?(n?m(e).empty=!1:m(e).unusedTokens.push(s),Ve(s,n,e)):e._strict&&!n&&m(e).unusedTokens.push(s);m(e).charsLeftOver=h-d,c.length>0&&m(e).unusedInput.push(c),e._a[He]<=12&&!0===m(e).bigHour&&e._a[He]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[He]=Vr(e._locale,e._a[He],e._meridiem),null!==(o=m(e).era)&&(e._a[ze]=e._locale.erasConvertYear(o,e._a[ze])),Fr(e),vr(e)}else Or(e);else wr(e)}function Vr(e,t,r){var n;return null==r?t:null!=e.meridiemHour?e.meridiemHour(t,r):null!=e.isPM?((n=e.isPM(r))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function Ur(e){var t,r,n,i,s,a,o=!1,l=e._f.length;if(0===l)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<l;i++)s=0,a=!1,t=S({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Br(t),g(t)&&(a=!0),s+=m(t).charsLeftOver,s+=10*m(t).unusedTokens.length,m(t).score=s,o?s<n&&(n=s,r=t):(null==n||s<n||a)&&(n=s,r=t,a&&(o=!0));u(e,r||t)}function zr(e){if(!e._d){var t=ne(e._i),r=void 0===t.day?t.date:t.day;e._a=d([t.year,t.month,r,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),Fr(e)}}function jr(e){var t=new E(vr(Gr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Gr(e){var t=e._i,r=e._f;return e._locale=e._locale||gr(e._l),null===t||void 0===r&&""===t?y({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),C(t)?new E(vr(t)):(h(t)?e._d=t:i(r)?Ur(e):r?Br(e):Hr(e),g(e)||(e._d=null),e))}function Hr(e){var t=e._i;l(t)?e._d=new Date(r.now()):h(t)?e._d=new Date(t.valueOf()):"string"==typeof t?$r(e):i(t)?(e._a=d(t.slice(0),(function(e){return parseInt(e,10)})),Fr(e)):s(t)?zr(e):c(t)?e._d=new Date(t):r.createFromInputFallback(e)}function Zr(e,t,r,n,a){var l={};return!0!==t&&!1!==t||(n=t,t=void 0),!0!==r&&!1!==r||(n=r,r=void 0),(s(e)&&o(e)||i(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=r,l._i=e,l._f=t,l._strict=n,jr(l)}function Wr(e,t,r,n){return Zr(e,t,r,n,!1)}r.createFromInputFallback=T("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),r.ISO_8601=function(){},r.RFC_2822=function(){};var Kr=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Wr.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:y()})),Yr=T("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Wr.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:y()}));function qr(e,t){var r,n;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Wr();for(r=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](r)||(r=t[n]);return r}function Qr(){return qr("isBefore",[].slice.call(arguments,0))}function Xr(){return qr("isAfter",[].slice.call(arguments,0))}var Jr=function(){return Date.now?Date.now():+new Date},en=["year","quarter","month","week","day","hour","minute","second","millisecond"];function tn(e){var t,r,n=!1,i=en.length;for(t in e)if(a(e,t)&&(-1===Ue.call(en,t)||null!=e[t]&&isNaN(e[t])))return!1;for(r=0;r<i;++r)if(e[en[r]]){if(n)return!1;parseFloat(e[en[r]])!==ce(e[en[r]])&&(n=!0)}return!0}function rn(){return this._isValid}function nn(){return wn(NaN)}function sn(e){var t=ne(e),r=t.year||0,n=t.quarter||0,i=t.month||0,s=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,l=t.minute||0,c=t.second||0,h=t.millisecond||0;this._isValid=tn(t),this._milliseconds=+h+1e3*c+6e4*l+1e3*o*60*60,this._days=+a+7*s,this._months=+i+3*n+12*r,this._data={},this._locale=gr(),this._bubble()}function an(e){return e instanceof sn}function on(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function ln(e,t,r){var n,i=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),a=0;for(n=0;n<i;n++)(r&&e[n]!==t[n]||!r&&ce(e[n])!==ce(t[n]))&&a++;return a+s}function cn(e,t){B(e,0,0,(function(){var e=this.utcOffset(),r="+";return e<0&&(e=-e,r="-"),r+$(~~(e/60),2)+t+$(~~e%60,2)}))}cn("Z",":"),cn("ZZ",""),Oe("Z",Ae),Oe("ZZ",Ae),Ne(["Z","ZZ"],(function(e,t,r){r._useUTC=!0,r._tzm=dn(Ae,e)}));var hn=/([\+\-]|\d\d)/gi;function dn(e,t){var r,n,i=(t||"").match(e);return null===i?null:0===(n=60*(r=((i[i.length-1]||[])+"").match(hn)||["-",0,0])[1]+ce(r[2]))?0:"+"===r[0]?n:-n}function un(e,t){var n,i;return t._isUTC?(n=t.clone(),i=(C(e)||h(e)?e.valueOf():Wr(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),r.updateOffset(n,!1),n):Wr(e).local()}function pn(e){return-Math.round(e._d.getTimezoneOffset())}function fn(e,t,n){var i,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=dn(Ae,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(i=pn(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==e&&(!t||this._changeInProgress?Rn(this,wn(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:pn(this)}function mn(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function gn(e){return this.utcOffset(0,e)}function yn(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(pn(this),"m")),this}function vn(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=dn(ke,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function bn(e){return!!this.isValid()&&(e=e?Wr(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function Sn(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function En(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return S(t,this),(t=Gr(t))._a?(e=t._isUTC?p(t._a):Wr(t._a),this._isDSTShifted=this.isValid()&&ln(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Cn(){return!!this.isValid()&&!this._isUTC}function _n(){return!!this.isValid()&&this._isUTC}function Tn(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var xn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Pn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function wn(e,t){var r,n,i,s=e,o=null;return an(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(o=xn.exec(e))?(r="-"===o[1]?-1:1,s={y:0,d:ce(o[Ge])*r,h:ce(o[He])*r,m:ce(o[Ze])*r,s:ce(o[We])*r,ms:ce(on(1e3*o[Ke]))*r}):(o=Pn.exec(e))?(r="-"===o[1]?-1:1,s={y:In(o[2],r),M:In(o[3],r),w:In(o[4],r),d:In(o[5],r),h:In(o[6],r),m:In(o[7],r),s:In(o[8],r)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(i=An(Wr(s.from),Wr(s.to)),(s={}).ms=i.milliseconds,s.M=i.months),n=new sn(s),an(e)&&a(e,"_locale")&&(n._locale=e._locale),an(e)&&a(e,"_isValid")&&(n._isValid=e._isValid),n}function In(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function kn(e,t){var r={};return r.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function An(e,t){var r;return e.isValid()&&t.isValid()?(t=un(t,e),e.isBefore(t)?r=kn(e,t):((r=kn(t,e)).milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function Mn(e,t){return function(r,n){var i;return null===n||isNaN(+n)||(w(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=n,n=i),Rn(this,wn(r,n),e),this}}function Rn(e,t,n,i){var s=t._milliseconds,a=on(t._days),o=on(t._months);e.isValid()&&(i=null==i||i,o&<(e,de(e,"Month")+o*n),a&&ue(e,"Date",de(e,"Date")+a*n),s&&e._d.setTime(e._d.valueOf()+s*n),i&&r.updateOffset(e,a||o))}wn.fn=sn.prototype,wn.invalid=nn;var On=Mn(1,"add"),$n=Mn(-1,"subtract");function Dn(e){return"string"==typeof e||e instanceof String}function Ln(e){return C(e)||h(e)||Dn(e)||c(e)||Nn(e)||Fn(e)||null==e}function Fn(e){var t,r,n=s(e)&&!o(e),i=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],c=l.length;for(t=0;t<c;t+=1)r=l[t],i=i||a(e,r);return n&&i}function Nn(e){var t=i(e),r=!1;return t&&(r=0===e.filter((function(t){return!c(t)&&Dn(e)})).length),t&&r}function Bn(e){var t,r,n=s(e)&&!o(e),i=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<l.length;t+=1)r=l[t],i=i||a(e,r);return n&&i}function Vn(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function Un(e,t){1===arguments.length&&(arguments[0]?Ln(arguments[0])?(e=arguments[0],t=void 0):Bn(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Wr(),i=un(n,this).startOf("day"),s=r.calendarFormat(this,i)||"sameElse",a=t&&(I(t[s])?t[s].call(this,n):t[s]);return this.format(a||this.localeData().calendar(s,this,Wr(n)))}function zn(){return new E(this)}function jn(e,t){var r=C(e)?e:Wr(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf())}function Gn(e,t){var r=C(e)?e:Wr(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf())}function Hn(e,t,r,n){var i=C(e)?e:Wr(e),s=C(t)?t:Wr(t);return!!(this.isValid()&&i.isValid()&&s.isValid())&&("("===(n=n||"()")[0]?this.isAfter(i,r):!this.isBefore(i,r))&&(")"===n[1]?this.isBefore(s,r):!this.isAfter(s,r))}function Zn(e,t){var r,n=C(e)?e:Wr(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf()))}function Wn(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Kn(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Yn(e,t,r){var n,i,s;if(!this.isValid())return NaN;if(!(n=un(e,this)).isValid())return NaN;switch(i=6e4*(n.utcOffset()-this.utcOffset()),t=re(t)){case"year":s=qn(this,n)/12;break;case"month":s=qn(this,n);break;case"quarter":s=qn(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-i)/864e5;break;case"week":s=(this-n-i)/6048e5;break;default:s=this-n}return r?s:le(s)}function qn(e,t){if(e.date()<t.date())return-qn(t,e);var r=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(r,"months");return-(r+(t-n<0?(t-n)/(n-e.clone().add(r-1,"months")):(t-n)/(e.clone().add(r+1,"months")-n)))||0}function Qn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Xn(e){if(!this.isValid())return null;var t=!0!==e,r=t?this.clone().utc():this;return r.year()<0||r.year()>9999?z(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):I(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",z(r,"Z")):z(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,r,n,i="moment",s="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",s="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",n=s+'[")]',this.format(e+t+r+n)}function ei(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=z(this,e);return this.localeData().postformat(t)}function ti(e,t){return this.isValid()&&(C(e)&&e.isValid()||Wr(e).isValid())?wn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ri(e){return this.from(Wr(),e)}function ni(e,t){return this.isValid()&&(C(e)&&e.isValid()||Wr(e).isValid())?wn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ii(e){return this.to(Wr(),e)}function si(e){var t;return void 0===e?this._locale._abbr:(null!=(t=gr(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ai=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function oi(){return this._locale}var li=1e3,ci=60*li,hi=60*ci,di=3506328*hi;function ui(e,t){return(e%t+t)%t}function pi(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-di:new Date(e,t,r).valueOf()}function fi(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-di:Date.UTC(e,t,r)}function mi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?fi:pi,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ui(t+(this._isUTC?0:this.utcOffset()*ci),hi);break;case"minute":t=this._d.valueOf(),t-=ui(t,ci);break;case"second":t=this._d.valueOf(),t-=ui(t,li)}return this._d.setTime(t),r.updateOffset(this,!0),this}function gi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?fi:pi,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=hi-ui(t+(this._isUTC?0:this.utcOffset()*ci),hi)-1;break;case"minute":t=this._d.valueOf(),t+=ci-ui(t,ci)-1;break;case"second":t=this._d.valueOf(),t+=li-ui(t,li)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function yi(){return this._d.valueOf()-6e4*(this._offset||0)}function vi(){return Math.floor(this.valueOf()/1e3)}function bi(){return new Date(this.valueOf())}function Si(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ei(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ci(){return this.isValid()?this.toISOString():null}function _i(){return g(this)}function Ti(){return u({},m(this))}function xi(){return m(this).overflow}function Pi(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function wi(e,t){var n,i,s,a=this._eras||gr("en")._eras;for(n=0,i=a.length;n<i;++n)switch("string"==typeof a[n].since&&(s=r(a[n].since).startOf("day"),a[n].since=s.valueOf()),typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":s=r(a[n].until).startOf("day").valueOf(),a[n].until=s.valueOf()}return a}function Ii(e,t,r){var n,i,s,a,o,l=this.eras();for(e=e.toUpperCase(),n=0,i=l.length;n<i;++n)if(s=l[n].name.toUpperCase(),a=l[n].abbr.toUpperCase(),o=l[n].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(a===e)return l[n];break;case"NNNN":if(s===e)return l[n];break;case"NNNNN":if(o===e)return l[n]}else if([s,a,o].indexOf(e)>=0)return l[n]}function ki(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Ai(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].name;if(n[e].until<=r&&r<=n[e].since)return n[e].name}return""}function Mi(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].narrow;if(n[e].until<=r&&r<=n[e].since)return n[e].narrow}return""}function Ri(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].abbr;if(n[e].until<=r&&r<=n[e].since)return n[e].abbr}return""}function Oi(){var e,t,n,i,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=s[e].since<=s[e].until?1:-1,i=this.clone().startOf("day").valueOf(),s[e].since<=i&&i<=s[e].until||s[e].until<=i&&i<=s[e].since)return(this.year()-r(s[e].since).year())*n+s[e].offset;return this.year()}function $i(e){return a(this,"_erasNameRegex")||Ui.call(this),e?this._erasNameRegex:this._erasRegex}function Di(e){return a(this,"_erasAbbrRegex")||Ui.call(this),e?this._erasAbbrRegex:this._erasRegex}function Li(e){return a(this,"_erasNarrowRegex")||Ui.call(this),e?this._erasNarrowRegex:this._erasRegex}function Fi(e,t){return t.erasAbbrRegex(e)}function Ni(e,t){return t.erasNameRegex(e)}function Bi(e,t){return t.erasNarrowRegex(e)}function Vi(e,t){return t._eraYearOrdinalRegex||we}function Ui(){var e,t,r=[],n=[],i=[],s=[],a=this.eras();for(e=0,t=a.length;e<t;++e)n.push(Le(a[e].name)),r.push(Le(a[e].abbr)),i.push(Le(a[e].narrow)),s.push(Le(a[e].name)),s.push(Le(a[e].abbr)),s.push(Le(a[e].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+n.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+i.join("|")+")","i")}function zi(e,t){B(0,[e,e.length],0,t)}function ji(e){return Yi.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Gi(e){return Yi.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Hi(){return Ct(this.year(),1,4)}function Zi(){return Ct(this.isoWeekYear(),1,4)}function Wi(){var e=this.localeData()._week;return Ct(this.year(),e.dow,e.doy)}function Ki(){var e=this.localeData()._week;return Ct(this.weekYear(),e.dow,e.doy)}function Yi(e,t,r,n,i){var s;return null==e?Et(this,n,i).year:(t>(s=Ct(e,n,i))&&(t=s),qi.call(this,e,t,r,n,i))}function qi(e,t,r,n,i){var s=St(e,t,r,n,i),a=vt(s.year,0,s.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Qi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),Oe("N",Fi),Oe("NN",Fi),Oe("NNN",Fi),Oe("NNNN",Ni),Oe("NNNNN",Bi),Ne(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,r,n){var i=r._locale.erasParse(e,n,r._strict);i?m(r).era=i:m(r).invalidEra=e})),Oe("y",we),Oe("yy",we),Oe("yyy",we),Oe("yyyy",we),Oe("yo",Vi),Ne(["y","yy","yyy","yyyy"],ze),Ne(["yo"],(function(e,t,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ze]=r._locale.eraYearOrdinalParse(e,i):t[ze]=parseInt(e,10)})),B(0,["gg",2],0,(function(){return this.weekYear()%100})),B(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),zi("gggg","weekYear"),zi("ggggg","weekYear"),zi("GGGG","isoWeekYear"),zi("GGGGG","isoWeekYear"),te("weekYear","gg"),te("isoWeekYear","GG"),se("weekYear",1),se("isoWeekYear",1),Oe("G",Ie),Oe("g",Ie),Oe("GG",Ee,ye),Oe("gg",Ee,ye),Oe("GGGG",xe,be),Oe("gggg",xe,be),Oe("GGGGG",Pe,Se),Oe("ggggg",Pe,Se),Be(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,r,n){t[n.substr(0,2)]=ce(e)})),Be(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),B("Q",0,"Qo","quarter"),te("quarter","Q"),se("quarter",7),Oe("Q",ge),Ne("Q",(function(e,t){t[je]=3*(ce(e)-1)})),B("D",["DD",2],"Do","date"),te("date","D"),se("date",9),Oe("D",Ee),Oe("DD",Ee,ye),Oe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Ne(["D","DD"],Ge),Ne("Do",(function(e,t){t[Ge]=ce(e.match(Ee)[0])}));var Xi=he("Date",!0);function Ji(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}B("DDD",["DDDD",3],"DDDo","dayOfYear"),te("dayOfYear","DDD"),se("dayOfYear",4),Oe("DDD",Te),Oe("DDDD",ve),Ne(["DDD","DDDD"],(function(e,t,r){r._dayOfYear=ce(e)})),B("m",["mm",2],0,"minute"),te("minute","m"),se("minute",14),Oe("m",Ee),Oe("mm",Ee,ye),Ne(["m","mm"],Ze);var es=he("Minutes",!1);B("s",["ss",2],0,"second"),te("second","s"),se("second",15),Oe("s",Ee),Oe("ss",Ee,ye),Ne(["s","ss"],We);var ts,rs,ns=he("Seconds",!1);for(B("S",0,0,(function(){return~~(this.millisecond()/100)})),B(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),B(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),B(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),B(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),B(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),B(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),te("millisecond","ms"),se("millisecond",16),Oe("S",Te,ge),Oe("SS",Te,ye),Oe("SSS",Te,ve),ts="SSSS";ts.length<=9;ts+="S")Oe(ts,we);function is(e,t){t[Ke]=ce(1e3*("0."+e))}for(ts="S";ts.length<=9;ts+="S")Ne(ts,is);function ss(){return this._isUTC?"UTC":""}function as(){return this._isUTC?"Coordinated Universal Time":""}rs=he("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var os=E.prototype;function ls(e){return Wr(1e3*e)}function cs(){return Wr.apply(null,arguments).parseZone()}function hs(e){return e}os.add=On,os.calendar=Un,os.clone=zn,os.diff=Yn,os.endOf=gi,os.format=ei,os.from=ti,os.fromNow=ri,os.to=ni,os.toNow=ii,os.get=pe,os.invalidAt=xi,os.isAfter=jn,os.isBefore=Gn,os.isBetween=Hn,os.isSame=Zn,os.isSameOrAfter=Wn,os.isSameOrBefore=Kn,os.isValid=_i,os.lang=ai,os.locale=si,os.localeData=oi,os.max=Yr,os.min=Kr,os.parsingFlags=Ti,os.set=fe,os.startOf=mi,os.subtract=$n,os.toArray=Si,os.toObject=Ei,os.toDate=bi,os.toISOString=Xn,os.inspect=Jn,"undefined"!=typeof Symbol&&null!=Symbol.for&&(os[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),os.toJSON=Ci,os.toString=Qn,os.unix=vi,os.valueOf=yi,os.creationData=Pi,os.eraName=Ai,os.eraNarrow=Mi,os.eraAbbr=Ri,os.eraYear=Oi,os.year=mt,os.isLeapYear=gt,os.weekYear=ji,os.isoWeekYear=Gi,os.quarter=os.quarters=Qi,os.month=ct,os.daysInMonth=ht,os.week=os.weeks=wt,os.isoWeek=os.isoWeeks=It,os.weeksInYear=Wi,os.weeksInWeekYear=Ki,os.isoWeeksInYear=Hi,os.isoWeeksInISOWeekYear=Zi,os.date=Xi,os.day=os.days=jt,os.weekday=Gt,os.isoWeekday=Ht,os.dayOfYear=Ji,os.hour=os.hours=rr,os.minute=os.minutes=es,os.second=os.seconds=ns,os.millisecond=os.milliseconds=rs,os.utcOffset=fn,os.utc=gn,os.local=yn,os.parseZone=vn,os.hasAlignedHourOffset=bn,os.isDST=Sn,os.isLocal=Cn,os.isUtcOffset=_n,os.isUtc=Tn,os.isUTC=Tn,os.zoneAbbr=ss,os.zoneName=as,os.dates=T("dates accessor is deprecated. Use date instead.",Xi),os.months=T("months accessor is deprecated. Use month instead",ct),os.years=T("years accessor is deprecated. Use year instead",mt),os.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mn),os.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",En);var ds=M.prototype;function us(e,t,r,n){var i=gr(),s=p().set(n,t);return i[r](s,e)}function ps(e,t,r){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return us(e,t,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=us(e,n,r,"month");return i}function fs(e,t,r,n){"boolean"==typeof e?(c(t)&&(r=t,t=void 0),t=t||""):(r=t=e,e=!1,c(t)&&(r=t,t=void 0),t=t||"");var i,s=gr(),a=e?s._week.dow:0,o=[];if(null!=r)return us(t,(r+a)%7,n,"day");for(i=0;i<7;i++)o[i]=us(t,(i+a)%7,n,"day");return o}function ms(e,t){return ps(e,t,"months")}function gs(e,t){return ps(e,t,"monthsShort")}function ys(e,t,r){return fs(e,t,r,"weekdays")}function vs(e,t,r){return fs(e,t,r,"weekdaysShort")}function bs(e,t,r){return fs(e,t,r,"weekdaysMin")}ds.calendar=O,ds.longDateFormat=H,ds.invalidDate=W,ds.ordinal=q,ds.preparse=hs,ds.postformat=hs,ds.relativeTime=X,ds.pastFuture=J,ds.set=k,ds.eras=wi,ds.erasParse=Ii,ds.erasConvertYear=ki,ds.erasAbbrRegex=Di,ds.erasNameRegex=$i,ds.erasNarrowRegex=Li,ds.months=it,ds.monthsShort=st,ds.monthsParse=ot,ds.monthsRegex=ut,ds.monthsShortRegex=dt,ds.week=_t,ds.firstDayOfYear=Pt,ds.firstDayOfWeek=xt,ds.weekdays=Nt,ds.weekdaysMin=Vt,ds.weekdaysShort=Bt,ds.weekdaysParse=zt,ds.weekdaysRegex=Zt,ds.weekdaysShortRegex=Wt,ds.weekdaysMinRegex=Kt,ds.isPM=er,ds.meridiem=nr,pr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===ce(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=T("moment.lang is deprecated. Use moment.locale instead.",pr),r.langData=T("moment.langData is deprecated. Use moment.localeData instead.",gr);var Ss=Math.abs;function Es(){var e=this._data;return this._milliseconds=Ss(this._milliseconds),this._days=Ss(this._days),this._months=Ss(this._months),e.milliseconds=Ss(e.milliseconds),e.seconds=Ss(e.seconds),e.minutes=Ss(e.minutes),e.hours=Ss(e.hours),e.months=Ss(e.months),e.years=Ss(e.years),this}function Cs(e,t,r,n){var i=wn(t,r);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function _s(e,t){return Cs(this,e,t,1)}function Ts(e,t){return Cs(this,e,t,-1)}function xs(e){return e<0?Math.floor(e):Math.ceil(e)}function Ps(){var e,t,r,n,i,s=this._milliseconds,a=this._days,o=this._months,l=this._data;return s>=0&&a>=0&&o>=0||s<=0&&a<=0&&o<=0||(s+=864e5*xs(Is(o)+a),a=0,o=0),l.milliseconds=s%1e3,e=le(s/1e3),l.seconds=e%60,t=le(e/60),l.minutes=t%60,r=le(t/60),l.hours=r%24,a+=le(r/24),o+=i=le(ws(a)),a-=xs(Is(i)),n=le(o/12),o%=12,l.days=a,l.months=o,l.years=n,this}function ws(e){return 4800*e/146097}function Is(e){return 146097*e/4800}function ks(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,r=this._months+ws(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Is(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function As(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ce(this._months/12):NaN}function Ms(e){return function(){return this.as(e)}}var Rs=Ms("ms"),Os=Ms("s"),$s=Ms("m"),Ds=Ms("h"),Ls=Ms("d"),Fs=Ms("w"),Ns=Ms("M"),Bs=Ms("Q"),Vs=Ms("y");function Us(){return wn(this)}function zs(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function js(e){return function(){return this.isValid()?this._data[e]:NaN}}var Gs=js("milliseconds"),Hs=js("seconds"),Zs=js("minutes"),Ws=js("hours"),Ks=js("days"),Ys=js("months"),qs=js("years");function Qs(){return le(this.days()/7)}var Xs=Math.round,Js={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ea(e,t,r,n,i){return i.relativeTime(t||1,!!r,e,n)}function ta(e,t,r,n){var i=wn(e).abs(),s=Xs(i.as("s")),a=Xs(i.as("m")),o=Xs(i.as("h")),l=Xs(i.as("d")),c=Xs(i.as("M")),h=Xs(i.as("w")),d=Xs(i.as("y")),u=s<=r.ss&&["s",s]||s<r.s&&["ss",s]||a<=1&&["m"]||a<r.m&&["mm",a]||o<=1&&["h"]||o<r.h&&["hh",o]||l<=1&&["d"]||l<r.d&&["dd",l];return null!=r.w&&(u=u||h<=1&&["w"]||h<r.w&&["ww",h]),(u=u||c<=1&&["M"]||c<r.M&&["MM",c]||d<=1&&["y"]||["yy",d])[2]=t,u[3]=+e>0,u[4]=n,ea.apply(null,u)}function ra(e){return void 0===e?Xs:"function"==typeof e&&(Xs=e,!0)}function na(e,t){return void 0!==Js[e]&&(void 0===t?Js[e]:(Js[e]=t,"s"===e&&(Js.ss=t-1),!0))}function ia(e,t){if(!this.isValid())return this.localeData().invalidDate();var r,n,i=!1,s=Js;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(s=Object.assign({},Js,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),n=ta(this,!i,s,r=this.localeData()),i&&(n=r.pastFuture(+this,n)),r.postformat(n)}var sa=Math.abs;function aa(e){return(e>0)-(e<0)||+e}function oa(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r,n,i,s,a,o,l=sa(this._milliseconds)/1e3,c=sa(this._days),h=sa(this._months),d=this.asSeconds();return d?(e=le(l/60),t=le(e/60),l%=60,e%=60,r=le(h/12),h%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",s=aa(this._months)!==aa(d)?"-":"",a=aa(this._days)!==aa(d)?"-":"",o=aa(this._milliseconds)!==aa(d)?"-":"",i+"P"+(r?s+r+"Y":"")+(h?s+h+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(l?o+n+"S":"")):"P0D"}var la=sn.prototype;return la.isValid=rn,la.abs=Es,la.add=_s,la.subtract=Ts,la.as=ks,la.asMilliseconds=Rs,la.asSeconds=Os,la.asMinutes=$s,la.asHours=Ds,la.asDays=Ls,la.asWeeks=Fs,la.asMonths=Ns,la.asQuarters=Bs,la.asYears=Vs,la.valueOf=As,la._bubble=Ps,la.clone=Us,la.get=zs,la.milliseconds=Gs,la.seconds=Hs,la.minutes=Zs,la.hours=Ws,la.days=Ks,la.weeks=Qs,la.months=Ys,la.years=qs,la.humanize=ia,la.toISOString=oa,la.toString=oa,la.toJSON=oa,la.locale=si,la.localeData=oi,la.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",oa),la.lang=ai,B("X",0,0,"unix"),B("x",0,0,"valueOf"),Oe("x",Ie),Oe("X",Me),Ne("X",(function(e,t,r){r._d=new Date(1e3*parseFloat(e))})),Ne("x",(function(e,t,r){r._d=new Date(ce(e))})),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var sdp={exports:{}};!function(e){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const r=t.splitSections(e);return r&&r[0]},t.getMediaSections=function(e){const r=t.splitSections(e);return r.shift(),r},t.matchPrefix=function(e,r){return t.splitLines(e).filter((e=>0===e.indexOf(r)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const r={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":r.relatedAddress=t[e+1];break;case"rport":r.relatedPort=parseInt(t[e+1],10);break;case"tcptype":r.tcpType=t[e+1];break;case"ufrag":r.ufrag=t[e+1],r.usernameFragment=t[e+1];break;default:void 0===r[t[e]]&&(r[t[e]]=t[e+1])}return r},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const r=e.component;"rtp"===r?t.push(1):"rtcp"===r?t.push(2):t.push(r),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substring(14).split(" ")},t.parseRtpMap=function(e){let t=e.substring(9).split(" ");const r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},t.parseFmtp=function(e){const t={};let r;const n=e.substring(e.indexOf(" ")+1).split(";");for(let e=0;e<n.length;e++)r=n[e].trim().split("="),t[r[0].trim()]=r[1];return t},t.writeFmtp=function(e){let t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const n=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),r={ssrc:parseInt(e.substring(7,t),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substring(t+1,n),r.value=e.substring(n+1)):r.attribute=e.substring(t+1),r},t.parseSsrcGroup=function(e){const t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const r=t.matchPrefix(e,"a=mid:")[0];if(r)return r.substring(6)},t.parseFingerprint=function(e){const t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,r){return{role:"auto",fingerprints:t.matchPrefix(e+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},t.parseCryptoLine=function(e){const t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,r){return t.matchPrefix(e+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,r){const n=t.matchPrefix(e+r,"a=ice-ufrag:")[0],i=t.matchPrefix(e+r,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=t.splitLines(e)[0].split(" ");r.profile=n[2];for(let i=3;i<n.length;i++){const s=n[i],a=t.matchPrefix(e,"a=rtpmap:"+s+" ")[0];if(a){const n=t.parseRtpMap(a),i=t.matchPrefix(e,"a=fmtp:"+s+" ");switch(n.parameters=i.length?t.parseFmtp(i[0]):{},n.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+s+" ").map(t.parseRtcpFb),r.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(n.name.toUpperCase())}}}t.matchPrefix(e,"a=extmap:").forEach((e=>{r.headerExtensions.push(t.parseExtmap(e))}));const i=t.matchPrefix(e,"a=rtcp-fb:* ").map(t.parseRtcpFb);return r.codecs.forEach((e=>{i.forEach((t=>{e.rtcpFeedback.find((e=>e.type===t.type&&e.parameter===t.parameter))||e.rtcpFeedback.push(t)}))})),r},t.writeRtpDescription=function(e,r){let n="";n+="m="+e+" ",n+=r.codecs.length>0?"9":"0",n+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=r.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((e=>{n+=t.writeRtpMap(e),n+=t.writeFmtp(e),n+=t.writeRtcpFb(e)}));let i=0;return r.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((e=>{n+=t.writeExtmap(e)})),n},t.parseRtpEncodingParameters=function(e){const r=[],n=t.parseRtpParameters(e),i=-1!==n.fecMechanisms.indexOf("RED"),s=-1!==n.fecMechanisms.indexOf("ULPFEC"),a=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),o=a.length>0&&a[0].ssrc;let l;const c=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substring(17).split(" ").map((e=>parseInt(e,10)))));c.length>0&&c[0].length>1&&c[0][0]===o&&(l=c[0][1]),n.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:o,codecPayloadType:parseInt(e.parameters.apt,10)};o&&l&&(t.rtx={ssrc:l}),r.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:o,mechanism:s?"red+ulpfec":"red"},r.push(t))}})),0===r.length&&o&&r.push({ssrc:o});let h=t.matchPrefix(e,"b=");return h.length&&(h=0===h[0].indexOf("b=TIAS:")?parseInt(h[0].substring(7),10):0===h[0].indexOf("b=AS:")?1e3*parseInt(h[0].substring(5),10)*.95-16e3:void 0,r.forEach((e=>{e.maxBitrate=h}))),r},t.parseRtcpParameters=function(e){const r={},n=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];n&&(r.cname=n.value,r.ssrc=n.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");r.reducedSize=i.length>0,r.compound=0===i.length;const s=t.matchPrefix(e,"a=rtcp-mux");return r.mux=s.length>0,r},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let r;const n=t.matchPrefix(e,"a=msid:");if(1===n.length)return r=n[0].substring(7).split(" "),{stream:r[0],track:r[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(r=i[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},t.parseSctpDescription=function(e){const r=t.parseMLine(e),n=t.matchPrefix(e,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const s=t.matchPrefix(e,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:r.fmt,maxMessageSize:i};const a=t.matchPrefix(e,"a=sctpmap:");if(a.length>0){const e=a[0].substring(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(e,r,n){let i;const s=void 0!==r?r:2;i=e||t.generateSessionId();return"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+s+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,r){const n=t.splitLines(e);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substring(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const r=t.splitLines(e)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(e){const r=t.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const r=t.splitLines(e);for(let e=0;e<r.length;e++)if(r[e].length<2||"="!==r[e].charAt(1))return!1;return!0},e.exports=t}(sdp);var t,s,n$1={d:(e,t)=>{for(var r in t)n$1.o(t,r)&&!n$1.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},r$1={},e;n$1.d(r$1,{Dz:()=>me,g$:()=>A$1,Lt:()=>R$1,Q9:()=>x$1,qf:()=>L$1,hV:()=>Me,z$:()=>Te,J0:()=>fe,De:()=>ge,$C:()=>ue,al:()=>_$1,_W:()=>W$1,tz:()=>B$1,Nu:()=>Ce,zg:()=>Oe,vp:()=>ne,vU:()=>re,wF:()=>q$1,rv:()=>pe,Nh:()=>ve,ss:()=>Fe,qW:()=>J$1,QL:()=>Y$1,cf:()=>Ie,eM:()=>$$a,Yd:()=>i,iM:()=>p$1,qy:()=>o$1,ce:()=>v$2,sK:()=>oe,Ok:()=>ce,q5:()=>Ee,g:()=>vt,xl:()=>N$1,I:()=>K$1,bx:()=>Q$1,Ib:()=>b$1,Az:()=>M$1,Iw:()=>w$2,qY:()=>k$1,db:()=>P$1,mR:()=>Z$1,Tn:()=>C$1,rV:()=>X$1,gh:()=>V$1,i5:()=>j$1,x_:()=>de,Am:()=>lt$1,eR:()=>F$1,r8:()=>H$1,u3:()=>Ue,vd:()=>O$1,iV:()=>I$1,jZ:()=>U$1,SW:()=>z$2,ZH:()=>G$1,Ni:()=>ht,lh:()=>D$1,bq:()=>f$1,$f:()=>St,eu:()=>se,Ax:()=>te,Mc:()=>ee});class i{static GetStackTrace(){const e=new Error;let t="No Stack Available for this browser";return e.stack&&(t=e.stack.toString().replace(/Error/g,"")),t}static SetLoggerVerbosity(e){null!=this.verboseLogLevel&&(this.verboseLogLevel=e)}static Log(e,t,r){if(r>this.verboseLogLevel)return;const n=`Level: Log\nMsg: ${t}\nCaller: ${e}`;console.log(n)}static Info(e,t,r){if(r>this.verboseLogLevel)return;const n=`Level: Info\nMsg: ${t}`;console.info(n)}static Error(e,t){const r=`Level: Error\nMsg: ${t}\nCaller: ${e}`;console.error(r)}static Warning(e,t){const r=`Level: Warning\nCaller: ${e}\nMsg: ${t}`;console.warn(r)}}i.verboseLogLevel=5,e=t||(t={}),e.LIST_STREAMERS="listStreamers",e.SUBSCRIBE="subscribe",e.UNSUBSCRIBE="unsubscribe",e.ICE_CANDIDATE="iceCandidate",e.OFFER="offer",e.ANSWER="answer",e.DATACHANNELREQUEST="dataChannelRequest",e.SFURECVDATACHANNELREADY="peerDataChannelsReady",e.PONG="pong";class o$1{payload(){return i.Log(i.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}class a$1 extends o$1{constructor(){super(),this.type=t.LIST_STREAMERS}}class d$1 extends o$1{constructor(e){super(),this.type=t.SUBSCRIBE,this.streamerId=e}}class l$1 extends o$1{constructor(){super(),this.type=t.UNSUBSCRIBE}}class c$1 extends o$1{constructor(e){super(),this.type=t.PONG,this.time=e}}class h$2 extends o$1{constructor(e){super(),this.type=t.OFFER,e&&(this.type=e.type,this.sdp=e.sdp)}}class g$1 extends o$1{constructor(e){super(),this.type=t.ANSWER,e&&(this.type=e.type,this.sdp=e.sdp)}}class u$1 extends o$1{constructor(){super(),this.type=t.DATACHANNELREQUEST}}class m$1 extends o$1{constructor(){super(),this.type=t.SFURECVDATACHANNELREADY}}class S$1{constructor(e){this.type=t.ICE_CANDIDATE,this.candidate=e}payload(){return i.Log(i.GetStackTrace(),"Sending => \n"+JSON.stringify(this,void 0,4),6),JSON.stringify(this)}}!function(e){e.CONFIG="config",e.STREAMER_LIST="streamerList",e.PLAYER_COUNT="playerCount",e.OFFER="offer",e.ANSWER="answer",e.ICE_CANDIDATE="iceCandidate",e.PEER_DATA_CHANNELS="peerDataChannels",e.PING="ping",e.WARNING="warning"}(s||(s={}));class p$1{}class v$2 extends p$1{}class C$1{constructor(){this.FromUEMessageHandlers=new Map}addMessageHandler(e,t){this.FromUEMessageHandlers.set(e,t)}handleMessage(e,t){this.FromUEMessageHandlers.has(e)?this.FromUEMessageHandlers.get(e)(t):i.Error(i.GetStackTrace(),`Message type of ${e} does not have a message handler registered on the frontend - ignoring message.`)}static setupDefaultHandlers(e){e.signallingProtocol.addMessageHandler(s.PING,(t=>{const r=new c$1((new Date).getTime()).payload();i.Log(i.GetStackTrace(),s.PING+": "+t,6),e.webSocket.send(r)})),e.signallingProtocol.addMessageHandler(s.CONFIG,(t=>{i.Log(i.GetStackTrace(),s.CONFIG,6);const r=JSON.parse(t);e.onConfig(r)})),e.signallingProtocol.addMessageHandler(s.STREAMER_LIST,(t=>{i.Log(i.GetStackTrace(),s.STREAMER_LIST,6);const r=JSON.parse(t);e.onStreamerList(r)})),e.signallingProtocol.addMessageHandler(s.PLAYER_COUNT,(e=>{i.Log(i.GetStackTrace(),s.PLAYER_COUNT,6);const t=JSON.parse(e);i.Log(i.GetStackTrace(),"Player Count: "+t.count,6)})),e.signallingProtocol.addMessageHandler(s.ANSWER,(t=>{i.Log(i.GetStackTrace(),s.ANSWER,6);const r=JSON.parse(t);e.onWebRtcAnswer(r)})),e.signallingProtocol.addMessageHandler(s.OFFER,(t=>{i.Log(i.GetStackTrace(),s.OFFER,6);const r=JSON.parse(t);e.onWebRtcOffer(r)})),e.signallingProtocol.addMessageHandler(s.ICE_CANDIDATE,(t=>{i.Log(i.GetStackTrace(),s.ICE_CANDIDATE,6);const r=JSON.parse(t);e.onIceCandidate(r.candidate)})),e.signallingProtocol.addMessageHandler(s.WARNING,(e=>{i.Warning(i.GetStackTrace(),`Warning received: ${e}`)})),e.signallingProtocol.addMessageHandler(s.PEER_DATA_CHANNELS,(t=>{i.Log(i.GetStackTrace(),s.PEER_DATA_CHANNELS,6);const r=JSON.parse(t);e.onWebRtcPeerDataChannels(r)}))}}class f$1{constructor(){this.WS_OPEN_STATE=1,this.onOpen=new EventTarget,this.onClose=new EventTarget,this.signallingProtocol=new C$1,C$1.setupDefaultHandlers(this)}connect(e){i.Log(i.GetStackTrace(),e,6);try{return this.webSocket=new WebSocket(e),this.webSocket.onopen=e=>this.handleOnOpen(e),this.webSocket.onerror=()=>this.handleOnError(),this.webSocket.onclose=e=>this.handleOnClose(e),this.webSocket.onmessage=e=>this.handleOnMessage(e),this.webSocket.onmessagebinary=e=>this.handleOnMessageBinary(e),!0}catch(e){return i.Error(e,e),!1}}handleOnMessageBinary(e){e&&e.data&&e.data.text().then((e=>{const t=new MessageEvent("messageFromBinary",{data:e});this.handleOnMessage(t)})).catch((e=>{i.Error(i.GetStackTrace(),`Failed to parse binary blob from websocket, reason: ${e}`)}))}handleOnMessage(e){if(e.data&&e.data instanceof Blob)return void this.handleOnMessageBinary(e);const t=JSON.parse(e.data);i.Log(i.GetStackTrace(),"received => \n"+JSON.stringify(JSON.parse(e.data),void 0,4),6),this.signallingProtocol.handleMessage(t.type,e.data)}handleOnOpen(e){i.Log(i.GetStackTrace(),"Connected to the signalling server via WebSocket",6),this.onOpen.dispatchEvent(new Event("open"))}handleOnError(){i.Error(i.GetStackTrace(),"WebSocket error")}handleOnClose(e){this.onWebSocketOncloseOverlayMessage(e),i.Log(i.GetStackTrace(),"Disconnected to the signalling server via WebSocket: "+JSON.stringify(e.code)+" - "+e.reason),this.onClose.dispatchEvent(new Event("close"))}requestStreamerList(){const e=new a$1;this.webSocket.send(e.payload())}sendSubscribe(e){const t=new d$1(e);this.webSocket.send(t.payload())}sendUnsubscribe(){const e=new l$1;this.webSocket.send(e.payload())}sendWebRtcOffer(e){const t=new h$2(e);this.webSocket.send(t.payload())}sendWebRtcAnswer(e){const t=new g$1(e);this.webSocket.send(t.payload())}sendWebRtcDatachannelRequest(){const e=new u$1;this.webSocket.send(e.payload())}sendSFURecvDataChannelReady(){const e=new m$1;this.webSocket.send(e.payload())}sendIceCandidate(e){if(i.Log(i.GetStackTrace(),"Sending Ice Candidate"),this.webSocket&&this.webSocket.readyState===this.WS_OPEN_STATE){const t=new S$1(e);this.webSocket.send(t.payload())}}close(){var e;null===(e=this.webSocket)||void 0===e||e.close()}onWebSocketOncloseOverlayMessage(e){}onConfig(e){}onStreamerList(e){}onIceCandidate(e){}onWebRtcAnswer(e){}onWebRtcOffer(e){}onWebRtcPeerDataChannels(e){}}class T$1{constructor(e){this.videoElementProvider=e,this.audioElement=document.createElement("Audio")}handleOnTrack(e){i.Log(i.GetStackTrace(),"handleOnTrack "+JSON.stringify(e.streams),6);const t=this.videoElementProvider.getVideoElement();if(e.track&&i.Log(i.GetStackTrace(),"Got track - "+e.track.kind+" id="+e.track.id+" readyState="+e.track.readyState,6),"audio"!=e.track.kind)return"video"==e.track.kind&&t.srcObject!==e.streams[0]?(t.srcObject=e.streams[0],void i.Log(i.GetStackTrace(),"Set video source from video track ontrack.")):void 0;this.CreateAudioTrack(e.streams[0])}CreateAudioTrack(e){const t=this.videoElementProvider.getVideoElement();t.srcObject!=e&&t.srcObject&&t.srcObject!==e&&(this.audioElement.srcObject=e,i.Log(i.GetStackTrace(),"Created new audio element to play separate audio stream."))}}class E$1{constructor(e){this.freezeFrameHeight=0,this.freezeFrameWidth=0,this.rootDiv=e,this.rootElement=document.createElement("div"),this.rootElement.id="freezeFrame",this.rootElement.style.display="none",this.rootElement.style.pointerEvents="none",this.rootElement.style.position="absolute",this.rootElement.style.zIndex="20",this.imageElement=document.createElement("img"),this.imageElement.style.position="absolute",this.rootElement.appendChild(this.imageElement),this.rootDiv.appendChild(this.rootElement)}setElementForShow(){this.rootElement.style.display="block"}setElementForHide(){this.rootElement.style.display="none"}updateImageElementSource(e){const t=btoa(e.reduce(((e,t)=>e+String.fromCharCode(t)),""));this.imageElement.src="data:image/jpeg;base64,"+t}setDimensionsFromElementAndResize(){this.freezeFrameHeight=this.imageElement.naturalHeight,this.freezeFrameWidth=this.imageElement.naturalWidth,this.resize()}resize(){if(0!==this.freezeFrameWidth&&0!==this.freezeFrameHeight){let e=0,t=0,r=0,n=0;const i=this.rootDiv.clientWidth/this.rootDiv.clientHeight,s=this.freezeFrameWidth/this.freezeFrameHeight;i<s?(e=this.rootDiv.clientWidth,t=Math.floor(this.rootDiv.clientWidth/s),r=Math.floor(.5*(this.rootDiv.clientHeight-t)),n=0):(e=Math.floor(this.rootDiv.clientHeight*s),t=this.rootDiv.clientHeight,r=0,n=Math.floor(.5*(this.rootDiv.clientWidth-e))),this.rootElement.style.width=this.rootDiv.offsetWidth+"px",this.rootElement.style.height=this.rootDiv.offsetHeight+"px",this.rootElement.style.left="0px",this.rootElement.style.top="0px",this.imageElement.style.width=e+"px",this.imageElement.style.height=t+"px",this.imageElement.style.left=n+"px",this.imageElement.style.top=r+"px"}}}class y$1{constructor(e){this.receiving=!1,this.size=0,this.jpeg=void 0,this.valid=!1,this.freezeFrameDelay=50,this.freezeFrame=new E$1(e)}showFreezeFrame(){this.valid&&this.freezeFrame.setElementForShow()}hideFreezeFrame(){this.valid=!1,this.freezeFrame.setElementForHide()}updateFreezeFrameAndShow(e,t){this.freezeFrame.updateImageElementSource(e),this.freezeFrame.imageElement.onload=()=>{this.freezeFrame.setDimensionsFromElementAndResize(),t()}}processFreezeFrameMessage(e,t){this.receiving||(this.receiving=!0,this.valid=!1,this.size=0,this.jpeg=void 0),this.size=new DataView(e.slice(1,5).buffer).getInt32(0,!0);const r=e.slice(5);if(this.jpeg){const e=new Uint8Array(this.jpeg.length+r.length);e.set(this.jpeg,0),e.set(r,this.jpeg.length),this.jpeg=e}else this.jpeg=r,this.receiving=!0,i.Log(i.GetStackTrace(),`received first chunk of freeze frame: ${this.jpeg.length}/${this.size}`,6);this.jpeg.length===this.size?(this.receiving=!1,this.valid=!0,i.Log(i.GetStackTrace(),`received complete freeze frame ${this.size}`,6),this.updateFreezeFrameAndShow(this.jpeg,t)):this.jpeg.length>this.size&&(i.Error(i.GetStackTrace(),`received bigger freeze frame than advertised: ${this.jpeg.length}/${this.size}`),this.jpeg=void 0,this.receiving=!1)}}class b$1{constructor(e,t,r,n,i=(()=>{})){this.onChange=i,this.onChangeEmit=()=>{},this.id=e,this.description=r,this.label=t,this.value=n}set label(e){this._label=e,this.onChangeEmit(this._value)}get label(){return this._label}get value(){return this._value}set value(e){this._value=e,this.onChange(this._value,this),this.onChangeEmit(this._value)}}class M$1 extends b$1{constructor(e,t,r,n,i,s=(()=>{})){super(e,t,r,n,s);const a=new URLSearchParams(window.location.search);if(i&&a.has(this.id)){const e=this.getUrlParamFlag();this.flag=e}else this.flag=n;this.useUrlParams=i}getUrlParamFlag(){const e=new URLSearchParams(window.location.search);return!!e.has(this.id)&&"false"!==e.get(this.id)&&"False"!==e.get(this.id)}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);!0===this.flag?e.set(this.id,"true"):e.set(this.id,"false"),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}enable(){this.flag=!0}get flag(){return!!this.value}set flag(e){this.value=e}}class w$2 extends b$1{constructor(e,t,r,n,i,s,a,o=(()=>{})){super(e,t,r,s,o),this._min=n,this._max=i;const l=new URLSearchParams(window.location.search);if(a&&l.has(this.id)){const e=Number.parseInt(l.get(this.id));this.number=Number.isNaN(e)?s:e}else this.number=s;this.useUrlParams=a}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.number.toString()),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}set number(e){this.value=this.clamp(e)}get number(){return this.value}clamp(e){return Math.max(Math.min(this._max,e),this._min)}get min(){return this._min}get max(){return this._max}addOnChangedListener(e){this.onChange=e}}class P$1 extends b$1{constructor(e,t,r,n,i,s=(()=>{})){super(e,t,r,n,s);const a=new URLSearchParams(window.location.search);if(i&&a.has(this.id)){const e=this.getUrlParamText();this.text=e}else this.text=n;this.useUrlParams=i}getUrlParamText(){var e;const t=new URLSearchParams(window.location.search);return t.has(this.id)&&null!==(e=t.get(this.id))&&void 0!==e?e:""}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.text),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}get text(){return this.value}set text(e){this.value=e}}class k$1 extends b$1{constructor(e,t,r,n,i,s,a=(()=>{})){super(e,t,r,[n,n],a),this.options=i;const o=new URLSearchParams(window.location.search),l=s&&o.has(this.id)?this.getUrlParamText():n;this.selected=l,this.useUrlParams=s}getUrlParamText(){var e;const t=new URLSearchParams(window.location.search);return t.has(this.id)&&null!==(e=t.get(this.id))&&void 0!==e?e:""}updateURLParams(){if(this.useUrlParams){const e=new URLSearchParams(window.location.search);e.set(this.id,this.selected),window.history.replaceState({},"",""!==e.toString()?`${location.pathname}?${e}`:`${location.pathname}`)}}addOnChangedListener(e){this.onChange=e}get options(){return this._options}set options(e){this._options=e,this.onChangeEmit(this.selected)}get selected(){return this.value}set selected(e){const t=this.options.filter((t=>-1!==t.indexOf(e)));t.length&&(this.value=t[0])}}class R$1 extends Event{constructor(e){super("afkWarningActivate"),this.data=e}}class L$1 extends Event{constructor(e){super("afkWarningUpdate"),this.data=e}}class x$1 extends Event{constructor(){super("afkWarningDeactivate")}}class A$1 extends Event{constructor(){super("afkTimedOut")}}class F$1 extends Event{constructor(e){super("videoEncoderAvgQP"),this.data=e}}class D$1 extends Event{constructor(){super("webRtcSdp")}}class O$1 extends Event{constructor(){super("webRtcAutoConnect")}}class U$1 extends Event{constructor(){super("webRtcConnecting")}}class I$1 extends Event{constructor(){super("webRtcConnected")}}class G$1 extends Event{constructor(){super("webRtcFailed")}}class z$2 extends Event{constructor(e){super("webRtcDisconnected"),this.data=e}}class B$1 extends Event{constructor(e){super("dataChannelOpen"),this.data=e}}class _$1 extends Event{constructor(e){super("dataChannelClose"),this.data=e}}class W$1 extends Event{constructor(e){super("dataChannelError"),this.data=e}}class H$1 extends Event{constructor(){super("videoInitialized")}}class V$1 extends Event{constructor(){super("streamLoading")}}class N$1 extends Event{constructor(e){super("playStreamError"),this.data=e}}class K$1 extends Event{constructor(){super("playStream")}}class Q$1 extends Event{constructor(e){super("playStreamRejected"),this.data=e}}class $$a extends Event{constructor(e){super("loadFreezeFrame"),this.data=e}}class q$1 extends Event{constructor(){super("hideFreezeFrame")}}class X$1 extends Event{constructor(e){super("statsReceived"),this.data=e}}class j$1 extends Event{constructor(e){super("streamerListMessage"),this.data=e}}class Y$1 extends Event{constructor(e){super("latencyTestResult"),this.data=e}}class J$1 extends Event{constructor(e){super("initialSettings"),this.data=e}}class Z$1 extends Event{constructor(e){super("settingsChanged"),this.data=e}}class ee extends Event{constructor(){super("xrSessionStarted")}}class te extends Event{constructor(){super("xrSessionEnded")}}class se extends Event{constructor(e){super("xrFrame"),this.data=e}}class ne extends EventTarget{dispatchEvent(e){return super.dispatchEvent(e)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}}class re{}re.AutoConnect="AutoConnect",re.AutoPlayVideo="AutoPlayVideo",re.AFKDetection="TimeoutIfIdle",re.BrowserSendOffer="OfferToReceive",re.HoveringMouseMode="HoveringMouse",re.ForceMonoAudio="ForceMonoAudio",re.ForceTURN="ForceTURN",re.FakeMouseWithTouches="FakeMouseWithTouches",re.IsQualityController="ControlsQuality",re.MatchViewportResolution="MatchViewportRes",re.PreferSFU="preferSFU",re.StartVideoMuted="StartVideoMuted",re.SuppressBrowserKeys="SuppressBrowserKeys",re.UseMic="UseMic",re.KeyboardInput="KeyboardInput",re.MouseInput="MouseInput",re.TouchInput="TouchInput",re.GamepadInput="GamepadInput",re.XRControllerInput="XRControllerInput";const ie=e=>Object.getOwnPropertyNames(re).some((t=>re[t]===e));class oe{}oe.AFKTimeoutSecs="AFKTimeout",oe.MinQP="MinQP",oe.MaxQP="MaxQP",oe.WebRTCFPS="WebRTCFPS",oe.WebRTCMinBitrate="WebRTCMinBitrate",oe.WebRTCMaxBitrate="WebRTCMaxBitrate";const ae=e=>Object.getOwnPropertyNames(oe).some((t=>oe[t]===e));class de{}de.SignallingServerUrl="ss";const le=e=>Object.getOwnPropertyNames(de).some((t=>de[t]===e));class ce{}ce.PreferredCodec="PreferredCodec",ce.StreamerId="StreamerId";const he=e=>Object.getOwnPropertyNames(ce).some((t=>ce[t]===e));class ge{constructor(e={}){this.flags=new Map,this.numericParameters=new Map,this.textParameters=new Map,this.optionParameters=new Map;const{initialSettings:t,useUrlParams:r}=e;this._useUrlParams=!!r,this.populateDefaultSettings(this._useUrlParams),t&&this.setSettings(t)}get useUrlParams(){return this._useUrlParams}populateDefaultSettings(e){this.textParameters.set(de.SignallingServerUrl,new P$1(de.SignallingServerUrl,"Signalling url","Url of the signalling server",("https:"===location.protocol?"wss://":"ws://")+window.location.hostname+("80"===window.location.port||""===window.location.port?"":`:${window.location.port}`),e)),this.optionParameters.set(ce.StreamerId,new k$1(ce.StreamerId,"Streamer ID","The ID of the streamer to stream.","",[],e)),this.optionParameters.set(ce.PreferredCodec,new k$1(ce.PreferredCodec,"Preferred Codec","The preferred codec to be used during codec negotiation","H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",function(){const e=[];if(!RTCRtpReceiver.getCapabilities)return e.push("Only available on Chrome"),e;const t=/(VP\d|H26\d|AV1).*/;return RTCRtpReceiver.getCapabilities("video").codecs.forEach((r=>{const n=r.mimeType.split("/")[1]+" "+(r.sdpFmtpLine||"");null!==t.exec(n)&&e.push(n)})),e}(),e)),this.flags.set(re.AutoConnect,new M$1(re.AutoConnect,"Auto connect to stream","Whether we should attempt to auto connect to the signalling server or show a click to start prompt.",!1,e)),this.flags.set(re.AutoPlayVideo,new M$1(re.AutoPlayVideo,"Auto play video","When video is ready automatically start playing it as opposed to showing a play button.",!0,e)),this.flags.set(re.BrowserSendOffer,new M$1(re.BrowserSendOffer,"Browser send offer","Browser will initiate the WebRTC handshake by sending the offer to the streamer",!1,e)),this.flags.set(re.UseMic,new M$1(re.UseMic,"Use microphone","Make browser request microphone access and open an input audio track.",!1,e)),this.flags.set(re.StartVideoMuted,new M$1(re.StartVideoMuted,"Start video muted","Video will start muted if true.",!1,e)),this.flags.set(re.SuppressBrowserKeys,new M$1(re.SuppressBrowserKeys,"Suppress browser keys","Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.",!0,e)),this.flags.set(re.PreferSFU,new M$1(re.PreferSFU,"Prefer SFU","Try to connect to the SFU instead of P2P.",!1,e)),this.flags.set(re.IsQualityController,new M$1(re.IsQualityController,"Is quality controller?","True if this peer controls stream quality",!0,e)),this.flags.set(re.ForceMonoAudio,new M$1(re.ForceMonoAudio,"Force mono audio","Force browser to request mono audio in the SDP",!1,e)),this.flags.set(re.ForceTURN,new M$1(re.ForceTURN,"Force TURN","Only generate TURN/Relayed ICE candidates.",!1,e)),this.flags.set(re.AFKDetection,new M$1(re.AFKDetection,"AFK if idle","Timeout the experience if user is AFK for a period.",!1,e)),this.flags.set(re.MatchViewportResolution,new M$1(re.MatchViewportResolution,"Match viewport resolution","Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.",!1,e)),this.flags.set(re.HoveringMouseMode,new M$1(re.HoveringMouseMode,"Control Scheme: Locked Mouse","Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.",!1,e,((e,t)=>{t.label=`Control Scheme: ${e?"Hovering":"Locked"} Mouse`}))),this.flags.set(re.FakeMouseWithTouches,new M$1(re.FakeMouseWithTouches,"Fake mouse with touches","A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.",!1,e)),this.flags.set(re.KeyboardInput,new M$1(re.KeyboardInput,"Keyboard input","If enabled, send keyboard events to streamer",!0,e)),this.flags.set(re.MouseInput,new M$1(re.MouseInput,"Mouse input","If enabled, send mouse events to streamer",!0,e)),this.flags.set(re.TouchInput,new M$1(re.TouchInput,"Touch input","If enabled, send touch events to streamer",!0,e)),this.flags.set(re.GamepadInput,new M$1(re.GamepadInput,"Gamepad input","If enabled, send gamepad events to streamer",!0,e)),this.flags.set(re.XRControllerInput,new M$1(re.XRControllerInput,"XR controller input","If enabled, send XR controller events to streamer",!0,e)),this.numericParameters.set(oe.AFKTimeoutSecs,new w$2(oe.AFKTimeoutSecs,"AFK timeout","The time (in seconds) it takes for the application to time out if AFK timeout is enabled.",0,600,120,e)),this.numericParameters.set(oe.MinQP,new w$2(oe.MinQP,"Min QP","The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,0,e)),this.numericParameters.set(oe.MaxQP,new w$2(oe.MaxQP,"Max QP","The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.",0,51,51,e)),this.numericParameters.set(oe.WebRTCFPS,new w$2(oe.WebRTCFPS,"Max FPS","The maximum FPS that WebRTC will try to transmit frames at.",1,999,60,e)),this.numericParameters.set(oe.WebRTCMinBitrate,new w$2(oe.WebRTCMinBitrate,"Min Bitrate (kbps)","The minimum bitrate that WebRTC should use.",0,5e5,0,e)),this.numericParameters.set(oe.WebRTCMaxBitrate,new w$2(oe.WebRTCMaxBitrate,"Max Bitrate (kbps)","The maximum bitrate that WebRTC should use.",0,5e5,0,e))}_addOnNumericSettingChangedListener(e,t){this.numericParameters.has(e)&&this.numericParameters.get(e).addOnChangedListener(t)}_addOnOptionSettingChangedListener(e,t){this.optionParameters.has(e)&&this.optionParameters.get(e).addOnChangedListener(t)}getNumericSettingValue(e){if(this.numericParameters.has(e))return this.numericParameters.get(e).number;throw new Error(`There is no numeric setting with the id of ${e}`)}getTextSettingValue(e){if(this.textParameters.has(e))return this.textParameters.get(e).value;throw new Error(`There is no numeric setting with the id of ${e}`)}setNumericSetting(e,t){if(!this.numericParameters.has(e))throw new Error(`There is no numeric setting with the id of ${e}`);this.numericParameters.get(e).number=t}_addOnSettingChangedListener(e,t){this.flags.has(e)&&(this.flags.get(e).onChange=t)}_addOnTextSettingChangedListener(e,t){this.textParameters.has(e)&&(this.textParameters.get(e).onChange=t)}getSettingOption(e){return this.optionParameters.get(e)}isFlagEnabled(e){return this.flags.get(e).flag}setFlagEnabled(e,t){this.flags.has(e)?this.flags.get(e).flag=t:i.Warning(i.GetStackTrace(),`Cannot toggle flag called ${e} - it does not exist in the Config.flags map.`)}setTextSetting(e,t){this.textParameters.has(e)?this.textParameters.get(e).text=t:i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.textParameters map.`)}setOptionSettingOptions(e,t){this.optionParameters.has(e)?this.optionParameters.get(e).options=t:i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.optionParameters map.`)}setOptionSettingValue(e,t){this.optionParameters.has(e)?this.optionParameters.get(e).selected=t:i.Warning(i.GetStackTrace(),`Cannot set text setting called ${e} - it does not exist in the Config.enumParameters map.`)}setFlagLabel(e,t){this.flags.has(e)?this.flags.get(e).label=t:i.Warning(i.GetStackTrace(),`Cannot set label for flag called ${e} - it does not exist in the Config.flags map.`)}setSettings(e){for(const t of Object.keys(e))ie(t)?this.setFlagEnabled(t,e[t]):ae(t)?this.setNumericSetting(t,e[t]):le(t)?this.setTextSetting(t,e[t]):he(t)&&this.setOptionSettingValue(t,e[t])}getSettings(){const e={};for(const[t,r]of this.flags.entries())e[t]=r.flag;for(const[t,r]of this.numericParameters.entries())e[t]=r.number;for(const[t,r]of this.textParameters.entries())e[t]=r.text;for(const[t,r]of this.optionParameters.entries())e[t]=r.selected;return e}getFlags(){return Array.from(this.flags.values())}getTextSettings(){return Array.from(this.textParameters.values())}getNumericSettings(){return Array.from(this.numericParameters.values())}getOptionSettings(){return Array.from(this.optionParameters.values())}_registerOnChangeEvents(e){for(const t of this.flags.keys()){const r=this.flags.get(t);r&&(r.onChangeEmit=t=>e.dispatchEvent(new Z$1({id:r.id,type:"flag",value:t,target:r})))}for(const t of this.numericParameters.keys()){const r=this.numericParameters.get(t);r&&(r.onChangeEmit=t=>e.dispatchEvent(new Z$1({id:r.id,type:"number",value:t,target:r})))}for(const t of this.textParameters.keys()){const r=this.textParameters.get(t);r&&(r.onChangeEmit=t=>e.dispatchEvent(new Z$1({id:r.id,type:"text",value:t,target:r})))}for(const t of this.optionParameters.keys()){const r=this.optionParameters.get(t);r&&(r.onChangeEmit=t=>e.dispatchEvent(new Z$1({id:r.id,type:"option",value:t,target:r})))}}}var ue;!function(e){e[e.LockedMouse=0]="LockedMouse",e[e.HoveringMouse=1]="HoveringMouse"}(ue||(ue={}));class me{constructor(e,t,r){this.closeTimeout=10,this.active=!1,this.countdownActive=!1,this.warnTimer=void 0,this.countDown=0,this.countDownTimer=void 0,this.config=e,this.pixelStreaming=t,this.onDismissAfk=r,this.onAFKTimedOutCallback=()=>{console.log("AFK timed out, did you want to override this callback?")}}onAfkClick(){clearInterval(this.countDownTimer),(this.active||this.countdownActive)&&(this.startAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new x$1))}startAfkWarningTimer(){this.config.getNumericSettingValue(oe.AFKTimeoutSecs)>0&&this.config.isFlagEnabled(re.AFKDetection)?this.active=!0:this.active=!1,this.resetAfkWarningTimer()}stopAfkWarningTimer(){this.active=!1,this.countdownActive=!1,clearTimeout(this.warnTimer),clearInterval(this.countDownTimer)}pauseAfkWarningTimer(){this.active=!1}resetAfkWarningTimer(){this.active&&this.config.isFlagEnabled(re.AFKDetection)&&(clearTimeout(this.warnTimer),this.warnTimer=setTimeout((()=>this.activateAfkEvent()),1e3*this.config.getNumericSettingValue(oe.AFKTimeoutSecs)))}activateAfkEvent(){this.pauseAfkWarningTimer(),this.pixelStreaming.dispatchEvent(new R$1({countDown:this.countDown,dismissAfk:this.onDismissAfk})),this.countDown=this.closeTimeout,this.countdownActive=!0,this.pixelStreaming.dispatchEvent(new L$1({countDown:this.countDown})),this.config.isFlagEnabled(re.HoveringMouseMode)||document.exitPointerLock&&document.exitPointerLock(),this.countDownTimer=setInterval((()=>{this.countDown--,0==this.countDown?(this.pixelStreaming.dispatchEvent(new A$1),this.onAFKTimedOutCallback(),i.Log(i.GetStackTrace(),"You have been disconnected due to inactivity"),this.stopAfkWarningTimer()):this.pixelStreaming.dispatchEvent(new L$1({countDown:this.countDown}))}),1e3)}}class Se{constructor(){this.isReceivingFreezeFrame=!1}getDataChannelInstance(){return this}createDataChannel(e,t,r){this.peerConnection=e,this.label=t,this.datachannelOptions=r,null==r&&(this.datachannelOptions={},this.datachannelOptions.ordered=!0),this.dataChannel=this.peerConnection.createDataChannel(this.label,this.datachannelOptions),this.setupDataChannel()}setupDataChannel(){this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=e=>this.handleOnOpen(e),this.dataChannel.onclose=e=>this.handleOnClose(e),this.dataChannel.onmessage=e=>this.handleOnMessage(e),this.dataChannel.onerror=e=>this.handleOnError(e)}handleOnOpen(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) opened.`,7),this.onOpen(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}handleOnClose(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) closed.`,7),this.onClose(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}handleOnMessage(e){i.Log(i.GetStackTrace(),`Data Channel (${this.label}) message: ${e}`,8)}handleOnError(e){var t;i.Log(i.GetStackTrace(),`Data Channel (${this.label}) error: ${e}`,7),this.onError(null===(t=this.dataChannel)||void 0===t?void 0:t.label,e)}onOpen(e,t){}onClose(e,t){}onError(e,t){}}class pe{}class ve{}class Ce{}class fe{}class Te{}class Ee{}class ye{}class be{}class Me{constructor(){this.inboundVideoStats=new ve,this.inboundAudioStats=new pe,this.candidatePair=new Te,this.DataChannelStats=new Ce,this.outBoundVideoStats=new Ee,this.sessionStats=new ye,this.streamStats=new be,this.codecs=new Map}processStats(e){this.localCandidates=new Array,this.remoteCandidates=new Array,e.forEach((e=>{switch(e.type){case"candidate-pair":this.handleCandidatePair(e);break;case"certificate":case"media-source":case"outbound-rtp":case"peer-connection":case"remote-inbound-rtp":case"transport":break;case"codec":this.handleCodec(e);break;case"data-channel":this.handleDataChannel(e);break;case"inbound-rtp":this.handleInBoundRTP(e);break;case"local-candidate":this.handleLocalCandidate(e);break;case"remote-candidate":this.handleRemoteCandidate(e);break;case"remote-outbound-rtp":this.handleRemoteOutBound(e);break;case"track":this.handleTrack(e);break;case"stream":this.handleStream(e);break;default:i.Error(i.GetStackTrace(),"unhandled Stat Type"),i.Log(i.GetStackTrace(),e)}}))}handleStream(e){this.streamStats=e}handleCandidatePair(e){this.candidatePair.bytesReceived=e.bytesReceived,this.candidatePair.bytesSent=e.bytesSent,this.candidatePair.localCandidateId=e.localCandidateId,this.candidatePair.remoteCandidateId=e.remoteCandidateId,this.candidatePair.nominated=e.nominated,this.candidatePair.readable=e.readable,this.candidatePair.selected=e.selected,this.candidatePair.writable=e.writable,this.candidatePair.state=e.state,this.candidatePair.currentRoundTripTime=e.currentRoundTripTime}handleDataChannel(e){this.DataChannelStats.bytesReceived=e.bytesReceived,this.DataChannelStats.bytesSent=e.bytesSent,this.DataChannelStats.dataChannelIdentifier=e.dataChannelIdentifier,this.DataChannelStats.id=e.id,this.DataChannelStats.label=e.label,this.DataChannelStats.messagesReceived=e.messagesReceived,this.DataChannelStats.messagesSent=e.messagesSent,this.DataChannelStats.protocol=e.protocol,this.DataChannelStats.state=e.state,this.DataChannelStats.timestamp=e.timestamp}handleLocalCandidate(e){const t=new fe;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.candidateType=e.candidateType,t.id=e.id,this.localCandidates.push(t)}handleRemoteCandidate(e){const t=new fe;t.label="local-candidate",t.address=e.address,t.port=e.port,t.protocol=e.protocol,t.id=e.id,t.candidateType=e.candidateType,this.remoteCandidates.push(t)}handleInBoundRTP(e){switch(e.kind){case"video":this.inboundVideoStats=e,null!=this.lastVideoStats&&(this.inboundVideoStats.bitrate=8*(this.inboundVideoStats.bytesReceived-this.lastVideoStats.bytesReceived)/(this.inboundVideoStats.timestamp-this.lastVideoStats.timestamp),this.inboundVideoStats.bitrate=Math.floor(this.inboundVideoStats.bitrate)),this.lastVideoStats=Object.assign({},this.inboundVideoStats);break;case"audio":this.inboundAudioStats=e,null!=this.lastAudioStats&&(this.inboundAudioStats.bitrate=8*(this.inboundAudioStats.bytesReceived-this.lastAudioStats.bytesReceived)/(this.inboundAudioStats.timestamp-this.lastAudioStats.timestamp),this.inboundAudioStats.bitrate=Math.floor(this.inboundAudioStats.bitrate)),this.lastAudioStats=Object.assign({},this.inboundAudioStats);break;default:i.Log(i.GetStackTrace(),"Kind is not handled")}}handleRemoteOutBound(e){"video"===e.kind&&(this.outBoundVideoStats.bytesSent=e.bytesSent,this.outBoundVideoStats.id=e.id,this.outBoundVideoStats.localId=e.localId,this.outBoundVideoStats.packetsSent=e.packetsSent,this.outBoundVideoStats.remoteTimestamp=e.remoteTimestamp,this.outBoundVideoStats.timestamp=e.timestamp)}handleTrack(e){"track"!==e.type||"video_label"!==e.trackIdentifier&&"video"!==e.kind||(this.inboundVideoStats.framesDropped=e.framesDropped,this.inboundVideoStats.framesReceived=e.framesReceived,this.inboundVideoStats.frameHeight=e.frameHeight,this.inboundVideoStats.frameWidth=e.frameWidth)}handleCodec(e){const t=e.id,r=`${e.mimeType.replace("video/","").replace("audio/","")}${e.sdpFmtpLine?` ${e.sdpFmtpLine}`:""}`;this.codecs.set(t,r)}handleSessionStatistics(e,t,r){const n=Date.now()-e;this.sessionStats.runTime=new Date(n).toISOString().substr(11,8).toString();const i=null===t?"Not sent yet":t?"true":"false";this.sessionStats.controlsStreamInput=i,this.sessionStats.videoEncoderAvgQP=r}isNumber(e){return"number"==typeof e&&isFinite(e)}}const we=(Pe={parseRtpParameters:()=>sdp.exports.parseRtpParameters,splitSections:()=>sdp.exports.splitSections},ke={},n$1.d(ke,Pe),ke);var Pe,ke,Re,Le,xe=function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))};class Ae{constructor(e,t,r){this.config=t,this.createPeerConnection(e,r)}createPeerConnection(e,t){this.config.isFlagEnabled(re.ForceTURN)&&(e.iceTransportPolicy="relay",i.Log(i.GetStackTrace(),"Forcing TURN usage by setting ICE Transport Policy in peer connection config.")),this.peerConnection=new RTCPeerConnection(e),this.peerConnection.onsignalingstatechange=e=>this.handleSignalStateChange(e),this.peerConnection.oniceconnectionstatechange=e=>this.handleIceConnectionStateChange(e),this.peerConnection.onicegatheringstatechange=e=>this.handleIceGatheringStateChange(e),this.peerConnection.ontrack=e=>this.handleOnTrack(e),this.peerConnection.onicecandidate=e=>this.handleIceCandidate(e),this.peerConnection.ondatachannel=e=>this.handleDataChannel(e),this.aggregatedStats=new Me,this.preferredCodec=t,this.updateCodecSelection=!0}createOffer(e,t){return xe(this,void 0,void 0,(function*(){i.Log(i.GetStackTrace(),"Create Offer",6);const r="localhost"===location.hostname||"127.0.0.1"===location.hostname,n="https:"===location.protocol;let s=t.isFlagEnabled(re.UseMic);!s||r||n||(s=!1,i.Error(i.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),i.Error(i.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(s).finally((()=>{var t;null===(t=this.peerConnection)||void 0===t||t.createOffer(e).then((e=>{var t;this.showTextOverlayConnecting(),e.sdp=this.mungeSDP(e.sdp,s),null===(t=this.peerConnection)||void 0===t||t.setLocalDescription(e),this.onSendWebRTCOffer(e)})).catch((()=>{this.showTextOverlaySetupFailure()}))}))}))}receiveOffer(e,t){var r;return xe(this,void 0,void 0,(function*(){i.Log(i.GetStackTrace(),"Receive Offer",6),null===(r=this.peerConnection)||void 0===r||r.setRemoteDescription(e).then((()=>{const e="localhost"===location.hostname||"127.0.0.1"===location.hostname,r="https:"===location.protocol;let n=t.isFlagEnabled(re.UseMic);!n||e||r||(n=!1,i.Error(i.GetStackTrace(),"Microphone access in the browser will not work if you are not on HTTPS or localhost. Disabling mic access."),i.Error(i.GetStackTrace(),"For testing you can enable HTTP microphone access Chrome by visiting chrome://flags/ and enabling 'unsafely-treat-insecure-origin-as-secure'")),this.setupTransceiversAsync(n).finally((()=>{var e;null===(e=this.peerConnection)||void 0===e||e.createAnswer().then((e=>{var t;return e.sdp=this.mungeSDP(e.sdp,n),null===(t=this.peerConnection)||void 0===t?void 0:t.setLocalDescription(e)})).then((()=>{var e;this.onSendWebRTCAnswer(null===(e=this.peerConnection)||void 0===e?void 0:e.currentLocalDescription)})).catch((()=>{i.Error(i.GetStackTrace(),"createAnswer() failed")}))}))})),this.config.setOptionSettingOptions(ce.PreferredCodec,this.parseAvailableCodecs(e).filter((e=>this.config.getSettingOption(ce.PreferredCodec).options.includes(e))))}))}receiveAnswer(e){var t;null===(t=this.peerConnection)||void 0===t||t.setRemoteDescription(e),this.config.setOptionSettingOptions(ce.PreferredCodec,this.parseAvailableCodecs(e).filter((e=>this.config.getSettingOption(ce.PreferredCodec).options.includes(e))))}generateStats(){var e;null===(e=this.peerConnection)||void 0===e||e.getStats(null).then((e=>{this.aggregatedStats.processStats(e),this.onVideoStats(this.aggregatedStats),this.updateCodecSelection&&this.config.setOptionSettingValue(ce.PreferredCodec,this.aggregatedStats.codecs.get(this.aggregatedStats.inboundVideoStats.codecId))}))}close(){this.peerConnection&&(this.peerConnection.close(),this.peerConnection=null)}mungeSDP(e,t){const r=e;r.replace(/(a=fmtp:\d+ .*level-asymmetry-allowed=.*)\r\n/gm,"$1;x-google-start-bitrate=10000;x-google-max-bitrate=100000\r\n");let n="";return n+="maxaveragebitrate=510000;",t&&(n+="sprop-maxcapturerate=48000;"),n+=this.config.isFlagEnabled(re.ForceMonoAudio)?"stereo=0;":"stereo=1;",n+="useinbandfec=1",r.replace("useinbandfec=1",n),r}handleOnIce(e){var t;i.Log(i.GetStackTrace(),"peerconnection handleOnIce",6),this.config.isFlagEnabled(re.ForceTURN)&&e.candidate.indexOf("relay")<0?i.Info(i.GetStackTrace(),`Dropping candidate because it was not TURN relay. | Type= ${e.type} | Protocol= ${e.protocol} | Address=${e.address} | Port=${e.port} |`,6):null===(t=this.peerConnection)||void 0===t||t.addIceCandidate(e)}handleSignalStateChange(e){i.Log(i.GetStackTrace(),"signaling state change: "+e,6)}handleIceConnectionStateChange(e){i.Log(i.GetStackTrace(),"ice connection state change: "+e,6),this.onIceConnectionStateChange(e)}handleIceGatheringStateChange(e){i.Log(i.GetStackTrace(),"ice gathering state change: "+JSON.stringify(e),6)}handleOnTrack(e){this.onTrack(e)}handleIceCandidate(e){this.onPeerIceCandidate(e)}handleDataChannel(e){this.onDataChannel(e)}onTrack(e){}onIceConnectionStateChange(e){}onPeerIceCandidate(e){}onDataChannel(e){}setupTransceiversAsync(e){var t,r,n,i,s,a,o,l,c;return xe(this,void 0,void 0,(function*(){const h=(null===(t=this.peerConnection)||void 0===t?void 0:t.getTransceivers().length)>0;if(null===(r=this.peerConnection)||void 0===r||r.addTransceiver("video",{direction:"recvonly"}),RTCRtpReceiver.getCapabilities&&""!=this.preferredCodec)for(const e of null!==(i=null===(n=this.peerConnection)||void 0===n?void 0:n.getTransceivers())&&void 0!==i?i:[])if(e&&e.receiver&&e.receiver.track&&"video"===e.receiver.track.kind){const t=this.preferredCodec.split(" "),r=[{mimeType:"video/"+t[0],clockRate:9e4,sdpFmtpLine:t[1]?t[1]:""}];this.config.getSettingOption(ce.PreferredCodec).options.filter((e=>e!=this.preferredCodec)).forEach((e=>{const t=e.split(" ");r.push({mimeType:"video/"+t[0],clockRate:9e4,sdpFmtpLine:t[1]?t[1]:""})}));for(const e of r)""===e.sdpFmtpLine&&delete e.sdpFmtpLine;e.setCodecPreferences(r)}if(e){const t={video:!1,audio:!!e&&{autoGainControl:!1,channelCount:1,echoCancellation:!1,latency:0,noiseSuppression:!1,sampleRate:48e3,sampleSize:16,volume:1}},r=yield navigator.mediaDevices.getUserMedia(t);if(r)if(h){for(const e of null!==(o=null===(a=this.peerConnection)||void 0===a?void 0:a.getTransceivers())&&void 0!==o?o:[])if(e&&e.receiver&&e.receiver.track&&"audio"===e.receiver.track.kind)for(const t of r.getTracks())t.kind&&"audio"==t.kind&&(e.sender.replaceTrack(t),e.direction="sendrecv")}else for(const e of r.getTracks())e.kind&&"audio"==e.kind&&(null===(l=this.peerConnection)||void 0===l||l.addTransceiver(e,{direction:"sendrecv"}));else null===(c=this.peerConnection)||void 0===c||c.addTransceiver("audio",{direction:"recvonly"})}else null===(s=this.peerConnection)||void 0===s||s.addTransceiver("audio",{direction:"recvonly"})}))}onVideoStats(e){}onSendWebRTCOffer(e){}onSendWebRTCAnswer(e){}showTextOverlayConnecting(){}showTextOverlaySetupFailure(){}parseAvailableCodecs(e){if(!RTCRtpReceiver.getCapabilities)return["Only available on Chrome"];const t=[],r=(0,we.splitSections)(e.sdp);return r.shift(),r.forEach((e=>{const{codecs:r}=(0,we.parseRtpParameters)(e),n=/(VP\d|H26\d|AV1).*/;r.forEach((e=>{const r=e.name+" "+Object.keys(e.parameters||{}).map((t=>t+"="+e.parameters[t])).join(";");if(null!==n.exec(r)){"VP9"==e.name&&(e.parameters={"profile-id":"0"});const r=e.name+" "+Object.keys(e.parameters||{}).map((t=>t+"="+e.parameters[t])).join(";");t.push(r)}}))})),t}}class Fe{constructor(){this.PixelStreamingSettings=new De,this.EncoderSettings=new Oe,this.WebRTCSettings=new Ue}ueCompatible(){null!=this.WebRTCSettings.MaxFPS&&(this.WebRTCSettings.FPS=this.WebRTCSettings.MaxFPS)}}class De{}class Oe{}class Ue{}class Ie{constructor(){this.ReceiptTimeMs=null,this.TransmissionTimeMs=null,this.PreCaptureTimeMs=null,this.PostCaptureTimeMs=null,this.PreEncodeTimeMs=null,this.PostEncodeTimeMs=null,this.EncodeMs=null,this.CaptureToSendMs=null,this.testStartTimeMs=0,this.browserReceiptTimeMs=0,this.latencyExcludingDecode=0,this.testDuration=0,this.networkLatency=0,this.browserSendLatency=0,this.frameDisplayDeltaTimeMs=0,this.endToEndLatency=0,this.encodeLatency=0}setFrameDisplayDeltaTime(e){0==this.frameDisplayDeltaTimeMs&&(this.frameDisplayDeltaTimeMs=Math.round(e))}processFields(){null!=this.EncodeMs||null==this.PreEncodeTimeMs&&null==this.PostEncodeTimeMs||(i.Log(i.GetStackTrace(),`Setting Encode Ms \n ${this.PostEncodeTimeMs} \n ${this.PreEncodeTimeMs}`,6),this.EncodeMs=this.PostEncodeTimeMs-this.PreEncodeTimeMs),null!=this.CaptureToSendMs||null==this.PreCaptureTimeMs&&null==this.PostCaptureTimeMs||(i.Log(i.GetStackTrace(),`Setting CaptureToSendMs Ms \n ${this.PostCaptureTimeMs} \n ${this.PreCaptureTimeMs}`,6),this.CaptureToSendMs=this.PostCaptureTimeMs-this.PreCaptureTimeMs)}}class Ge{static setExtensionFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),i.Log(i.GetStackTrace(),"Received first chunk of file",6));const r=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),r,6),t.extension=r}static setMimeTypeFromBytes(e,t){t.receiving||(t.mimetype="",t.extension="",t.receiving=!0,t.valid=!1,t.size=0,t.data=[],t.timestampStart=(new Date).getTime(),i.Log(i.GetStackTrace(),"Received first chunk of file",6));const r=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),r,6),t.mimetype=r}static setContentsFromBytes(e,t){if(!t.receiving)return;t.size=Math.ceil(new DataView(e.slice(1,5).buffer).getInt32(0,!0)/16379);const r=e.slice(5);if(t.data.push(r),i.Log(i.GetStackTrace(),`Received file chunk: ${t.data.length}/${t.size}`,6),t.data.length===t.size){t.receiving=!1,t.valid=!0,i.Log(i.GetStackTrace(),"Received complete file",6);const e=(new Date).getTime()-t.timestampStart,r=Math.round(16*t.size*1024/e);i.Log(i.GetStackTrace(),`Average transfer bitrate: ${r}kb/s over ${e/1e3} seconds`,6);const n=new Blob(t.data,{type:t.mimetype}),s=document.createElement("a");s.setAttribute("href",URL.createObjectURL(n)),s.setAttribute("download",`transfer.${t.extension}`),document.body.append(s),s.remove()}else t.data.length>t.size&&(t.receiving=!1,i.Error(i.GetStackTrace(),`Received bigger file than advertised: ${t.data.length}/${t.size}`))}}class ze{constructor(){this.mimetype="",this.extension="",this.receiving=!1,this.size=0,this.data=[],this.valid=!1}}class Be{}Be.mainButton=0,Be.auxiliaryButton=1,Be.secondaryButton=2,Be.fourthButton=3,Be.fifthButton=4;class _e{}_e.primaryButton=1,_e.secondaryButton=2,_e.auxiliaryButton=4,_e.fourthButton=8,_e.fifthButton=16;class We{constructor(){this.unregisterCallbacks=[]}addUnregisterCallback(e){this.unregisterCallbacks.push(e)}unregisterAll(){for(const e of this.unregisterCallbacks)e();this.unregisterCallbacks=[]}}class He{constructor(e,t,r){this.touchEventListenerTracker=new We,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=r;const n=e=>this.onTouchStart(e),i=e=>this.onTouchEnd(e),s=e=>this.onTouchMove(e);document.addEventListener("touchstart",n,{passive:!1}),document.addEventListener("touchend",i,{passive:!1}),document.addEventListener("touchmove",s,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchstart",n))),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchend",i))),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchmove",s)))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}setVideoElementParentClientRect(e){this.videoElementParentClientRect=e}onTouchStart(e){if(this.videoElementProvider.isVideoReady()){if(null==this.fakeTouchFinger){const t=e.changedTouches[0];this.fakeTouchFinger=new Ve(t.identifier,t.clientX-this.videoElementParentClientRect.left,t.clientY-this.videoElementParentClientRect.top);const r=this.videoElementProvider.getVideoParentElement(),n=new MouseEvent("mouseenter",t);r.dispatchEvent(n);const i=this.coordinateConverter.normalizeAndQuantizeUnsigned(this.fakeTouchFinger.x,this.fakeTouchFinger.y);this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([Be.mainButton,i.x,i.y])}e.preventDefault()}}onTouchEnd(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.videoElementProvider.getVideoParentElement(),r=this.toStreamerMessagesProvider.toStreamerHandlers;for(let n=0;n<e.changedTouches.length;n++){const i=e.changedTouches[n];if(i.identifier===this.fakeTouchFinger.id){const e=i.clientX-this.videoElementParentClientRect.left,n=i.clientY-this.videoElementParentClientRect.top,s=this.coordinateConverter.normalizeAndQuantizeUnsigned(e,n);r.get("MouseUp")([Be.mainButton,s.x,s.y]);const a=new MouseEvent("mouseleave",i);t.dispatchEvent(a),this.fakeTouchFinger=null;break}}e.preventDefault()}onTouchMove(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.toStreamerMessagesProvider.toStreamerHandlers;for(let r=0;r<e.touches.length;r++){const n=e.touches[r];if(n.identifier===this.fakeTouchFinger.id){const e=n.clientX-this.videoElementParentClientRect.left,r=n.clientY-this.videoElementParentClientRect.top,i=this.coordinateConverter.normalizeAndQuantizeUnsigned(e,r),s=this.coordinateConverter.normalizeAndQuantizeSigned(e-this.fakeTouchFinger.x,r-this.fakeTouchFinger.y);t.get("MouseMove")([i.x,i.y,s.x,s.y]),this.fakeTouchFinger.x=e,this.fakeTouchFinger.y=r;break}}e.preventDefault()}}class Ve{constructor(e,t,r){this.id=e,this.x=t,this.y=r}}class Ne{}Ne.backSpace=8,Ne.shift=16,Ne.control=17,Ne.alt=18,Ne.rightShift=253,Ne.rightControl=254,Ne.rightAlt=255;class Ke{constructor(e,t,r){this.keyboardEventListenerTracker=new We,this.CodeToKeyCode={Escape:27,Digit0:48,Digit1:49,Digit2:50,Digit3:51,Digit4:52,Digit5:53,Digit6:54,Digit7:55,Digit8:56,Digit9:57,Minus:173,Equal:187,Backspace:8,Tab:9,KeyQ:81,KeyW:87,KeyE:69,KeyR:82,KeyT:84,KeyY:89,KeyU:85,KeyI:73,KeyO:79,KeyP:80,BracketLeft:219,BracketRight:221,Enter:13,ControlLeft:17,KeyA:65,KeyS:83,KeyD:68,KeyF:70,KeyG:71,KeyH:72,KeyJ:74,KeyK:75,KeyL:76,Semicolon:186,Quote:222,Backquote:192,ShiftLeft:16,Backslash:220,KeyZ:90,KeyX:88,KeyC:67,KeyV:86,KeyB:66,KeyN:78,KeyM:77,Comma:188,Period:190,Slash:191,ShiftRight:253,AltLeft:18,Space:32,CapsLock:20,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,Pause:19,ScrollLock:145,NumpadDivide:111,NumpadMultiply:106,NumpadSubtract:109,NumpadAdd:107,NumpadDecimal:110,Numpad9:105,Numpad8:104,Numpad7:103,Numpad6:102,Numpad5:101,Numpad4:100,Numpad3:99,Numpad2:98,Numpad1:97,Numpad0:96,NumLock:144,ControlRight:254,AltRight:255,Home:36,End:35,ArrowUp:38,ArrowLeft:37,ArrowRight:39,ArrowDown:40,PageUp:33,PageDown:34,Insert:45,Delete:46,ContextMenu:93},this.toStreamerMessagesProvider=e,this.config=t,this.activeKeysProvider=r}registerKeyBoardEvents(){const e=e=>this.handleOnKeyDown(e),t=e=>this.handleOnKeyUp(e),r=e=>this.handleOnKeyPress(e);document.addEventListener("keydown",e),document.addEventListener("keyup",t),document.addEventListener("keypress",r),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keydown",e))),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keyup",t))),this.keyboardEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("keypress",r)))}unregisterKeyBoardEvents(){this.keyboardEventListenerTracker.unregisterAll()}handleOnKeyDown(e){const t=this.getKeycode(e);t&&(i.Log(i.GetStackTrace(),`key down ${t}, repeat = ${e.repeat}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyDown")([this.getKeycode(e),e.repeat?1:0]),this.activeKeysProvider.getActiveKeys().push(t),t===Ne.backSpace&&document.dispatchEvent(new KeyboardEvent("keypress",{charCode:Ne.backSpace})),this.config.isFlagEnabled(re.SuppressBrowserKeys)&&this.isKeyCodeBrowserKey(t)&&e.preventDefault())}handleOnKeyUp(e){const t=this.getKeycode(e);t&&(i.Log(i.GetStackTrace(),`key up ${t}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyUp")([t,e.repeat?1:0]),this.config.isFlagEnabled(re.SuppressBrowserKeys)&&this.isKeyCodeBrowserKey(t)&&e.preventDefault())}handleOnKeyPress(e){if(!("charCode"in e))return void i.Warning(i.GetStackTrace(),"KeyboardEvent.charCode is deprecated in this browser, cannot send key press.");const t=e.charCode;i.Log(i.GetStackTrace(),`key press ${t}`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("KeyPress")([t])}getKeycode(e){if(!("keyCode"in e)){const t=e;return t.code in this.CodeToKeyCode?this.CodeToKeyCode[t.code]:(i.Warning(i.GetStackTrace(),`Keyboard code of ${t.code} is not supported in our mapping, ignoring this key.`),null)}return e.keyCode===Ne.shift&&"ShiftRight"===e.code?Ne.rightShift:e.keyCode===Ne.control&&"ControlRight"===e.code?Ne.rightControl:e.keyCode===Ne.alt&&"AltRight"===e.code?Ne.rightAlt:e.keyCode}isKeyCodeBrowserKey(e){return e>=112&&e<=123||9===e}}class Qe{constructor(e,t,r){this.x=0,this.y=0,this.updateMouseMovePositionEvent=e=>{this.updateMouseMovePosition(e)},this.mouseEventListenerTracker=new We,this.videoElementProvider=e,this.mouseController=t,this.activeKeysProvider=r;const n=this.videoElementProvider.getVideoParentElement();this.x=n.getBoundingClientRect().width/2,this.y=n.getBoundingClientRect().height/2,this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y)}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}lockStateChange(){const e=this.videoElementProvider.getVideoParentElement(),t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;if(document.pointerLockElement===e||document.mozPointerLockElement===e)i.Log(i.GetStackTrace(),"Pointer locked",6),document.addEventListener("mousemove",this.updateMouseMovePositionEvent,!1),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1)));else{i.Log(i.GetStackTrace(),"The pointer lock status is now unlocked",6),document.removeEventListener("mousemove",this.updateMouseMovePositionEvent,!1);let e=this.activeKeysProvider.getActiveKeys();const r=[];new Set(e).forEach((e=>{})),r.forEach((e=>{t.get("KeyUp")([e])})),e=[]}}updateMouseMovePosition(e){if(!this.videoElementProvider.isVideoReady())return;const t=this.mouseController.toStreamerMessagesProvider.toStreamerHandlers,r=this.videoElementProvider.getVideoParentElement().clientWidth,n=this.videoElementProvider.getVideoParentElement().clientHeight;this.x+=e.movementX,this.y+=e.movementY,this.x>r&&(this.x-=r),this.y>n&&(this.y-=n),this.x<0&&(this.x=r+this.x),this.y<0&&(this.y=n-this.y),this.coord=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(this.x,this.y);const i=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY);t.get("MouseMove")([this.coord.x,this.coord.y,i.x,i.y])}handleMouseDown(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,this.coord.x,this.coord.y])}handleMouseUp(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,this.coord.x,this.coord.y])}handleMouseWheel(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,this.coord.x,this.coord.y])}handleMouseDouble(e){this.videoElementProvider.isVideoReady()&&this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,this.coord.x,this.coord.y])}handlePressMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.pressMouseButtons(e.buttons,this.x,this.y)}handleReleaseMouseButtons(e){this.videoElementProvider.isVideoReady()&&this.mouseController.releaseMouseButtons(e.buttons,this.x,this.y)}}class $e{constructor(e){this.mouseController=e}unregisterMouseEvents(){}updateMouseMovePosition(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),"MouseMove",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY),r=this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(e.movementX,e.movementY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseMove")([t.x,t.y,r.x,r.y]),e.preventDefault()}handleMouseDown(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),"onMouse Down",6);const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e.button,t.x,t.y]),e.preventDefault()}handleMouseUp(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,t.x,t.y]),e.preventDefault()}handleContextMenu(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e.button,t.x,t.y]),e.preventDefault()}handleMouseWheel(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseWheel")([e.wheelDelta,t.x,t.y]),e.preventDefault()}handleMouseDouble(e){if(!this.mouseController.videoElementProvider.isVideoReady())return;const t=this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(e.offsetX,e.offsetY);this.mouseController.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDouble")([e.button,t.x,t.y])}handlePressMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&this.mouseController.pressMouseButtons(e.buttons,e.offsetX,e.offsetY)}handleReleaseMouseButtons(e){this.mouseController.videoElementProvider.isVideoReady()&&this.mouseController.releaseMouseButtons(e.buttons,e.offsetX,e.offsetY)}}class qe{constructor(e,t,r,n){this.mouseEventListenerTracker=new We,this.toStreamerMessagesProvider=e,this.coordinateConverter=r,this.videoElementProvider=t,this.activeKeysProvider=n,this.registerMouseEnterAndLeaveEvents()}unregisterMouseEvents(){this.mouseEventListenerTracker.unregisterAll()}registerLockedMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),r=new Qe(this.videoElementProvider,e,this.activeKeysProvider);if(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock,t.requestPointerLock){const e=()=>{t.requestPointerLock()};t.addEventListener("click",e),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("click",e)))}const n=()=>r.lockStateChange();document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("pointerlockchange",n,!1))),this.mouseEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("mozpointerlockchange",n,!1)));const i=e=>r.handleMouseDown(e),s=e=>r.handleMouseUp(e),a=e=>r.handleMouseWheel(e),o=e=>r.handleMouseDouble(e);t.addEventListener("mousedown",i),t.addEventListener("mouseup",s),t.addEventListener("wheel",a),t.addEventListener("dblclick",o),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousedown",i))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mouseup",s))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("wheel",a))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("dblclick",o))),this.mouseEventListenerTracker.addUnregisterCallback((()=>r.unregisterMouseEvents())),this.mouseEventListenerTracker.addUnregisterCallback((()=>{!document.exitPointerLock||document.pointerLockElement!==t&&document.mozPointerLockElement!==t||document.exitPointerLock()}))}registerHoveringMouseEvents(e){const t=this.videoElementProvider.getVideoParentElement(),r=new $e(e),n=e=>r.updateMouseMovePosition(e),i=e=>r.handleMouseDown(e),s=e=>r.handleMouseUp(e),a=e=>r.handleContextMenu(e),o=e=>r.handleMouseWheel(e),l=e=>r.handleMouseDouble(e);t.addEventListener("mousemove",n),t.addEventListener("mousedown",i),t.addEventListener("mouseup",s),t.addEventListener("contextmenu",a),t.addEventListener("wheel",o),t.addEventListener("dblclick",l),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousemove",n))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mousedown",i))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("mouseup",s))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("contextmenu",a))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("wheel",o))),this.mouseEventListenerTracker.addUnregisterCallback((()=>t.removeEventListener("dblclick",l))),this.mouseEventListenerTracker.addUnregisterCallback((()=>r.unregisterMouseEvents()))}registerMouseEnterAndLeaveEvents(){const e=this.videoElementProvider.getVideoParentElement(),t=e=>{this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"Mouse Entered",6),this.sendMouseEnter(),this.pressMouseButtons(e.buttons,e.x,e.y))},r=e=>{this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"Mouse Left",6),this.sendMouseLeave(),this.releaseMouseButtons(e.buttons,e.x,e.y))};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",r),this.mouseEventListenerTracker.addUnregisterCallback((()=>e.removeEventListener("mouseenter",t))),this.mouseEventListenerTracker.addUnregisterCallback((()=>e.removeEventListener("mouseleave",r)))}releaseMouseButtons(e,t,r){const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,r);e&_e.primaryButton&&this.sendMouseUp(Be.mainButton,n.x,n.y),e&_e.secondaryButton&&this.sendMouseUp(Be.secondaryButton,n.x,n.y),e&_e.auxiliaryButton&&this.sendMouseUp(Be.auxiliaryButton,n.x,n.y),e&_e.fourthButton&&this.sendMouseUp(Be.fourthButton,n.x,n.y),e&_e.fifthButton&&this.sendMouseUp(Be.fifthButton,n.x,n.y)}pressMouseButtons(e,t,r){if(!this.videoElementProvider.isVideoReady())return;const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,r);e&_e.primaryButton&&this.sendMouseDown(Be.mainButton,n.x,n.y),e&_e.secondaryButton&&this.sendMouseDown(Be.secondaryButton,n.x,n.y),e&_e.auxiliaryButton&&this.sendMouseDown(Be.auxiliaryButton,n.x,n.y),e&_e.fourthButton&&this.sendMouseDown(Be.fourthButton,n.x,n.y),e&_e.fifthButton&&this.sendMouseDown(Be.fifthButton,n.x,n.y)}sendMouseEnter(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseEnter")()}sendMouseLeave(){this.videoElementProvider.isVideoReady()&&this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseLeave")()}sendMouseDown(e,t,r){this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),`mouse button ${e} down at (${t}, ${r})`,6),this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseDown")([e,t,r]))}sendMouseUp(e,t,r){if(!this.videoElementProvider.isVideoReady())return;i.Log(i.GetStackTrace(),`mouse button ${e} up at (${t}, ${r})`,6);const n=this.coordinateConverter.normalizeAndQuantizeUnsigned(t,r);this.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp")([e,n.x,n.y])}}class Xe{constructor(e,t,r){this.fingers=[9,8,7,6,5,4,3,2,1,0],this.fingerIds=new Map,this.maxByteValue=255,this.touchEventListenerTracker=new We,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=r,this.videoElementParent=t.getVideoElement();const n=e=>this.onTouchStart(e),s=e=>this.onTouchEnd(e),a=e=>this.onTouchMove(e);this.videoElementParent.addEventListener("touchstart",n,{passive:!1}),this.videoElementParent.addEventListener("touchend",s,{passive:!1}),this.videoElementParent.addEventListener("touchmove",a,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchstart",n))),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchend",s))),this.touchEventListenerTracker.addUnregisterCallback((()=>this.videoElementParent.removeEventListener("touchmove",a))),i.Log(i.GetStackTrace(),"Touch Events Registered",6);const o=e=>{e.preventDefault()};document.addEventListener("touchmove",o,{passive:!1}),this.touchEventListenerTracker.addUnregisterCallback((()=>document.removeEventListener("touchmove",o)))}unregisterTouchEvents(){this.touchEventListenerTracker.unregisterAll()}rememberTouch(e){const t=this.fingers.pop();void 0===t&&i.Log(i.GetStackTrace(),"exhausted touch identifiers",6),this.fingerIds.set(e.identifier,t)}forgetTouch(e){this.fingers.push(this.fingerIds.get(e.identifier)),this.fingers.sort((function(e,t){return t-e})),this.fingerIds.delete(e.identifier)}onTouchStart(e){if(this.videoElementProvider.isVideoReady()){for(let t=0;t<e.changedTouches.length;t++)this.rememberTouch(e.changedTouches[t]);i.Log(i.GetStackTrace(),"touch start",6),this.emitTouchData("TouchStart",e.changedTouches),e.preventDefault()}}onTouchEnd(e){if(this.videoElementProvider.isVideoReady()){i.Log(i.GetStackTrace(),"touch end",6),this.emitTouchData("TouchEnd",e.changedTouches);for(let t=0;t<e.changedTouches.length;t++)this.forgetTouch(e.changedTouches[t]);e.preventDefault()}}onTouchMove(e){this.videoElementProvider.isVideoReady()&&(i.Log(i.GetStackTrace(),"touch move",6),this.emitTouchData("TouchMove",e.touches),e.preventDefault())}emitTouchData(e,t){if(!this.videoElementProvider.isVideoReady())return;const r=this.videoElementProvider.getVideoParentElement(),n=this.toStreamerMessagesProvider.toStreamerHandlers;for(let s=0;s<t.length;s++){const a=1,o=t[s],l=o.clientX-r.offsetLeft,c=o.clientY-r.offsetTop;i.Log(i.GetStackTrace(),`F${this.fingerIds.get(o.identifier)}=(${l}, ${c})`,6);const h=this.coordinateConverter.normalizeAndQuantizeUnsigned(l,c);switch(e){case"TouchStart":n.get("TouchStart")([a,h.x,h.y,this.fingerIds.get(o.identifier),this.maxByteValue*o.force,h.inRange?1:0]);break;case"TouchEnd":n.get("TouchEnd")([a,h.x,h.y,this.fingerIds.get(o.identifier),this.maxByteValue*o.force,h.inRange?1:0]);break;case"TouchMove":n.get("TouchMove")([a,h.x,h.y,this.fingerIds.get(o.identifier),this.maxByteValue*o.force,h.inRange?1:0])}}}}class je{constructor(e){this.gamePadEventListenerTracker=new We,this.toStreamerMessagesProvider=e,this.requestAnimationFrame=(window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.requestAnimationFrame).bind(window);const t=window;if("GamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("gamepadconnected",e))),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("gamepaddisconnected",t)))}else if("WebKitGamepadEvent"in t){const e=e=>this.gamePadConnectHandler(e),t=e=>this.gamePadDisconnectHandler(e);window.addEventListener("webkitgamepadconnected",e),window.addEventListener("webkitgamepaddisconnected",t),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("webkitgamepadconnected",e))),this.gamePadEventListenerTracker.addUnregisterCallback((()=>window.removeEventListener("webkitgamepaddisconnected",t)))}if(this.controllers=[],navigator.getGamepads)for(const e of navigator.getGamepads())e&&this.gamePadConnectHandler(new GamepadEvent("gamepadconnected",{gamepad:e}))}unregisterGamePadEvents(){this.gamePadEventListenerTracker.unregisterAll();for(const e of this.controllers)void 0!==e.id&&this.onGamepadDisconnected(e.id);this.controllers=[],this.onGamepadConnected=()=>{},this.onGamepadDisconnected=()=>{}}gamePadConnectHandler(e){i.Log(i.GetStackTrace(),"Gamepad connect handler",6);const t=e.gamepad,r={currentState:t,prevState:t,id:void 0};this.controllers.push(r),this.controllers[t.index].currentState=t,this.controllers[t.index].prevState=t,i.Log(i.GetStackTrace(),"gamepad: "+t.id+" connected",6),window.requestAnimationFrame((()=>this.updateStatus())),this.onGamepadConnected()}gamePadDisconnectHandler(e){i.Log(i.GetStackTrace(),"Gamepad disconnect handler",6),i.Log(i.GetStackTrace(),"gamepad: "+e.gamepad.id+" disconnected",6);const t=this.controllers[e.gamepad.index];delete this.controllers[e.gamepad.index],this.controllers=this.controllers.filter((e=>void 0!==e)),this.onGamepadDisconnected(t.id)}scanGamePads(){const e=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads():[];for(let t=0;t<e.length;t++)e[t]&&e[t].index in this.controllers&&(this.controllers[e[t].index].currentState=e[t])}updateStatus(){this.scanGamePads();const e=this.toStreamerMessagesProvider.toStreamerHandlers;for(const t of this.controllers){const r=void 0===t.id?this.controllers.indexOf(t):t.id,n=t.currentState;for(let n=0;n<t.currentState.buttons.length;n++){const i=t.currentState.buttons[n],s=t.prevState.buttons[n];i.pressed?n==Re.LeftTrigger?e.get("GamepadAnalog")([r,5,i.value]):n==Re.RightTrigger?e.get("GamepadAnalog")([r,6,i.value]):e.get("GamepadButtonPressed")([r,n,s.pressed?1:0]):!i.pressed&&s.pressed&&(n==Re.LeftTrigger?e.get("GamepadAnalog")([r,5,0]):n==Re.RightTrigger?e.get("GamepadAnalog")([r,6,0]):e.get("GamepadButtonReleased")([r,n]))}for(let t=0;t<n.axes.length;t+=2){const i=parseFloat(n.axes[t].toFixed(4)),s=-parseFloat(n.axes[t+1].toFixed(4));e.get("GamepadAnalog")([r,t+1,i]),e.get("GamepadAnalog")([r,t+2,s])}this.controllers[r].prevState=n}this.controllers.length>0&&this.requestAnimationFrame((()=>this.updateStatus()))}onGamepadResponseReceived(e){for(const t of this.controllers)if(void 0===t.id){t.id=e;break}}onGamepadConnected(){}onGamepadDisconnected(e){}}!function(e){e[e.RightClusterBottomButton=0]="RightClusterBottomButton",e[e.RightClusterRightButton=1]="RightClusterRightButton",e[e.RightClusterLeftButton=2]="RightClusterLeftButton",e[e.RightClusterTopButton=3]="RightClusterTopButton",e[e.LeftShoulder=4]="LeftShoulder",e[e.RightShoulder=5]="RightShoulder",e[e.LeftTrigger=6]="LeftTrigger",e[e.RightTrigger=7]="RightTrigger",e[e.SelectOrBack=8]="SelectOrBack",e[e.StartOrForward=9]="StartOrForward",e[e.LeftAnalogPress=10]="LeftAnalogPress",e[e.RightAnalogPress=11]="RightAnalogPress",e[e.LeftClusterTopButton=12]="LeftClusterTopButton",e[e.LeftClusterBottomButton=13]="LeftClusterBottomButton",e[e.LeftClusterLeftButton=14]="LeftClusterLeftButton",e[e.LeftClusterRightButton=15]="LeftClusterRightButton",e[e.CentreButton=16]="CentreButton",e[e.LeftStickHorizontal=0]="LeftStickHorizontal",e[e.LeftStickVertical=1]="LeftStickVertical",e[e.RightStickHorizontal=2]="RightStickHorizontal",e[e.RightStickVertical=3]="RightStickVertical"}(Re||(Re={}));class Ye{constructor(e,t,r){this.activeKeys=new Je,this.toStreamerMessagesProvider=e,this.videoElementProvider=t,this.coordinateConverter=r}registerKeyBoard(e){i.Log(i.GetStackTrace(),"Register Keyboard Events",7);const t=new Ke(this.toStreamerMessagesProvider,e,this.activeKeys);return t.registerKeyBoardEvents(),t}registerMouse(e){i.Log(i.GetStackTrace(),"Register Mouse Events",7);const t=new qe(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter,this.activeKeys);switch(e){case ue.LockedMouse:t.registerLockedMouseEvents(t);break;case ue.HoveringMouse:t.registerHoveringMouseEvents(t);break;default:i.Info(i.GetStackTrace(),"unknown Control Scheme Type Defaulting to Locked Mouse Events"),t.registerLockedMouseEvents(t)}return t}registerTouch(e,t){if(i.Log(i.GetStackTrace(),"Registering Touch",6),e){const e=new He(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter);return e.setVideoElementParentClientRect(t),e}return new Xe(this.toStreamerMessagesProvider,this.videoElementProvider,this.coordinateConverter)}registerGamePad(){return i.Log(i.GetStackTrace(),"Register Game Pad",7),new je(this.toStreamerMessagesProvider)}}class Je{constructor(){this.activeKeys=[],this.activeKeys=[]}getActiveKeys(){return this.activeKeys}}class Ze{constructor(e,t){this.lastTimeResized=(new Date).getTime(),this.videoElement=document.createElement("video"),this.config=t,this.videoElement.id="streamingVideo",this.videoElement.disablePictureInPicture=!0,this.videoElement.playsInline=!0,this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.videoElement.style.pointerEvents="all",e.appendChild(this.videoElement),this.onResizePlayerCallback=()=>{console.log("Resolution changed, restyling player, did you forget to override this function?")},this.onMatchViewportResolutionCallback=()=>{console.log("Resolution changed and match viewport resolution is turned on, did you forget to override this function?")},this.videoElement.onclick=()=>{this.videoElement.paused&&this.videoElement.play()},this.videoElement.onloadedmetadata=()=>{this.onVideoInitialized()},window.addEventListener("resize",(()=>this.resizePlayerStyle()),!0),window.addEventListener("orientationchange",(()=>this.onOrientationChange()))}play(){return this.videoElement.muted=this.config.isFlagEnabled(re.StartVideoMuted),this.videoElement.autoplay=this.config.isFlagEnabled(re.AutoPlayVideo),this.videoElement.play()}isPaused(){return this.videoElement.paused}isVideoReady(){return void 0!==this.videoElement.readyState&&this.videoElement.readyState>0}hasVideoSource(){return void 0!==this.videoElement.srcObject&&null!==this.videoElement.srcObject}getVideoElement(){return this.videoElement}getVideoParentElement(){return this.videoElement.parentElement}setVideoEnabled(e){this.videoElement.srcObject.getTracks().forEach((t=>t.enabled=e))}onVideoInitialized(){}onOrientationChange(){clearTimeout(this.orientationChangeTimeout),this.orientationChangeTimeout=window.setTimeout((()=>{this.resizePlayerStyle()}),500)}resizePlayerStyle(){const e=this.getVideoParentElement();e&&(this.updateVideoStreamSize(),e.classList.contains("fixed-size")||this.resizePlayerStyleToFillParentElement(),this.onResizePlayerCallback())}resizePlayerStyleToFillParentElement(){this.getVideoParentElement().setAttribute("style","top: 0px; left: 0px; width: 100%; height: 100%; cursor: default;")}updateVideoStreamSize(){if(this.config.isFlagEnabled(re.MatchViewportResolution))if((new Date).getTime()-this.lastTimeResized>1e3){const e=this.getVideoParentElement();if(!e)return;this.onMatchViewportResolutionCallback(e.clientWidth,e.clientHeight),this.lastTimeResized=(new Date).getTime()}else i.Log(i.GetStackTrace(),"Resizing too often - skipping",6),clearTimeout(this.resizeTimeoutHandle),this.resizeTimeoutHandle=window.setTimeout((()=>this.updateVideoStreamSize),1e3)}}class et$1{constructor(){this.map=new Map,this.reverseMap=new Map}getFromKey(e){return this.map.get(e)}getFromValue(e){return this.reverseMap.get(e)}add(e,t){this.map.set(e,t),this.reverseMap.set(t,e)}remove(e,t){this.map.delete(e),this.reverseMap.delete(t)}}class tt$1{constructor(){this.toStreamerHandlers=new Map,this.fromStreamerHandlers=new Map,this.toStreamerMessages=new et$1,this.fromStreamerMessages=new et$1}populateDefaultProtocol(){this.toStreamerMessages.add("IFrameRequest",{id:0,byteLength:0,structure:[]}),this.toStreamerMessages.add("RequestQualityControl",{id:1,byteLength:0,structure:[]}),this.toStreamerMessages.add("FpsRequest",{id:2,byteLength:0,structure:[]}),this.toStreamerMessages.add("AverageBitrateRequest",{id:3,byteLength:0,structure:[]}),this.toStreamerMessages.add("StartStreaming",{id:4,byteLength:0,structure:[]}),this.toStreamerMessages.add("StopStreaming",{id:5,byteLength:0,structure:[]}),this.toStreamerMessages.add("LatencyTest",{id:6,byteLength:0,structure:[]}),this.toStreamerMessages.add("RequestInitialSettings",{id:7,byteLength:0,structure:[]}),this.toStreamerMessages.add("TestEcho",{id:8,byteLength:0,structure:[]}),this.toStreamerMessages.add("UIInteraction",{id:50,byteLength:0,structure:[]}),this.toStreamerMessages.add("Command",{id:51,byteLength:0,structure:[]}),this.toStreamerMessages.add("KeyDown",{id:60,byteLength:2,structure:["uint8","uint8"]}),this.toStreamerMessages.add("KeyUp",{id:61,byteLength:1,structure:["uint8"]}),this.toStreamerMessages.add("KeyPress",{id:62,byteLength:2,structure:["uint16"]}),this.toStreamerMessages.add("MouseEnter",{id:70,byteLength:0,structure:[]}),this.toStreamerMessages.add("MouseLeave",{id:71,byteLength:0,structure:[]}),this.toStreamerMessages.add("MouseDown",{id:72,byteLength:5,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.add("MouseUp",{id:73,byteLength:5,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.add("MouseMove",{id:74,byteLength:8,structure:["uint16","uint16","int16","int16"]}),this.toStreamerMessages.add("MouseWheel",{id:75,byteLength:6,structure:["int16","uint16","uint16"]}),this.toStreamerMessages.add("MouseDouble",{id:76,byteLength:5,structure:["uint8","uint16","uint16"]}),this.toStreamerMessages.add("TouchStart",{id:80,byteLength:8,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.add("TouchEnd",{id:81,byteLength:8,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.add("TouchMove",{id:82,byteLength:8,structure:["uint8","uint16","uint16","uint8","uint8","uint8"]}),this.toStreamerMessages.add("GamepadConnected",{id:93,byteLength:0,structure:[]}),this.toStreamerMessages.add("GamepadButtonPressed",{id:90,byteLength:3,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.add("GamepadButtonReleased",{id:91,byteLength:3,structure:["uint8","uint8","uint8"]}),this.toStreamerMessages.add("GamepadAnalog",{id:92,byteLength:10,structure:["uint8","uint8","double"]}),this.toStreamerMessages.add("GamepadDisconnected",{id:94,byteLength:1,structure:["uint8"]}),this.fromStreamerMessages.add("QualityControlOwnership",0),this.fromStreamerMessages.add("Response",1),this.fromStreamerMessages.add("Command",2),this.fromStreamerMessages.add("FreezeFrame",3),this.fromStreamerMessages.add("UnfreezeFrame",4),this.fromStreamerMessages.add("VideoEncoderAvgQP",5),this.fromStreamerMessages.add("LatencyTest",6),this.fromStreamerMessages.add("InitialSettings",7),this.fromStreamerMessages.add("FileExtension",8),this.fromStreamerMessages.add("FileMimeType",9),this.fromStreamerMessages.add("FileContents",10),this.fromStreamerMessages.add("TestEcho",11),this.fromStreamerMessages.add("InputControlOwnership",12),this.fromStreamerMessages.add("GamepadResponse",13),this.fromStreamerMessages.add("Protocol",255)}registerMessageHandler(e,t,r){switch(e){case Le.ToStreamer:this.toStreamerHandlers.set(t,r);break;case Le.FromStreamer:this.fromStreamerHandlers.set(t,r);break;default:i.Log(i.GetStackTrace(),`Unknown message direction ${e}`)}}}!function(e){e[e.ToStreamer=0]="ToStreamer",e[e.FromStreamer=1]="FromStreamer"}(Le||(Le={}));class st$1{constructor(){this.responseEventListeners=new Map}addResponseEventListener(e,t){this.responseEventListeners.set(e,t)}removeResponseEventListener(e){this.responseEventListeners.delete(e)}onResponse(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.Response",6);const t=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),t,6),this.responseEventListeners.forEach((e=>{e(t)}))}}class nt$1{constructor(e,t){this.dataChannelSender=e,this.toStreamerMessagesMapProvider=t}sendLatencyTest(e){this.sendDescriptor("LatencyTest",e)}emitCommand(e){this.sendDescriptor("Command",e)}emitUIInteraction(e){this.sendDescriptor("UIInteraction",e)}sendDescriptor(e,t){const r=JSON.stringify(t),n=this.toStreamerMessagesMapProvider.toStreamerMessages.getFromKey(e);void 0===n&&i.Error(i.GetStackTrace(),`Attempted to emit descriptor with message type: ${e}, but the frontend hasn't been configured to send such a message. Check you've added the message type in your cpp`),i.Log(i.GetStackTrace(),"Sending: "+t,6);const s=new DataView(new ArrayBuffer(3+2*r.length));let a=0;s.setUint8(a,n.id),a++,s.setUint16(a,r.length,!0),a+=2;for(let e=0;e<r.length;e++)s.setUint16(a,r.charCodeAt(e),!0),a+=2;this.dataChannelSender.canSend()?this.dataChannelSender.sendData(s.buffer):i.Info(i.GetStackTrace(),`Data channel cannot send yet, skipping sending descriptor message: ${e} - ${r}`)}}class rt$1{constructor(e,t){this.dataChannelSender=e,this.toStreamerMessagesMapProvider=t}sendMessageToStreamer(e,t){void 0===t&&(t=[]);const r=this.toStreamerMessagesMapProvider.toStreamerMessages.getFromKey(e);if(void 0===r)return void i.Error(i.GetStackTrace(),`Attempted to send a message to the streamer with message type: ${e}, but the frontend hasn't been configured to send such a message. Check you've added the message type in your cpp`);const n=new DataView(new ArrayBuffer(r.byteLength+1));n.setUint8(0,r.id);let s=1;t.forEach(((e,t)=>{switch(r.structure[t]){case"uint8":n.setUint8(s,e),s+=1;break;case"uint16":n.setUint16(s,e,!0),s+=2;break;case"int16":n.setInt16(s,e,!0),s+=2;break;case"float":n.setFloat32(s,e,!0),s+=4;break;case"double":n.setFloat64(s,e,!0),s+=8}})),this.dataChannelSender.canSend()?this.dataChannelSender.sendData(n.buffer):i.Info(i.GetStackTrace(),`Data channel cannot send yet, skipping sending message: ${e} - ${new Uint8Array(n.buffer)}`)}}class it$1{constructor(e){this.sendMessageController=e}SendRequestQualityControl(){this.sendMessageController.sendMessageToStreamer("RequestQualityControl")}SendMaxFpsRequest(){this.sendMessageController.sendMessageToStreamer("FpsRequest")}SendAverageBitrateRequest(){this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest")}SendStartStreaming(){this.sendMessageController.sendMessageToStreamer("StartStreaming")}SendStopStreaming(){this.sendMessageController.sendMessageToStreamer("StopStreaming")}SendRequestInitialSettings(){this.sendMessageController.sendMessageToStreamer("RequestInitialSettings")}}class ot$1{constructor(e){this.dataChannelProvider=e}canSend(){return void 0!==this.dataChannelProvider.getDataChannelInstance().dataChannel&&"open"==this.dataChannelProvider.getDataChannelInstance().dataChannel.readyState}sendData(e){const t=this.dataChannelProvider.getDataChannelInstance();"open"==t.dataChannel.readyState?(t.dataChannel.send(e),i.Log(i.GetStackTrace(),`Message Sent: ${new Uint8Array(e)}`,6),this.resetAfkWarningTimerOnDataSend()):i.Error(i.GetStackTrace(),`Message Failed: ${new Uint8Array(e)}`)}resetAfkWarningTimerOnDataSend(){}}class at$2{constructor(e){this.videoElementProvider=e,this.normalizeAndQuantizeUnsignedFunc=()=>{throw new Error("Normalize and quantize unsigned, method not implemented.")},this.normalizeAndQuantizeSignedFunc=()=>{throw new Error("Normalize and unquantize signed, method not implemented.")},this.denormalizeAndUnquantizeUnsignedFunc=()=>{throw new Error("Denormalize and unquantize unsigned, method not implemented.")}}normalizeAndQuantizeUnsigned(e,t){return this.normalizeAndQuantizeUnsignedFunc(e,t)}unquantizeAndDenormalizeUnsigned(e,t){return this.denormalizeAndUnquantizeUnsignedFunc(e,t)}normalizeAndQuantizeSigned(e,t){return this.normalizeAndQuantizeSignedFunc(e,t)}setupNormalizeAndQuantize(){if(this.videoElementParent=this.videoElementProvider.getVideoParentElement(),this.videoElement=this.videoElementProvider.getVideoElement(),this.videoElementParent&&this.videoElement){const e=this.videoElementParent.clientHeight/this.videoElementParent.clientWidth,t=this.videoElement.videoHeight/this.videoElement.videoWidth;e>t?(i.Log(i.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio",6),this.ratio=e/t,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerBigger(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerBigger(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerBigger(e,t)):(i.Log(i.GetStackTrace(),"Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio",6),this.ratio=t/e,this.normalizeAndQuantizeUnsignedFunc=(e,t)=>this.normalizeAndQuantizeUnsignedPlayerSmaller(e,t),this.normalizeAndQuantizeSignedFunc=(e,t)=>this.normalizeAndQuantizeSignedPlayerSmaller(e,t),this.denormalizeAndUnquantizeUnsignedFunc=(e,t)=>this.denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t))}}normalizeAndQuantizeUnsignedPlayerBigger(e,t){const r=e/this.videoElementParent.clientWidth,n=this.ratio*(t/this.videoElementParent.clientHeight-.5)+.5;return r<0||r>1||n<0||n>1?new dt(!1,65535,65535):new dt(!0,65536*r,65536*n)}denormalizeAndUnquantizeUnsignedPlayerBigger(e,t){const r=e/65536,n=(t/65536-.5)/this.ratio+.5;return new lt$1(r*this.videoElementParent.clientWidth,n*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerBigger(e,t){const r=e/(.5*this.videoElementParent.clientWidth),n=this.ratio*t/(.5*this.videoElementParent.clientHeight);return new ct$1(32767*r,32767*n)}normalizeAndQuantizeUnsignedPlayerSmaller(e,t){const r=this.ratio*(e/this.videoElementParent.clientWidth-.5)+.5,n=t/this.videoElementParent.clientHeight;return r<0||r>1||n<0||n>1?new dt(!1,65535,65535):new dt(!0,65536*r,65536*n)}denormalizeAndUnquantizeUnsignedPlayerSmaller(e,t){const r=(e/65536-.5)/this.ratio+.5,n=t/65536;return new lt$1(r*this.videoElementParent.clientWidth,n*this.videoElementParent.clientHeight)}normalizeAndQuantizeSignedPlayerSmaller(e,t){const r=this.ratio*e/(.5*this.videoElementParent.clientWidth),n=t/(.5*this.videoElementParent.clientHeight);return new ct$1(32767*r,32767*n)}}class dt{constructor(e,t,r){this.inRange=e,this.x=t,this.y=r}}class lt$1{constructor(e,t){this.x=e,this.y=t}}class ct$1{constructor(e,t){this.x=e,this.y=t}}class ht{constructor(e,t){this.shouldShowPlayOverlay=!0,this.config=e,this.pixelStreaming=t,this.responseController=new st$1,this.file=new ze,this.sdpConstraints={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.afkController=new me(this.config,this.pixelStreaming,this.onAfkTriggered.bind(this)),this.afkController.onAFKTimedOutCallback=()=>{this.setDisconnectMessageOverride("You have been disconnected due to inactivity"),this.closeSignalingServer()},this.freezeFrameController=new y$1(this.pixelStreaming.videoElementParent),this.videoPlayer=new Ze(this.pixelStreaming.videoElementParent,this.config),this.videoPlayer.onVideoInitialized=()=>this.handleVideoInitialized(),this.videoPlayer.onMatchViewportResolutionCallback=(e,t)=>{const r={"Resolution.Width":e,"Resolution.Height":t};this.sendDescriptorController.emitCommand(r)},this.videoPlayer.onResizePlayerCallback=()=>{this.setUpMouseAndFreezeFrame()},this.streamController=new T$1(this.videoPlayer),this.coordinateConverter=new at$2(this.videoPlayer),this.sendrecvDataChannelController=new Se,this.recvDataChannelController=new Se,this.registerDataChannelEventEmitters(this.sendrecvDataChannelController),this.registerDataChannelEventEmitters(this.recvDataChannelController),this.dataChannelSender=new ot$1(this.sendrecvDataChannelController),this.dataChannelSender.resetAfkWarningTimerOnDataSend=()=>this.afkController.resetAfkWarningTimer(),this.streamMessageController=new tt$1,this.webSocketController=new f$1,this.webSocketController.onConfig=e=>this.handleOnConfigMessage(e),this.webSocketController.onStreamerList=e=>this.handleStreamerListMessage(e),this.webSocketController.onWebSocketOncloseOverlayMessage=e=>{this.pixelStreaming._onDisconnect(`Websocket disconnect (${e.code}) ${""!=e.reason?"- "+e.reason:""}`),this.setVideoEncoderAvgQP(0)},this.webSocketController.onOpen.addEventListener("open",(()=>{this.config.isFlagEnabled(re.BrowserSendOffer)||this.webSocketController.requestStreamerList()})),this.webSocketController.onClose.addEventListener("close",(()=>{this.afkController.stopAfkWarningTimer(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.setTouchInputEnabled(!1),this.setMouseInputEnabled(!1),this.setKeyboardInputEnabled(!1),this.setGamePadInputEnabled(!1)})),this.sendDescriptorController=new nt$1(this.dataChannelSender,this.streamMessageController),this.sendMessageController=new rt$1(this.dataChannelSender,this.streamMessageController),this.toStreamerMessagesController=new it$1(this.sendMessageController),this.registerMessageHandlers(),this.streamMessageController.populateDefaultProtocol(),this.inputClassesFactory=new Ye(this.streamMessageController,this.videoPlayer,this.coordinateConverter),this.isUsingSFU=!1,this.isQualityController=!1,this.preferredCodec="",this.config._addOnOptionSettingChangedListener(ce.StreamerId,(e=>{this.peerConnectionController.peerConnection.close(),this.peerConnectionController.createPeerConnection(this.peerConfig,this.preferredCodec),this.webSocketController.sendSubscribe(e)})),this.setVideoEncoderAvgQP(-1),this.signallingUrlBuilder=()=>{let e=this.config.getTextSettingValue(de.SignallingServerUrl);return this.config.isFlagEnabled(re.BrowserSendOffer)&&(e+="?"+re.BrowserSendOffer+"=true"),e}}requestUnquantizedAndDenormalizeUnsigned(e,t){return this.coordinateConverter.unquantizeAndDenormalizeUnsigned(e,t)}handleOnMessage(e){const t=new Uint8Array(e.data);i.Log(i.GetStackTrace(),"Message incoming:"+t,6);const r=this.streamMessageController.fromStreamerMessages.getFromValue(t[0]);this.streamMessageController.fromStreamerHandlers.get(r)(e.data)}registerMessageHandlers(){this.streamMessageController.registerMessageHandler(Le.FromStreamer,"QualityControlOwnership",(e=>this.onQualityControlOwnership(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"Response",(e=>this.responseController.onResponse(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"Command",(e=>{this.onCommand(e)})),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"FreezeFrame",(e=>this.onFreezeFrameMessage(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"UnfreezeFrame",(()=>this.invalidateFreezeFrameAndEnableVideo())),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"VideoEncoderAvgQP",(e=>this.handleVideoEncoderAvgQP(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"LatencyTest",(e=>this.handleLatencyTestResult(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"InitialSettings",(e=>this.handleInitialSettings(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"FileExtension",(e=>this.onFileExtension(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"FileMimeType",(e=>this.onFileMimeType(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"FileContents",(e=>this.onFileContents(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"TestEcho",(()=>{})),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"InputControlOwnership",(e=>this.onInputControlOwnership(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"GamepadResponse",(e=>this.onGamepadResponse(e))),this.streamMessageController.registerMessageHandler(Le.FromStreamer,"Protocol",(e=>this.onProtocolMessage(e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"IFrameRequest",(()=>this.sendMessageController.sendMessageToStreamer("IFrameRequest"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"RequestQualityControl",(()=>this.sendMessageController.sendMessageToStreamer("RequestQualityControl"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"FpsRequest",(()=>this.sendMessageController.sendMessageToStreamer("FpsRequest"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"AverageBitrateRequest",(()=>this.sendMessageController.sendMessageToStreamer("AverageBitrateRequest"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"StartStreaming",(()=>this.sendMessageController.sendMessageToStreamer("StartStreaming"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"StopStreaming",(()=>this.sendMessageController.sendMessageToStreamer("StopStreaming"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"LatencyTest",(()=>this.sendMessageController.sendMessageToStreamer("LatencyTest"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"RequestInitialSettings",(()=>this.sendMessageController.sendMessageToStreamer("RequestInitialSettings"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"TestEcho",(()=>{})),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"UIInteraction",(e=>this.sendDescriptorController.emitUIInteraction(e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"Command",(e=>this.sendDescriptorController.emitCommand(e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"KeyDown",(e=>this.sendMessageController.sendMessageToStreamer("KeyDown",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"KeyUp",(e=>this.sendMessageController.sendMessageToStreamer("KeyUp",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"KeyPress",(e=>this.sendMessageController.sendMessageToStreamer("KeyPress",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseEnter",(e=>this.sendMessageController.sendMessageToStreamer("MouseEnter",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseLeave",(e=>this.sendMessageController.sendMessageToStreamer("MouseLeave",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseDown",(e=>this.sendMessageController.sendMessageToStreamer("MouseDown",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseUp",(e=>this.sendMessageController.sendMessageToStreamer("MouseUp",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseMove",(e=>this.sendMessageController.sendMessageToStreamer("MouseMove",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseWheel",(e=>this.sendMessageController.sendMessageToStreamer("MouseWheel",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"MouseDouble",(e=>this.sendMessageController.sendMessageToStreamer("MouseDouble",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"TouchStart",(e=>this.sendMessageController.sendMessageToStreamer("TouchStart",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"TouchEnd",(e=>this.sendMessageController.sendMessageToStreamer("TouchEnd",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"TouchMove",(e=>this.sendMessageController.sendMessageToStreamer("TouchMove",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadConnected",(()=>this.sendMessageController.sendMessageToStreamer("GamepadConnected"))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadButtonPressed",(e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonPressed",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadButtonReleased",(e=>this.sendMessageController.sendMessageToStreamer("GamepadButtonReleased",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadAnalog",(e=>this.sendMessageController.sendMessageToStreamer("GamepadAnalog",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"GamepadDisconnected",(e=>this.sendMessageController.sendMessageToStreamer("GamepadDisconnected",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRHMDTransform",(e=>this.sendMessageController.sendMessageToStreamer("XRHMDTransform",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRControllerTransform",(e=>this.sendMessageController.sendMessageToStreamer("XRControllerTransform",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRSystem",(e=>this.sendMessageController.sendMessageToStreamer("XRSystem",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRButtonTouched",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonTouched",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRButtonPressed",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonPressed",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRButtonReleased",(e=>this.sendMessageController.sendMessageToStreamer("XRButtonReleased",e))),this.streamMessageController.registerMessageHandler(Le.ToStreamer,"XRAnalog",(e=>this.sendMessageController.sendMessageToStreamer("XRAnalog",e)))}onCommand(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.Command",6);const t=new TextDecoder("utf-16").decode(e.slice(1));i.Log(i.GetStackTrace(),"Data Channel Command: "+t,6);const r=JSON.parse(t);"onScreenKeyboard"===r.command&&this.pixelStreaming._activateOnScreenKeyboard(r)}onProtocolMessage(e){try{const t=new TextDecoder("utf-16").decode(e.slice(1)),r=JSON.parse(t);Object.prototype.hasOwnProperty.call(r,"Direction")||i.Error(i.GetStackTrace(),"Malformed protocol received. Ensure the protocol message contains a direction");const n=r.Direction;delete r.Direction,i.Log(i.GetStackTrace(),`Received new ${n==Le.FromStreamer?"FromStreamer":"ToStreamer"} protocol. Updating existing protocol...`),Object.keys(r).forEach((e=>{const t=r[e];switch(n){case Le.ToStreamer:if(!Object.prototype.hasOwnProperty.call(t,"id")||!Object.prototype.hasOwnProperty.call(t,"byteLength"))return void i.Error(i.GetStackTrace(),`ToStreamer->${e} protocol definition was malformed as it didn't contain at least an id and a byteLength\n\n Definition was: ${JSON.stringify(t,null,2)}`);if(t.byteLength>0&&!Object.prototype.hasOwnProperty.call(t,"structure"))return void i.Error(i.GetStackTrace(),`ToStreamer->${e} protocol definition was malformed as it specified a byteLength but no accompanying structure`);this.streamMessageController.toStreamerHandlers.get(e)?this.streamMessageController.toStreamerMessages.add(e,t):i.Error(i.GetStackTrace(),`There was no registered handler for "${e}" - try adding one using registerMessageHandler(MessageDirection.ToStreamer, "${e}", myHandler)`);break;case Le.FromStreamer:if(!Object.prototype.hasOwnProperty.call(t,"id"))return void i.Error(i.GetStackTrace(),`FromStreamer->${e} protocol definition was malformed as it didn't contain at least an id\n\n Definition was: ${JSON.stringify(t,null,2)}`);this.streamMessageController.fromStreamerHandlers.get(e)?this.streamMessageController.fromStreamerMessages.add(e,t.id):i.Error(i.GetStackTrace(),`There was no registered handler for "${t}" - try adding one using registerMessageHandler(MessageDirection.FromStreamer, "${e}", myHandler)`);break;default:i.Error(i.GetStackTrace(),`Unknown direction: ${n}`)}})),this.toStreamerMessagesController.SendRequestInitialSettings(),this.toStreamerMessagesController.SendRequestQualityControl()}catch(e){i.Log(i.GetStackTrace(),e)}}onInputControlOwnership(e){const t=new Uint8Array(e);i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.InputControlOwnership",6);const r=new Boolean(t[1]).valueOf();i.Log(i.GetStackTrace(),`Received input controller message - will your input control the stream: ${r}`),this.pixelStreaming._onInputControlOwnership(r)}onGamepadResponse(e){const t=new TextDecoder("utf-16").decode(e.slice(1)),r=JSON.parse(t);this.gamePadController.onGamepadResponseReceived(r.controllerId)}onAfkTriggered(){this.afkController.onAfkClick(),this.videoPlayer.isPaused()&&this.videoPlayer.hasVideoSource()&&this.playStream()}setAfkEnabled(e){e?this.onAfkTriggered():this.afkController.stopAfkWarningTimer()}restartStreamAutomatically(){if(this.webSocketController)if(this.webSocketController.webSocket&&this.webSocketController.webSocket.readyState!==WebSocket.CLOSED){this.pixelStreaming._showActionOrErrorOnDisconnect=!1,this.setDisconnectMessageOverride("Restarting stream..."),this.closeSignalingServer();const e=setTimeout((()=>{this.pixelStreaming._onWebRtcAutoConnect(),this.connectToSignallingServer(),clearTimeout(e)}),3e3)}else i.Log(i.GetStackTrace(),"A websocket connection has not been made yet so we will start the stream"),this.pixelStreaming._onWebRtcAutoConnect(),this.connectToSignallingServer();else i.Log(i.GetStackTrace(),"The Web Socket Controller does not exist so this will not work right now.")}loadFreezeFrameOrShowPlayOverlay(){this.pixelStreaming.dispatchEvent(new $$a({shouldShowPlayOverlay:this.shouldShowPlayOverlay,isValid:this.freezeFrameController.valid,jpegData:this.freezeFrameController.jpeg})),!0===this.shouldShowPlayOverlay?(i.Log(i.GetStackTrace(),"showing play overlay"),this.resizePlayerStyle()):(i.Log(i.GetStackTrace(),"showing freeze frame"),this.freezeFrameController.showFreezeFrame()),setTimeout((()=>{this.videoPlayer.setVideoEnabled(!1)}),this.freezeFrameController.freezeFrameDelay)}onFreezeFrameMessage(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6);const t=new Uint8Array(e);this.freezeFrameController.processFreezeFrameMessage(t,(()=>this.loadFreezeFrameOrShowPlayOverlay()))}invalidateFreezeFrameAndEnableVideo(){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.FreezeFrame",6),setTimeout((()=>{this.pixelStreaming.dispatchEvent(new q$1),this.freezeFrameController.hideFreezeFrame()}),this.freezeFrameController.freezeFrameDelay),this.videoPlayer.getVideoElement()&&this.videoPlayer.setVideoEnabled(!0)}onFileExtension(e){const t=new Uint8Array(e);Ge.setExtensionFromBytes(t,this.file)}onFileMimeType(e){const t=new Uint8Array(e);Ge.setMimeTypeFromBytes(t,this.file)}onFileContents(e){const t=new Uint8Array(e);Ge.setContentsFromBytes(t,this.file)}playStream(){if(!this.videoPlayer.getVideoElement()){const e="Could not play video stream because the video player was not initialized correctly.";return this.pixelStreaming.dispatchEvent(new N$1({message:e})),i.Error(i.GetStackTrace(),e),this.setDisconnectMessageOverride("Stream not initialized correctly"),void this.closeSignalingServer()}this.videoPlayer.hasVideoSource()?(this.setTouchInputEnabled(this.config.isFlagEnabled(re.TouchInput)),this.pixelStreaming.dispatchEvent(new K$1),this.streamController.audioElement.srcObject?(this.streamController.audioElement.muted=this.config.isFlagEnabled(re.StartVideoMuted),this.streamController.audioElement.play().then((()=>{this.playVideo()})).catch((e=>{i.Log(i.GetStackTrace(),e),i.Log(i.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new Q$1({reason:e}))}))):this.playVideo(),this.shouldShowPlayOverlay=!1,this.freezeFrameController.showFreezeFrame()):i.Warning(i.GetStackTrace(),"Cannot play stream, the video element has no srcObject to play.")}playVideo(){this.videoPlayer.play().catch((e=>{this.streamController.audioElement.srcObject&&this.streamController.audioElement.pause(),i.Log(i.GetStackTrace(),e),i.Log(i.GetStackTrace(),"Browser does not support autoplaying video without interaction - to resolve this we are going to show the play button overlay."),this.pixelStreaming.dispatchEvent(new Q$1({reason:e}))}))}autoPlayVideoOrSetUpPlayOverlay(){this.config.isFlagEnabled(re.AutoPlayVideo)&&this.playStream(),this.resizePlayerStyle()}connectToSignallingServer(){const e=this.signallingUrlBuilder();this.webSocketController.connect(e)}startSession(e){if(this.peerConfig=e,this.config.isFlagEnabled(re.ForceTURN)&&!this.checkTurnServerAvailability(e))return i.Info(i.GetStackTrace(),"No turn server was found in the Peer Connection Options. TURN cannot be forced, closing connection. Please use STUN instead"),this.setDisconnectMessageOverride("TURN cannot be forced, closing connection. Please use STUN instead."),void this.closeSignalingServer();this.peerConnectionController=new Ae(this.peerConfig,this.config,this.preferredCodec),this.peerConnectionController.onVideoStats=e=>this.handleVideoStats(e),this.peerConnectionController.onSendWebRTCOffer=e=>this.handleSendWebRTCOffer(e),this.peerConnectionController.onSendWebRTCAnswer=e=>this.handleSendWebRTCAnswer(e),this.peerConnectionController.onPeerIceCandidate=e=>this.handleSendIceCandidate(e),this.peerConnectionController.onDataChannel=e=>this.handleDataChannel(e),this.peerConnectionController.showTextOverlayConnecting=()=>this.pixelStreaming._onWebRtcConnecting(),this.peerConnectionController.showTextOverlaySetupFailure=()=>this.pixelStreaming._onWebRtcFailed();let t=!1;this.peerConnectionController.onIceConnectionStateChange=()=>{!t&&["connected","completed"].includes(this.peerConnectionController.peerConnection.iceConnectionState)&&(this.pixelStreaming._onWebRtcConnected(),t=!0)},this.peerConnectionController.onTrack=e=>this.streamController.handleOnTrack(e),this.config.isFlagEnabled(re.BrowserSendOffer)&&(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"cirrus",this.datachannelOptions),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e),this.peerConnectionController.createOffer(this.sdpConstraints,this.config))}checkTurnServerAvailability(e){if(!e.iceServers)return i.Info(i.GetStackTrace(),"A turn sever was not found"),!1;for(const t of e.iceServers)for(const e of t.urls)if(e.includes("turn"))return i.Log(i.GetStackTrace(),`A turn sever was found at ${e}`),!0;return i.Info(i.GetStackTrace(),"A turn sever was not found"),!1}handleOnConfigMessage(e){this.resizePlayerStyle(),this.startSession(e.peerConnectionOptions),this.webSocketController.onWebRtcAnswer=e=>this.handleWebRtcAnswer(e),this.webSocketController.onWebRtcOffer=e=>this.handleWebRtcOffer(e),this.webSocketController.onWebRtcPeerDataChannels=e=>this.handleWebRtcSFUPeerDatachannels(e),this.webSocketController.onIceCandidate=e=>this.handleIceCandidate(e)}handleStreamerListMessage(e){i.Log(i.GetStackTrace(),`Got streamer list ${e.ids}`,6);const t=[...e.ids];t.unshift(""),this.config.setOptionSettingOptions(ce.StreamerId,t);const r=new URLSearchParams(window.location.search);let n=null;1==e.ids.length?n=e.ids[0]:this.config.isFlagEnabled(re.PreferSFU)&&e.ids.includes("SFU")?n="SFU":r.has(ce.StreamerId)&&e.ids.includes(r.get(ce.StreamerId))&&(n=r.get(ce.StreamerId)),null!==n&&this.config.setOptionSettingValue(ce.StreamerId,n),this.pixelStreaming.dispatchEvent(new j$1({messageStreamerList:e,autoSelectedStreamerId:n}))}handleWebRtcAnswer(e){i.Log(i.GetStackTrace(),`Got answer sdp ${e.sdp}`,6);const t={sdp:e.sdp,type:"answer"};this.peerConnectionController.receiveAnswer(t),this.handlePostWebrtcNegotiation()}handleWebRtcOffer(e){i.Log(i.GetStackTrace(),`Got offer sdp ${e.sdp}`,6),this.isUsingSFU=!!e.sfu&&e.sfu,this.isUsingSFU&&(this.peerConnectionController.preferredCodec="");const t={sdp:e.sdp,type:"offer"};this.peerConnectionController.receiveOffer(t,this.config),this.handlePostWebrtcNegotiation()}handleWebRtcSFUPeerDatachannels(e){const t={ordered:!0,negotiated:!0,id:e.sendStreamId},r=e.sendStreamId!=e.recvStreamId;if(this.sendrecvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,r?"send-datachannel":"datachannel",t),r){const t={ordered:!0,negotiated:!0,id:e.recvStreamId};this.recvDataChannelController.createDataChannel(this.peerConnectionController.peerConnection,"recv-datachannel",t),this.recvDataChannelController.handleOnOpen=()=>this.webSocketController.sendSFURecvDataChannelReady(),this.recvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}else this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handlePostWebrtcNegotiation(){this.afkController.startAfkWarningTimer(),this.pixelStreaming._onWebRtcSdp(),this.statsTimerHandle&&void 0!==this.statsTimerHandle&&window.clearInterval(this.statsTimerHandle),this.statsTimerHandle=window.setInterval((()=>this.getStats()),1e3),this.setMouseInputEnabled(this.config.isFlagEnabled(re.MouseInput)),this.setKeyboardInputEnabled(this.config.isFlagEnabled(re.KeyboardInput)),this.setGamePadInputEnabled(this.config.isFlagEnabled(re.GamepadInput))}handleIceCandidate(e){i.Log(i.GetStackTrace(),"Web RTC Controller: onWebRtcIce",6);const t=new RTCIceCandidate(e);this.peerConnectionController.handleOnIce(t)}handleSendIceCandidate(e){i.Log(i.GetStackTrace(),"OnIceCandidate",6),e.candidate&&e.candidate.candidate&&this.webSocketController.sendIceCandidate(e.candidate)}handleDataChannel(e){i.Log(i.GetStackTrace(),"Data channel created for us by browser as we are a receiving peer.",6),this.sendrecvDataChannelController.dataChannel=e.channel,this.sendrecvDataChannelController.setupDataChannel(),this.sendrecvDataChannelController.handleOnMessage=e=>this.handleOnMessage(e)}handleSendWebRTCOffer(e){i.Log(i.GetStackTrace(),"Sending the offer to the Server",6),this.webSocketController.sendWebRtcOffer(e)}handleSendWebRTCAnswer(e){i.Log(i.GetStackTrace(),"Sending the answer to the Server",6),this.webSocketController.sendWebRtcAnswer(e),this.isUsingSFU&&this.webSocketController.sendWebRtcDatachannelRequest()}setUpMouseAndFreezeFrame(){this.videoElementParentClientRect=this.videoPlayer.getVideoParentElement().getBoundingClientRect(),this.coordinateConverter.setupNormalizeAndQuantize(),this.freezeFrameController.freezeFrame.resize()}closeSignalingServer(){var e;null===(e=this.webSocketController)||void 0===e||e.close()}closePeerConnection(){var e;null===(e=this.peerConnectionController)||void 0===e||e.close()}close(){this.closeSignalingServer(),this.closePeerConnection()}getStats(){this.peerConnectionController.generateStats()}sendLatencyTest(){this.latencyStartTime=Date.now(),this.sendDescriptorController.sendLatencyTest({StartTime:this.latencyStartTime})}sendEncoderMinQP(e){i.Log(i.GetStackTrace(),`MinQP=${e}\n`,6),null!=e&&this.sendDescriptorController.emitCommand({"Encoder.MinQP":e})}sendEncoderMaxQP(e){i.Log(i.GetStackTrace(),`MaxQP=${e}\n`,6),null!=e&&this.sendDescriptorController.emitCommand({"Encoder.MaxQP":e})}sendWebRTCMinBitrate(e){i.Log(i.GetStackTrace(),`WebRTC Min Bitrate=${e}`,6),null!=e&&this.sendDescriptorController.emitCommand({"WebRTC.MinBitrate":e})}sendWebRTCMaxBitrate(e){i.Log(i.GetStackTrace(),`WebRTC Max Bitrate=${e}`,6),null!=e&&this.sendDescriptorController.emitCommand({"WebRTC.MaxBitrate":e})}sendWebRTCFps(e){i.Log(i.GetStackTrace(),`WebRTC FPS=${e}`,6),null!=e&&(this.sendDescriptorController.emitCommand({"WebRTC.Fps":e}),this.sendDescriptorController.emitCommand({"WebRTC.MaxFps":e}))}sendShowFps(){i.Log(i.GetStackTrace(),"---- Sending show stat to UE ----",6),this.sendDescriptorController.emitCommand({"stat.fps":""})}sendIframeRequest(){i.Log(i.GetStackTrace(),"---- Sending Request for an IFrame ----",6),this.streamMessageController.toStreamerHandlers.get("IFrameRequest")()}emitUIInteraction(e){i.Log(i.GetStackTrace(),"---- Sending custom UIInteraction message ----",6),this.sendDescriptorController.emitUIInteraction(e)}emitCommand(e){i.Log(i.GetStackTrace(),"---- Sending custom Command message ----",6),this.sendDescriptorController.emitCommand(e)}emitConsoleCommand(e){i.Log(i.GetStackTrace(),"---- Sending custom Command:ConsoleCommand message ----",6),this.sendDescriptorController.emitCommand({ConsoleCommand:e})}sendRequestQualityControlOwnership(){i.Log(i.GetStackTrace(),"---- Sending Request to Control Quality ----",6),this.toStreamerMessagesController.SendRequestQualityControl()}handleLatencyTestResult(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.latencyTest",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),r=new Ie;Object.assign(r,JSON.parse(t)),r.processFields(),r.testStartTimeMs=this.latencyStartTime,r.browserReceiptTimeMs=Date.now(),r.latencyExcludingDecode=~~(r.browserReceiptTimeMs-r.testStartTimeMs),r.testDuration=~~(r.TransmissionTimeMs-r.ReceiptTimeMs),r.networkLatency=~~(r.latencyExcludingDecode-r.testDuration),r.frameDisplayDeltaTimeMs&&r.browserReceiptTimeMs&&(r.endToEndLatency=(r.frameDisplayDeltaTimeMs,r.networkLatency,~~+r.CaptureToSendMs)),this.pixelStreaming._onLatencyTestResult(r)}handleInitialSettings(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.InitialSettings",6);const t=new TextDecoder("utf-16").decode(e.slice(1)),r=JSON.parse(t),n=new Fe;r.Encoder&&(n.EncoderSettings=r.Encoder),r.WebRTC&&(n.WebRTCSettings=r.WebRTC),r.PixelStreaming&&(n.PixelStreamingSettings=r.PixelStreaming),r.ConfigOptions&&this.config.setFlagEnabled(re.HoveringMouseMode,!!r.ConfigOptions.DefaultToHover),n.ueCompatible(),i.Log(i.GetStackTrace(),t,6),this.pixelStreaming._onInitialSettings(n)}handleVideoEncoderAvgQP(e){i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.VideoEncoderAvgQP",6);const t=Number(new TextDecoder("utf-16").decode(e.slice(1)));this.setVideoEncoderAvgQP(t)}handleVideoInitialized(){this.pixelStreaming._onVideoInitialized(),this.autoPlayVideoOrSetUpPlayOverlay(),this.resizePlayerStyle(),this.videoPlayer.updateVideoStreamSize()}onQualityControlOwnership(e){const t=new Uint8Array(e);i.Log(i.GetStackTrace(),"DataChannelReceiveMessageType.QualityControlOwnership",6),this.isQualityController=new Boolean(t[1]).valueOf(),i.Log(i.GetStackTrace(),`Received quality controller message, will control quality: ${this.isQualityController}`),this.pixelStreaming._onQualityControlOwnership(this.isQualityController)}handleVideoStats(e){this.pixelStreaming._onVideoStats(e)}resizePlayerStyle(){this.videoPlayer.resizePlayerStyle()}getDisconnectMessageOverride(){return this.disconnectMessageOverride}setDisconnectMessageOverride(e){this.disconnectMessageOverride=e}setPreferredCodec(e){this.preferredCodec=e,this.peerConnectionController&&(this.peerConnectionController.preferredCodec=e,this.peerConnectionController.updateCodecSelection=!1)}setVideoEncoderAvgQP(e){this.videoAvgQp=e,this.pixelStreaming._onVideoEncoderAvgQP(this.videoAvgQp)}setKeyboardInputEnabled(e){var t;null===(t=this.keyboardController)||void 0===t||t.unregisterKeyBoardEvents(),e&&(this.keyboardController=this.inputClassesFactory.registerKeyBoard(this.config))}setMouseInputEnabled(e){var t;if(null===(t=this.mouseController)||void 0===t||t.unregisterMouseEvents(),e){const e=this.config.isFlagEnabled(re.HoveringMouseMode)?ue.HoveringMouse:ue.LockedMouse;this.mouseController=this.inputClassesFactory.registerMouse(e)}}setTouchInputEnabled(e){var t;null===(t=this.touchController)||void 0===t||t.unregisterTouchEvents(),e&&(this.touchController=this.inputClassesFactory.registerTouch(this.config.isFlagEnabled(re.FakeMouseWithTouches),this.videoElementParentClientRect))}setGamePadInputEnabled(e){var t;null===(t=this.gamePadController)||void 0===t||t.unregisterGamePadEvents(),e&&(this.gamePadController=this.inputClassesFactory.registerGamePad(),this.gamePadController.onGamepadConnected=()=>{this.streamMessageController.toStreamerHandlers.get("GamepadConnected")()},this.gamePadController.onGamepadDisconnected=e=>{this.streamMessageController.toStreamerHandlers.get("GamepadDisconnected")([e])})}registerDataChannelEventEmitters(e){e.onOpen=(e,t)=>this.pixelStreaming.dispatchEvent(new B$1({label:e,event:t})),e.onClose=(e,t)=>this.pixelStreaming.dispatchEvent(new _$1({label:e,event:t})),e.onError=(e,t)=>this.pixelStreaming.dispatchEvent(new W$1({label:e,event:t}))}}class gt{static vertexShader(){return"\n\t\tattribute vec2 a_position;\n\t\tattribute vec2 a_texCoord;\n\n\t\t// input\n\t\tuniform vec2 u_resolution;\n\t\tuniform vec4 u_offset;\n\n\t\t//\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t // convert the rectangle from pixels to 0.0 to 1.0\n\t\t vec2 zeroToOne = a_position / u_resolution;\n\n\t\t // convert from 0->1 to 0->2\n\t\t vec2 zeroToTwo = zeroToOne * 2.0;\n\n\t\t // convert from 0->2 to -1->+1 (clipspace)\n\t\t vec2 clipSpace = zeroToTwo - 1.0;\n\n\t\t gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\t\t // pass the texCoord to the fragment shader\n\t\t // The GPU will interpolate this value between points.\n\t\t v_texCoord = (a_texCoord * u_offset.xy) + u_offset.zw;\n\t\t}\n\t\t"}static fragmentShader(){return"\n\t\tprecision mediump float;\n\n\t\t// our texture\n\t\tuniform sampler2D u_image;\n\n\t\t// the texCoords passed in from the vertex shader.\n\t\tvarying vec2 v_texCoord;\n\n\t\tvoid main() {\n\t\t gl_FragColor = texture2D(u_image, v_texCoord);\n\t\t}\n\t\t"}}class ut{static deepCopyGamepad(e){return JSON.parse(JSON.stringify({buttons:e.buttons.map((e=>JSON.parse(JSON.stringify({pressed:e.pressed,touched:e.touched})))),axes:e.axes}))}}class mt{constructor(e){this.toStreamerMessagesProvider=e,this.controllers=[]}updateStatus(e,t,r){if(e.gamepad){const n=t.getPose(e.gripSpace,r);if(!n)return;let i=0;e.profiles.includes("htc-vive")?i=1:e.profiles.includes("oculus-touch")&&(i=2),this.toStreamerMessagesProvider.toStreamerHandlers.get("XRSystem")([i]);let s=2;switch(e.handedness){case"left":s=0;break;case"right":s=1}const a=n.transform.matrix,o=[];for(let e=0;e<16;e++)o[e]=new Float32Array([a[e]])[0];this.toStreamerMessagesProvider.toStreamerHandlers.get("XRControllerTransform")([o[0],o[4],o[8],o[12],o[1],o[5],o[9],o[13],o[2],o[6],o[10],o[14],o[3],o[7],o[11],o[15],s]),void 0===this.controllers[s]&&(this.controllers[s]={prevState:void 0,currentState:void 0,id:void 0},this.controllers[s].prevState=ut.deepCopyGamepad(e.gamepad)),this.controllers[s].currentState=ut.deepCopyGamepad(e.gamepad);const l=this.controllers[s],c=l.currentState,h=l.prevState;for(let e=0;e<c.buttons.length;e++){const t=c.buttons[e],r=h.buttons[e];t.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([s,e,r.pressed?1:0]):!t.pressed&&r.pressed&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([s,e,0]),t.touched&&!t.pressed?this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonPressed")([s,3,r.touched?1:0]):!t.touched&&r.touched&&this.toStreamerMessagesProvider.toStreamerHandlers.get("XRButtonReleased")([s,3,0])}for(let e=0;e<c.axes.length;e++)this.toStreamerMessagesProvider.toStreamerHandlers.get("XRAnalog")([s,e,c.axes[e]]);this.controllers[s].prevState=c}}}class St{constructor(e){this.xrSession=null,this.webRtcController=e,this.xrControllers=[],this.xrGamepadController=new mt(this.webRtcController.streamMessageController),this.onSessionEnded=new EventTarget,this.onSessionStarted=new EventTarget,this.onFrame=new EventTarget}xrClicked(){this.xrSession?this.xrSession.end():navigator.xr.requestSession("immersive-vr").then((e=>{this.onXrSessionStarted(e)}))}onXrSessionEnded(){i.Log(i.GetStackTrace(),"XR Session ended"),this.xrSession=null,this.onSessionEnded.dispatchEvent(new Event("xrSessionEnded"))}onXrSessionStarted(e){i.Log(i.GetStackTrace(),"XR Session started"),this.xrSession=e,this.xrSession.addEventListener("end",(()=>{this.onXrSessionEnded()}));const t=document.createElement("canvas");this.gl=t.getContext("webgl2",{xrCompatible:!0}),this.xrSession.updateRenderState({baseLayer:new XRWebGLLayer(this.xrSession,this.gl)});const r=this.gl.createShader(this.gl.VERTEX_SHADER);this.gl.shaderSource(r,gt.vertexShader()),this.gl.compileShader(r);const n=this.gl.createShader(this.gl.FRAGMENT_SHADER);this.gl.shaderSource(n,gt.fragmentShader()),this.gl.compileShader(n);const s=this.gl.createProgram();this.gl.attachShader(s,r),this.gl.attachShader(s,n),this.gl.linkProgram(s),this.gl.useProgram(s),this.positionLocation=this.gl.getAttribLocation(s,"a_position"),this.texcoordLocation=this.gl.getAttribLocation(s,"a_texCoord"),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.enableVertexAttribArray(this.positionLocation);const a=this.gl.createTexture();this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.NEAREST),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),this.texcoordBuffer=this.gl.createBuffer(),this.resolutionLocation=this.gl.getUniformLocation(s,"u_resolution"),this.offsetLocation=this.gl.getUniformLocation(s,"u_offset"),e.requestReferenceSpace("local").then((e=>{this.xrRefSpace=e,this.xrSession.requestAnimationFrame(((e,t)=>this.onXrFrame(e,t)))})),this.onSessionStarted.dispatchEvent(new Event("xrSessionStarted"))}onXrFrame(e,t){const r=t.getViewerPose(this.xrRefSpace);if(r){const e=r.transform.matrix,t=[];for(let r=0;r<16;r++)t[r]=new Float32Array([e[r]])[0];this.webRtcController.streamMessageController.toStreamerHandlers.get("XRHMDTransform")([t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]]);const n=this.xrSession.renderState.baseLayer;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,n.framebuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.webRtcController.videoPlayer.getVideoElement()),this.render(this.webRtcController.videoPlayer.getVideoElement())}this.webRtcController.config.isFlagEnabled(re.XRControllerInput)&&this.xrSession.inputSources.forEach(((e,r,n)=>{this.xrGamepadController.updateStatus(e,t,this.xrRefSpace)}),this),this.xrSession.requestAnimationFrame(((e,t)=>this.onXrFrame(e,t))),this.onFrame.dispatchEvent(new se({time:e,frame:t}))}render(e){if(!this.gl)return;const t=this.xrSession.renderState.baseLayer;let r,n,i,s,a;this.gl.viewport(0,0,t.framebufferWidth,t.framebufferHeight),this.gl.uniform4f(this.offsetLocation,1,1,0,0),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,e.videoWidth,0,0,e.videoHeight,0,e.videoHeight,e.videoWidth,0,e.videoWidth,e.videoHeight]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),r=2,n=this.gl.FLOAT,i=!1,s=0,a=0,this.gl.vertexAttribPointer(this.positionLocation,r,n,i,s,a),this.gl.enableVertexAttribArray(this.texcoordLocation),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.texcoordBuffer),r=2,n=this.gl.FLOAT,i=!1,s=0,a=0,this.gl.vertexAttribPointer(this.texcoordLocation,r,n,i,s,a),this.gl.uniform2f(this.resolutionLocation,e.videoWidth,e.videoHeight);const o=this.gl.TRIANGLES;a=0,this.gl.drawArrays(o,a,6)}static isSessionSupported(e){return navigator.xr?navigator.xr.isSessionSupported(e):new Promise((()=>!1))}}class pt{constructor(e){this.editTextButton=null,this.hiddenInput=null,"ontouchstart"in document.documentElement&&this.createOnScreenKeyboardHelpers(e)}unquantizeAndDenormalizeUnsigned(e,t){return null}createOnScreenKeyboardHelpers(e){this.hiddenInput||(this.hiddenInput=document.createElement("input"),this.hiddenInput.id="hiddenInput",this.hiddenInput.maxLength=0,e.appendChild(this.hiddenInput)),this.editTextButton||(this.editTextButton=document.createElement("button"),this.editTextButton.id="editTextButton",this.editTextButton.innerHTML="edit text",e.appendChild(this.editTextButton),this.editTextButton.classList.add("hiddenState"),this.editTextButton.addEventListener("touchend",(e=>{this.hiddenInput.focus(),e.preventDefault()})))}showOnScreenKeyboard(e){if(e.showOnScreenKeyboard){this.editTextButton.classList.remove("hiddenState");const t=this.unquantizeAndDenormalizeUnsigned(e.x,e.y);this.editTextButton.style.top=t.y.toString()+"px",this.editTextButton.style.left=(t.x-40).toString()+"px"}else this.editTextButton.classList.add("hiddenState"),this.hiddenInput.blur()}}class vt{constructor(e,t){this._showActionOrErrorOnDisconnect=!0,this.allowConsoleCommands=!1,this.config=e,(null==t?void 0:t.videoElementParent)&&(this._videoElementParent=t.videoElementParent),this._eventEmitter=new ne,this.configureSettings(),this.setWebRtcPlayerController(new ht(this.config,this)),this.onScreenKeyboardHelper=new pt(this.videoElementParent),this.onScreenKeyboardHelper.unquantizeAndDenormalizeUnsigned=(e,t)=>this._webRtcController.requestUnquantizedAndDenormalizeUnsigned(e,t),this._activateOnScreenKeyboard=e=>this.onScreenKeyboardHelper.showOnScreenKeyboard(e),this._webXrController=new St(this._webRtcController)}get videoElementParent(){return this._videoElementParent||(this._videoElementParent=document.createElement("div"),this._videoElementParent.id="videoElementParent"),this._videoElementParent}configureSettings(){this.config._addOnSettingChangedListener(re.IsQualityController,(e=>{!0!==e||this._webRtcController.isQualityController||this._webRtcController.sendRequestQualityControlOwnership()})),this.config._addOnSettingChangedListener(re.AFKDetection,(e=>{this._webRtcController.setAfkEnabled(e)})),this.config._addOnSettingChangedListener(re.MatchViewportResolution,(()=>{this._webRtcController.videoPlayer.updateVideoStreamSize()})),this.config._addOnSettingChangedListener(re.HoveringMouseMode,(e=>{this.config.setFlagLabel(re.HoveringMouseMode,`Control Scheme: ${e?"Hovering":"Locked"} Mouse`),this._webRtcController.setMouseInputEnabled(this.config.isFlagEnabled(re.MouseInput))})),this.config._addOnSettingChangedListener(re.KeyboardInput,(e=>{this._webRtcController.setKeyboardInputEnabled(e)})),this.config._addOnSettingChangedListener(re.MouseInput,(e=>{this._webRtcController.setMouseInputEnabled(e)})),this.config._addOnSettingChangedListener(re.TouchInput,(e=>{this._webRtcController.setTouchInputEnabled(e)})),this.config._addOnSettingChangedListener(re.GamepadInput,(e=>{this._webRtcController.setGamePadInputEnabled(e)})),this.config._addOnNumericSettingChangedListener(oe.MinQP,(e=>{i.Log(i.GetStackTrace(),"-------- Sending MinQP --------",7),this._webRtcController.sendEncoderMinQP(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(oe.MaxQP,(e=>{i.Log(i.GetStackTrace(),"-------- Sending encoder settings --------",7),this._webRtcController.sendEncoderMaxQP(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(oe.WebRTCMinBitrate,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMinBitrate(1e3*e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(oe.WebRTCMaxBitrate,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCMaxBitrate(1e3*e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnNumericSettingChangedListener(oe.WebRTCFPS,(e=>{i.Log(i.GetStackTrace(),"-------- Sending web rtc settings --------",7),this._webRtcController.sendWebRTCFps(e),i.Log(i.GetStackTrace(),"-------------------------------------------",7)})),this.config._addOnOptionSettingChangedListener(ce.PreferredCodec,(e=>{this._webRtcController&&this._webRtcController.setPreferredCodec(e)})),this.config._registerOnChangeEvents(this._eventEmitter)}_activateOnScreenKeyboard(e){throw new Error("Method not implemented.")}_onInputControlOwnership(e){this._inputController=e}setWebRtcPlayerController(e){this._webRtcController=e,this._webRtcController.setPreferredCodec(this.config.getSettingOption(ce.PreferredCodec).selected),this._webRtcController.resizePlayerStyle(),this.checkForAutoConnect()}connect(){this._webRtcController.connectToSignallingServer()}reconnect(){this._webRtcController.restartStreamAutomatically()}disconnect(){this._webRtcController.close()}play(){this._onStreamLoading(),this._webRtcController.playStream()}checkForAutoConnect(){this.config.isFlagEnabled(re.AutoConnect)&&(this._onWebRtcAutoConnect(),this._webRtcController.connectToSignallingServer())}_onWebRtcAutoConnect(){this._eventEmitter.dispatchEvent(new O$1),this._showActionOrErrorOnDisconnect=!0}_onWebRtcSdp(){this._eventEmitter.dispatchEvent(new D$1)}_onStreamLoading(){this._eventEmitter.dispatchEvent(new V$1)}_onDisconnect(e){""!=this._webRtcController.getDisconnectMessageOverride()&&void 0!==this._webRtcController.getDisconnectMessageOverride()&&null!=this._webRtcController.getDisconnectMessageOverride()&&(e=this._webRtcController.getDisconnectMessageOverride(),this._webRtcController.setDisconnectMessageOverride("")),this._eventEmitter.dispatchEvent(new z$2({eventString:e,showActionOrErrorOnDisconnect:this._showActionOrErrorOnDisconnect})),0==this._showActionOrErrorOnDisconnect&&(this._showActionOrErrorOnDisconnect=!0)}_onWebRtcConnecting(){this._eventEmitter.dispatchEvent(new U$1)}_onWebRtcConnected(){this._eventEmitter.dispatchEvent(new I$1)}_onWebRtcFailed(){this._eventEmitter.dispatchEvent(new G$1)}_onVideoInitialized(){this._eventEmitter.dispatchEvent(new H$1),this._videoStartTime=Date.now()}_onLatencyTestResult(e){this._eventEmitter.dispatchEvent(new Y$1({latencyTimings:e}))}_onVideoStats(e){this._videoStartTime&&void 0!==this._videoStartTime||(this._videoStartTime=Date.now()),e.handleSessionStatistics(this._videoStartTime,this._inputController,this._webRtcController.videoAvgQp),this._eventEmitter.dispatchEvent(new X$1({aggregatedStats:e}))}_onVideoEncoderAvgQP(e){this._eventEmitter.dispatchEvent(new F$1({avgQP:e}))}_onInitialSettings(e){var t;this._eventEmitter.dispatchEvent(new J$1({settings:e})),e.PixelStreamingSettings&&(this.allowConsoleCommands=null!==(t=e.PixelStreamingSettings.AllowPixelStreamingCommands)&&void 0!==t&&t,!1===this.allowConsoleCommands&&i.Info(i.GetStackTrace(),"-AllowPixelStreamingCommands=false, sending arbitrary console commands from browser to UE is disabled."));const r=this.config.useUrlParams,n=new URLSearchParams(window.location.search);e.EncoderSettings&&(this.config.setNumericSetting(oe.MinQP,r&&n.has(oe.MinQP)?Number.parseInt(n.get(oe.MinQP)):e.EncoderSettings.MinQP),this.config.setNumericSetting(oe.MaxQP,r&&n.has(oe.MaxQP)?Number.parseInt(n.get(oe.MaxQP)):e.EncoderSettings.MaxQP)),e.WebRTCSettings&&(this.config.setNumericSetting(oe.WebRTCMinBitrate,r&&n.has(oe.WebRTCMinBitrate)?Number.parseInt(n.get(oe.WebRTCMinBitrate))/1e3:e.WebRTCSettings.MinBitrate/1e3),this.config.setNumericSetting(oe.WebRTCMaxBitrate,r&&n.has(oe.WebRTCMaxBitrate)?Number.parseInt(n.get(oe.WebRTCMaxBitrate))/1e3:e.WebRTCSettings.MaxBitrate/1e3),this.config.setNumericSetting(oe.WebRTCFPS,r&&n.has(oe.WebRTCFPS)?Number.parseInt(n.get(oe.WebRTCFPS)):e.WebRTCSettings.FPS))}_onQualityControlOwnership(e){this.config.setFlagEnabled(re.IsQualityController,e)}requestLatencyTest(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendLatencyTest(),!0)}requestShowFps(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendShowFps(),!0)}requestIframe(){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.sendIframeRequest(),!0)}emitUIInteraction(e){return!!this._webRtcController.videoPlayer.isVideoReady()&&(this._webRtcController.emitUIInteraction(e),!0)}emitCommand(e){return!(!this._webRtcController.videoPlayer.isVideoReady()||!this.allowConsoleCommands&&"ConsoleCommand"in e||(this._webRtcController.emitCommand(e),0))}emitConsoleCommand(e){return!(!this.allowConsoleCommands||!this._webRtcController.videoPlayer.isVideoReady()||(this._webRtcController.emitConsoleCommand(e),0))}addResponseEventListener(e,t){this._webRtcController.responseController.addResponseEventListener(e,t)}removeResponseEventListener(e){this._webRtcController.responseController.removeResponseEventListener(e)}dispatchEvent(e){return this._eventEmitter.dispatchEvent(e)}addEventListener(e,t){this._eventEmitter.addEventListener(e,t)}removeEventListener(e,t){this._eventEmitter.removeEventListener(e,t)}toggleXR(){this.webXrController.xrClicked()}setSignallingUrlBuilder(e){this._webRtcController.signallingUrlBuilder=e}get webSocketController(){return this._webRtcController.webSocketController}get webXrController(){return this._webXrController}}var Ct=r$1.Dz,ft=r$1.g$,Tt=r$1.Lt,Et=r$1.Q9,yt=r$1.qf,bt=r$1.hV,Mt=r$1.z$,wt=r$1.J0,Pt=r$1.De,kt=r$1.$C,Rt=r$1.al,Lt=r$1._W,xt=r$1.tz,At=r$1.Nu,Ft=r$1.zg,Dt=r$1.vp,Ot=r$1.vU,Ut=r$1.wF,It=r$1.rv,Gt=r$1.Nh,zt=r$1.ss,Bt=r$1.qW,_t=r$1.QL,Wt=r$1.cf,Ht=r$1.eM,Vt=r$1.Yd,Nt=r$1.iM,Kt=r$1.qy,Qt=r$1.ce,$t=r$1.sK,qt=r$1.Ok,Xt=r$1.q5,jt=r$1.g,Yt=r$1.xl,Jt=r$1.I,Zt=r$1.bx,es=r$1.Ib,ts=r$1.Az,ss=r$1.Iw,ns$1=r$1.qY,rs=r$1.db,is=r$1.mR,os=r$1.Tn,as=r$1.rV,ds=r$1.gh,ls=r$1.i5,cs=r$1.x_,hs=r$1.Am,gs=r$1.eR,us=r$1.r8,ms=r$1.u3,Ss=r$1.vd,ps=r$1.iV,vs=r$1.jZ,Cs=r$1.SW,fs=r$1.ZH,Ts=r$1.Ni,Es=r$1.lh,ys=r$1.bq,bs=r$1.$f,Ms=r$1.eu,ws=r$1.Ax,Ps=r$1.Mc;function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}var _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},isBrowser="object"===("undefined"==typeof window?"undefined":_typeof$1(window))&&"object"===("undefined"==typeof document?"undefined":_typeof$1(document))&&9===document.nodeType;function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}var plainObjectConstrurctor={}.constructor;function cloneStyle(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(cloneStyle);if(e.constructor!==plainObjectConstrurctor)return e;var t={};for(var r in e)t[r]=cloneStyle(e[r]);return t}function createRule(e,t,r){void 0===e&&(e="unnamed");var n=r.jss,i=cloneStyle(t),s=n.plugins.onCreateRule(e,i,r);return s||(e[0],null)}var join$4=function(e,t){for(var r="",n=0;n<e.length&&"!important"!==e[n];n++)r&&(r+=t),r+=e[n];return r},toCssValue=function(e){if(!Array.isArray(e))return e;var t="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)t&&(t+=", "),t+=join$4(e[r]," ");else t=join$4(e,", ");return"!important"===e[e.length-1]&&(t+=" !important"),t};function getWhitespaceSymbols(e){return e&&!1===e.format?{linebreak:"",space:""}:{linebreak:"\n",space:" "}}function indentStr(e,t){for(var r="",n=0;n<t;n++)r+=" ";return r+e}function toCss(e,t,r){void 0===r&&(r={});var n="";if(!t)return n;var i=r.indent,s=void 0===i?0:i,a=t.fallbacks;!1===r.format&&(s=-1/0);var o=getWhitespaceSymbols(r),l=o.linebreak,c=o.space;if(e&&s++,a)if(Array.isArray(a))for(var h=0;h<a.length;h++){var d=a[h];for(var u in d){var p=d[u];null!=p&&(n&&(n+=l),n+=indentStr(u+":"+c+toCssValue(p)+";",s))}}else for(var f in a){var m=a[f];null!=m&&(n&&(n+=l),n+=indentStr(f+":"+c+toCssValue(m)+";",s))}for(var g in t){var y=t[g];null!=y&&"fallbacks"!==g&&(n&&(n+=l),n+=indentStr(g+":"+c+toCssValue(y)+";",s))}return(n||r.allowEmpty)&&e?(n&&(n=""+l+n+l),indentStr(""+e+c+"{"+n,--s)+indentStr("}",s)):n}var escapeRegex=/([[\].#*$><+~=|^:(),"'`\s])/g,nativeEscape="undefined"!=typeof CSS&&CSS.escape,escape=function(e){return nativeEscape?nativeEscape(e):e.replace(escapeRegex,"\\$1")},BaseStyleRule=function(){function e(e,t,r){this.type="style",this.isProcessed=!1;var n=r.sheet,i=r.Renderer;this.key=e,this.options=r,this.style=t,n?this.renderer=n.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,r){if(void 0===t)return this.style[e];var n=!!r&&r.force;if(!n&&this.style[e]===t)return this;var i=t;r&&!1===r.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var s=null==i||!1===i,a=e in this.style;if(s&&!a&&!n)return this;var o=s&&a;if(o?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return o?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},e}(),StyleRule=function(e){function t(t,r,n){var i;i=e.call(this,t,r,n)||this;var s=n.selector,a=n.scoped,o=n.sheet,l=n.generateId;return s?i.selectorText=s:!1!==a&&(i.id=l(_assertThisInitialized(_assertThisInitialized(i)),o),i.selectorText="."+escape(i.id)),i}_inheritsLoose(t,e);var r=t.prototype;return r.applyTo=function(e){var t=this.renderer;if(t){var r=this.toJSON();for(var n in r)t.setProperty(e,n,r[n])}return this},r.toJSON=function(){var e={};for(var t in this.style){var r=this.style[t];"object"!=typeof r?e[t]=r:Array.isArray(r)&&(e[t]=toCssValue(r))}return e},r.toString=function(e){var t=this.options.sheet,r=!!t&&t.options.link?_extends({},e,{allowEmpty:!0}):e;return toCss(this.selectorText,this.style,r)},_createClass(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,r=this.renderable;if(r&&t)t.setSelector(r,e)||t.replaceRule(r,this)}},get:function(){return this.selectorText}}]),t}(BaseStyleRule),pluginStyleRule={onCreateRule:function(e,t,r){return"@"===e[0]||r.parent&&"keyframes"===r.parent.type?null:new StyleRule(e,t,r)}},defaultToStringOptions={indent:1,children:!0},atRegExp=/@([\w-]+)/,ConditionalRule=function(){function e(e,t,r){this.type="conditional",this.isProcessed=!1,this.key=e;var n=e.match(atRegExp);for(var i in this.at=n?n[1]:"unknown",this.query=r.name||"@"+this.at,this.options=r,this.rules=new RuleList(_extends({},r,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,r){var n=this.rules.add(e,t,r);return n?(this.options.jss.plugins.onProcessRule(n),n):null},t.replaceRule=function(e,t,r){var n=this.rules.replace(e,t,r);return n&&this.options.jss.plugins.onProcessRule(n),n},t.toString=function(e){void 0===e&&(e=defaultToStringOptions);var t=getWhitespaceSymbols(e).linebreak;if(null==e.indent&&(e.indent=defaultToStringOptions.indent),null==e.children&&(e.children=defaultToStringOptions.children),!1===e.children)return this.query+" {}";var r=this.rules.toString(e);return r?this.query+" {"+t+r+t+"}":""},e}(),keyRegExp=/@container|@media|@supports\s+/,pluginConditionalRule={onCreateRule:function(e,t,r){return keyRegExp.test(e)?new ConditionalRule(e,t,r):null}},defaultToStringOptions$1={indent:1,children:!0},nameRegExp=/@keyframes\s+([\w-]+)/,KeyframesRule=function(){function e(e,t,r){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var n=e.match(nameRegExp);n&&n[1]?this.name=n[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=r;var i=r.scoped,s=r.sheet,a=r.generateId;for(var o in this.id=!1===i?this.name:escape(a(this,s)),this.rules=new RuleList(_extends({},r,{parent:this})),t)this.rules.add(o,t[o],_extends({},r,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=defaultToStringOptions$1);var t=getWhitespaceSymbols(e).linebreak;if(null==e.indent&&(e.indent=defaultToStringOptions$1.indent),null==e.children&&(e.children=defaultToStringOptions$1.children),!1===e.children)return this.at+" "+this.id+" {}";var r=this.rules.toString(e);return r&&(r=""+t+r+t),this.at+" "+this.id+" {"+r+"}"},e}(),keyRegExp$1=/@keyframes\s+/,refRegExp=/\$([\w-]+)/g,findReferencedKeyframe=function(e,t){return"string"==typeof e?e.replace(refRegExp,(function(e,r){return r in t?t[r]:e})):e},replaceRef=function(e,t,r){var n=e[t],i=findReferencedKeyframe(n,r);i!==n&&(e[t]=i)},pluginKeyframesRule={onCreateRule:function(e,t,r){return"string"==typeof e&&keyRegExp$1.test(e)?new KeyframesRule(e,t,r):null},onProcessStyle:function(e,t,r){return"style"===t.type&&r?("animation-name"in e&&replaceRef(e,"animation-name",r.keyframes),"animation"in e&&replaceRef(e,"animation",r.keyframes),e):e},onChangeValue:function(e,t,r){var n=r.options.sheet;if(!n)return e;switch(t){case"animation":case"animation-name":return findReferencedKeyframe(e,n.keyframes);default:return e}}},KeyframeRule=function(e){function t(){return e.apply(this,arguments)||this}return _inheritsLoose(t,e),t.prototype.toString=function(e){var t=this.options.sheet,r=!!t&&t.options.link?_extends({},e,{allowEmpty:!0}):e;return toCss(this.key,this.style,r)},t}(BaseStyleRule),pluginKeyframeRule={onCreateRule:function(e,t,r){return r.parent&&"keyframes"===r.parent.type?new KeyframeRule(e,t,r):null}},FontFaceRule=function(){function e(e,t,r){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=r}return e.prototype.toString=function(e){var t=getWhitespaceSymbols(e).linebreak;if(Array.isArray(this.style)){for(var r="",n=0;n<this.style.length;n++)r+=toCss(this.at,this.style[n]),this.style[n+1]&&(r+=t);return r}return toCss(this.at,this.style,e)},e}(),keyRegExp$2=/@font-face/,pluginFontFaceRule={onCreateRule:function(e,t,r){return keyRegExp$2.test(e)?new FontFaceRule(e,t,r):null}},ViewportRule=function(){function e(e,t,r){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=e,this.style=t,this.options=r}return e.prototype.toString=function(e){return toCss(this.key,this.style,e)},e}(),pluginViewportRule={onCreateRule:function(e,t,r){return"@viewport"===e||"@-ms-viewport"===e?new ViewportRule(e,t,r):null}},SimpleRule=function(){function e(e,t,r){this.type="simple",this.isProcessed=!1,this.key=e,this.value=t,this.options=r}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",r=0;r<this.value.length;r++)t+=this.key+" "+this.value[r]+";",this.value[r+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),keysMap={"@charset":!0,"@import":!0,"@namespace":!0},pluginSimpleRule={onCreateRule:function(e,t,r){return e in keysMap?new SimpleRule(e,t,r):null}},plugins=[pluginStyleRule,pluginConditionalRule,pluginKeyframesRule,pluginKeyframeRule,pluginFontFaceRule,pluginViewportRule,pluginSimpleRule],defaultUpdateOptions={process:!0},forceUpdateOptions={force:!0,process:!0},RuleList=function(){function e(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var t=e.prototype;return t.add=function(e,t,r){var n=this.options,i=n.parent,s=n.sheet,a=n.jss,o=n.Renderer,l=n.generateId,c=n.scoped,h=_extends({classes:this.classes,parent:i,sheet:s,jss:a,Renderer:o,generateId:l,scoped:c,name:e,keyframes:this.keyframes,selector:void 0},r),d=e;e in this.raw&&(d=e+"-d"+this.counter++),this.raw[d]=t,d in this.classes&&(h.selector="."+escape(this.classes[d]));var u=createRule(d,t,h);if(!u)return null;this.register(u);var p=void 0===h.index?this.index.length:h.index;return this.index.splice(p,0,u),u},t.replace=function(e,t,r){var n=this.get(e),i=this.index.indexOf(n);n&&this.remove(n);var s=r;return-1!==i&&(s=_extends({},r,{index:i})),this.add(e,t,s)},t.get=function(e){return this.map[e]},t.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},t.indexOf=function(e){return this.index.indexOf(e)},t.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},t.register=function(e){this.map[e.key]=e,e instanceof StyleRule?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof KeyframesRule&&this.keyframes&&(this.keyframes[e.name]=e.id)},t.unregister=function(e){delete this.map[e.key],e instanceof StyleRule?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof KeyframesRule&&delete this.keyframes[e.name]},t.update=function(){var e,t,r;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.get(e),t,r);else for(var n=0;n<this.index.length;n++)this.updateOne(this.index[n],t,r)},t.updateOne=function(t,r,n){void 0===n&&(n=defaultUpdateOptions);var i=this.options,s=i.jss.plugins,a=i.sheet;if(t.rules instanceof e)t.rules.update(r,n);else{var o=t.style;if(s.onUpdate(r,t,a,n),n.process&&o&&o!==t.style){for(var l in s.onProcessStyle(t.style,t,a),t.style){var c=t.style[l];c!==o[l]&&t.prop(l,c,forceUpdateOptions)}for(var h in o){var d=t.style[h],u=o[h];null==d&&d!==u&&t.prop(h,null,forceUpdateOptions)}}}},t.toString=function(e){for(var t="",r=this.options.sheet,n=!!r&&r.options.link,i=getWhitespaceSymbols(e).linebreak,s=0;s<this.index.length;s++){var a=this.index[s].toString(e);(a||n)&&(t&&(t+=i),t+=a)}return t},e}(),StyleSheet=function(){function e(e,t){for(var r in this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=_extends({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),t.Renderer&&(this.renderer=new t.Renderer(this)),this.rules=new RuleList(this.options),e)this.rules.add(r,e[r]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},t.addRule=function(e,t,r){var n=this.queue;this.attached&&!n&&(this.queue=[]);var i=this.rules.add(e,t,r);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(n?n.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),i):i:(this.deployed=!1,i)):null},t.replaceRule=function(e,t,r){var n=this.rules.get(e);if(!n)return this.addRule(e,t,r);var i=this.rules.replace(e,t,r);return i&&this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed?(this.renderer&&(i?n.renderable&&this.renderer.replaceRule(n.renderable,i):this.renderer.deleteRule(n)),i):i:(this.deployed=!1,i)},t.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},t.addRules=function(e,t){var r=[];for(var n in e){var i=this.addRule(n,e[n],t);i&&r.push(i)}return r},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t="object"==typeof e?e:this.rules.get(e);return!(!t||this.attached&&!t.renderable)&&(this.rules.remove(t),!(this.attached&&t.renderable&&this.renderer)||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.updateOne=function(e,t,r){return this.rules.updateOne(e,t,r),this},t.toString=function(e){return this.rules.toString(e)},e}(),PluginsRegistry=function(){function e(){this.plugins={internal:[],external:[]},this.registry={}}var t=e.prototype;return t.onCreateRule=function(e,t,r){for(var n=0;n<this.registry.onCreateRule.length;n++){var i=this.registry.onCreateRule[n](e,t,r);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,r=0;r<this.registry.onProcessRule.length;r++)this.registry.onProcessRule[r](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,r){for(var n=0;n<this.registry.onProcessStyle.length;n++)t.style=this.registry.onProcessStyle[n](t.style,t,r)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,r,n){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,r,n)},t.onChangeValue=function(e,t,r){for(var n=e,i=0;i<this.registry.onChangeValue.length;i++)n=this.registry.onChangeValue[i](n,t,r);return n},t.use=function(e,t){void 0===t&&(t={queue:"external"});var r=this.plugins[t.queue];-1===r.indexOf(e)&&(r.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce((function(e,t){for(var r in t)r in e&&e[r].push(t[r]);return e}),{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),SheetsRegistry=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,r=e.options.index;if(-1===t.indexOf(e))if(0===t.length||r>=this.index)t.push(e);else for(var n=0;n<t.length;n++)if(t[n].options.index>r)return void t.splice(n,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,r=t.attached,n=_objectWithoutPropertiesLoose(t,["attached"]),i=getWhitespaceSymbols(n).linebreak,s="",a=0;a<this.registry.length;a++){var o=this.registry[a];null!=r&&o.attached!==r||(s&&(s+=i),s+=o.toString(n))}return s},_createClass(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),sheets=new SheetsRegistry,globalThis$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),ns="2f1acc6c3a606b082e5eef5e54414ffb";null==globalThis$1[ns]&&(globalThis$1[ns]=0);var moduleId=globalThis$1[ns]++,createGenerateId=function(e){void 0===e&&(e={});var t=0;return function(r,n){t+=1;var i="",s="";return n&&(n.options.classNamePrefix&&(s=n.options.classNamePrefix),null!=n.options.jss.id&&(i=String(n.options.jss.id))),e.minify?""+(s||"c")+moduleId+i+t:s+r.key+"-"+moduleId+(i?"-"+i:"")+"-"+t}},memoize=function(e){var t;return function(){return t||(t=e()),t}},getPropertyValue=function(e,t){try{return e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(e){return""}},setProperty=function(e,t,r){try{var n=r;if(Array.isArray(r)&&(n=toCssValue(r)),e.attributeStyleMap)e.attributeStyleMap.set(t,n);else{var i=n?n.indexOf("!important"):-1,s=i>-1?n.substr(0,i-1):n;e.style.setProperty(t,s,i>-1?"important":"")}}catch(e){return!1}return!0},removeProperty=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(e){}},setSelector=function(e,t){return e.selectorText=t,e.selectorText===t},getHead=memoize((function(){return document.querySelector("head")}));function findHigherSheet(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.attached&&n.options.index>t.index&&n.options.insertionPoint===t.insertionPoint)return n}return null}function findHighestSheet(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.attached&&n.options.insertionPoint===t.insertionPoint)return n}return null}function findCommentNode(e){for(var t=getHead(),r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];if(8===n.nodeType&&n.nodeValue.trim()===e)return n}return null}function findPrevNode(e){var t=sheets.registry;if(t.length>0){var r=findHigherSheet(t,e);if(r&&r.renderer)return{parent:r.renderer.element.parentNode,node:r.renderer.element};if((r=findHighestSheet(t,e))&&r.renderer)return{parent:r.renderer.element.parentNode,node:r.renderer.element.nextSibling}}var n=e.insertionPoint;if(n&&"string"==typeof n){var i=findCommentNode(n);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function insertStyle(e,t){var r=t.insertionPoint,n=findPrevNode(t);if(!1!==n&&n.parent)n.parent.insertBefore(e,n.node);else if(r&&"number"==typeof r.nodeType){var i=r,s=i.parentNode;s&&s.insertBefore(e,i.nextSibling)}else getHead().appendChild(e)}var getNonce=memoize((function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null})),_insertRule=function(e,t,r){try{"insertRule"in e?e.insertRule(t,r):"appendRule"in e&&e.appendRule(t)}catch(e){return!1}return e.cssRules[r]},getValidRuleInsertionIndex=function(e,t){var r=e.cssRules.length;return void 0===t||t>r?r:t},createStyle=function(){var e=document.createElement("style");return e.textContent="\n",e},DomRenderer=function(){function e(e){this.getPropertyValue=getPropertyValue,this.setProperty=setProperty,this.removeProperty=removeProperty,this.setSelector=setSelector,this.hasInsertedRules=!1,this.cssRules=[],e&&sheets.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},r=t.media,n=t.meta,i=t.element;this.element=i||createStyle(),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),n&&this.element.setAttribute("data-meta",n);var s=getNonce();s&&this.element.setAttribute("nonce",s)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){insertStyle(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var r=0;r<e.index.length;r++)this.insertRule(e.index[r],r,t)},t.insertRule=function(e,t,r){if(void 0===r&&(r=this.element.sheet),e.rules){var n=e,i=r;if("conditional"===e.type||"keyframes"===e.type){var s=getValidRuleInsertionIndex(r,t);if(!1===(i=_insertRule(r,n.toString({children:!1}),s)))return!1;this.refCssRule(e,s,i)}return this.insertRules(n.rules,i),i}var a=e.toString();if(!a)return!1;var o=getValidRuleInsertionIndex(r,t),l=_insertRule(r,a,o);return!1!==l&&(this.hasInsertedRules=!0,this.refCssRule(e,o,l),l)},t.refCssRule=function(e,t,r){e.renderable=r,e.options.parent instanceof StyleSheet&&this.cssRules.splice(t,0,r)},t.deleteRule=function(e){var t=this.element.sheet,r=this.indexOf(e);return-1!==r&&(t.deleteRule(r),this.cssRules.splice(r,1),!0)},t.indexOf=function(e){return this.cssRules.indexOf(e)},t.replaceRule=function(e,t){var r=this.indexOf(e);return-1!==r&&(this.element.sheet.deleteRule(r),this.cssRules.splice(r,1),this.insertRule(t,r))},t.getRules=function(){return this.element.sheet.cssRules},e}(),instanceCounter=0,Jss=function(){function e(e){this.id=instanceCounter++,this.version="10.10.0",this.plugins=new PluginsRegistry,this.options={id:{minify:!1},createGenerateId:createGenerateId,Renderer:isBrowser?DomRenderer:null,plugins:[]},this.generateId=createGenerateId({minify:!1});for(var t=0;t<plugins.length;t++)this.plugins.use(plugins[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId),e.id&&(this.options.id=_extends({},this.options.id,e.id)),(e.createGenerateId||e.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),"Renderer"in e&&(this.options.Renderer=e.Renderer),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var r=t.index;"number"!=typeof r&&(r=0===sheets.index?0:sheets.index+1);var n=new StyleSheet(e,_extends({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:r}));return this.plugins.onProcessSheet(n),n},t.removeStyleSheet=function(e){return e.detach(),sheets.remove(e),this},t.createRule=function(e,t,r){if(void 0===t&&(t={}),void 0===r&&(r={}),"object"==typeof e)return this.createRule(void 0,e,t);var n=_extends({},r,{name:e,jss:this,Renderer:this.options.Renderer});n.generateId||(n.generateId=this.generateId),n.classes||(n.classes={}),n.keyframes||(n.keyframes={});var i=createRule(e,t,n);return i&&this.plugins.onProcessRule(i),i},t.use=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){e.plugins.use(t)})),this},e}(),createJss=function(e){return new Jss(e)},index=createJss(),index$1=index,at$1="@global",atPrefix="@global ",GlobalContainerRule=function(){function e(e,t,r){for(var n in this.type="global",this.at=at$1,this.isProcessed=!1,this.key=e,this.options=r,this.rules=new RuleList(_extends({},r,{parent:this})),t)this.rules.add(n,t[n]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,r){var n=this.rules.add(e,t,r);return n&&this.options.jss.plugins.onProcessRule(n),n},t.replaceRule=function(e,t,r){var n=this.rules.replace(e,t,r);return n&&this.options.jss.plugins.onProcessRule(n),n},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(e){return this.rules.toString(e)},e}(),GlobalPrefixedRule=function(){function e(e,t,r){this.type="global",this.at=at$1,this.isProcessed=!1,this.key=e,this.options=r;var n=e.substr(atPrefix.length);this.rule=r.jss.createRule(n,t,_extends({},r,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),separatorRegExp=/\s*,\s*/g;function addScope(e,t){for(var r=e.split(separatorRegExp),n="",i=0;i<r.length;i++)n+=t+" "+r[i].trim(),r[i+1]&&(n+=", ");return n}function handleNestedGlobalContainerRule(e,t){var r=e.options,n=e.style,i=n?n[at$1]:null;if(i){for(var s in i)t.addRule(s,i[s],_extends({},r,{selector:addScope(s,e.selector)}));delete n[at$1]}}function handlePrefixedGlobalRule(e,t){var r=e.options,n=e.style;for(var i in n)if("@"===i[0]&&i.substr(0,at$1.length)===at$1){var s=addScope(i.substr(at$1.length),e.selector);t.addRule(s,n[i],_extends({},r,{selector:s})),delete n[i]}}function jssGlobal(){return{onCreateRule:function(e,t,r){if(!e)return null;if(e===at$1)return new GlobalContainerRule(e,t,r);if("@"===e[0]&&e.substr(0,atPrefix.length)===atPrefix)return new GlobalPrefixedRule(e,t,r);var n=r.parent;return n&&("global"===n.type||n.options.parent&&"global"===n.options.parent.type)&&(r.scoped=!1),r.selector||!1!==r.scoped||(r.selector=e),null},onProcessRule:function(e,t){"style"===e.type&&t&&(handleNestedGlobalContainerRule(e,t),handlePrefixedGlobalRule(e,t))}}}var uppercasePattern=/[A-Z]/g,msPattern=/^ms-/,cache={};function toHyphenLower(e){return"-"+e.toLowerCase()}function hyphenateStyleName(e){if(cache.hasOwnProperty(e))return cache[e];var t=e.replace(uppercasePattern,toHyphenLower);return cache[e]=msPattern.test(t)?"-"+t:t}function convertCase(e){var t={};for(var r in e){t[0===r.indexOf("--")?r:hyphenateStyleName(r)]=e[r]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(convertCase):t.fallbacks=convertCase(e.fallbacks)),t}function camelCase(){return{onProcessStyle:function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]=convertCase(e[t]);return e}return convertCase(e)},onChangeValue:function(e,t,r){if(0===t.indexOf("--"))return e;var n=hyphenateStyleName(t);return t===n?e:(r.prop(n,e),null)}}}var n={d:(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};n.d(o,{ym:()=>b,EW:()=>h$1,Mx:()=>Q,L3:()=>H,rl:()=>m,NR:()=>u,f1:()=>v$1,IY:()=>E,RZ:()=>d,XY:()=>j,Fk:()=>g,Zh:()=>N,ek:()=>R,MG:()=>z$1,gE:()=>U,tW:()=>B,wr:()=>p});const l=(a={Flags:()=>Ot,Logger:()=>Vt,NumericParameters:()=>$t,OptionParameters:()=>qt,SettingFlag:()=>ts,TextParameters:()=>cs,WebXRController:()=>bs},r={},n.d(r,a),r);var a,r,c;class d{constructor(e,t,r){this.rootDiv=e,this.rootElement=t,this.textElement=r,this.rootElement.appendChild(this.textElement),this.hide(),this.rootDiv.appendChild(this.rootElement)}show(){this.rootElement.classList.remove("hiddenState")}hide(){this.rootElement.classList.add("hiddenState")}}class h$1 extends d{constructor(e,t,r){super(e,t,r),this.onActionCallback=()=>{l.Logger.Info(l.Logger.GetStackTrace(),"Did you forget to set the onAction callback in your overlay?")}}update(e){null==e&&null==e||(this.textElement.innerHTML=e)}onAction(e){this.onActionCallback=e}activate(){this.onActionCallback()}}class m extends h$1{static createRootElement(){const e=document.createElement("div");return e.id="connectOverlay",e.className="clickableState",e}static createContentElement(){const e=document.createElement("div");return e.id="connectButton",e.innerHTML="Click to start",e}constructor(e){super(e,m.createRootElement(),m.createContentElement()),this.rootElement.addEventListener("click",(()=>{this.activate()}))}}class u extends h$1{static createRootElement(){const e=document.createElement("div");return e.id="disconnectOverlay",e.className="clickableState",e}static createContentElement(){const e=document.createElement("div");return e.id="disconnectButton",e.innerHTML="Click To Restart",e}constructor(e){super(e,u.createRootElement(),u.createContentElement()),this.rootElement.addEventListener("click",(()=>{this.activate()}))}}class g extends h$1{static createRootElement(){const e=document.createElement("div");return e.id="playOverlay",e.className="clickableState",e}static createContentElement(){const e=document.createElement("img");return e.id="playButton",e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPEAAAD5CAYAAAD2mNNkAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAASgklEQVR4Xu2dC7BdVX2HqUCCIRASCPjAFIQREBRBBSRYbFOt8lIrFUWRFqXWsT5wbItUqFWs0KqIMPKoYEWpRS06KDjS1BeVFkVQbCw+wCfiAwGhCKWP9PuZtU24uTe59zz22Y/vm/nGkXtz7jlrr9+sdfZea/03Wb169QtxGW62iYi0D8L7NbwYj8EdcdPyIxFpA4T2P/F/8Ua8CI/GhPnXyq+ISJMhrAlxxX9hRuYL8Sh8SPk1EWkqBHXdEFfcg6vw3fhs3Kb8uog0DQI6XYgr8rOvYsJ8OM4v/0xEmkIJ6ob4P8zIfANegCvQMIs0BQK5sRBXJMy/wIzM5+ByXFBeRkQmBUGcbYjX5S5MmM/AA3CL8nIiUjcEcJAQV9yBX8a/wSeiz5hF6obgDRPikGfMCfOX8DTcu7y0iNQBoRs2xBX/g3diwvwm3Kn8CREZJ4RtVCGuqMKcu9kn4xJ09ZfIuCBgow5xyJ3sTLNzAywrwF6J26NhFhk1BGscIV6XhPluvA6Pxx3KnxaRUUCoxh3iioQ5z5n/BY/FJeUtiMgwEKa6QlyRMN+Hn8Hn4ZblrYjIIBCiukMc8p25Ws6ZMD+zvB0RmSsEaBIhnkrew5V4EHrCiMhcKAFqCv+Nl+J+uBC9my2yMQhKk0Jcke/M78Gsy06YH1TerohMhYA0McQVP8Nz8UDcCl2bLTIVgtHkEFd8D8/E/XFrdGQWqSAQbQhxyKOpm/B03Ac9MkgkEIa2hLgiN78S5lPx0bgIvQEm/YUAtC3EFQnzzfgnuDc6zZZ+Qsdva4jX5Sv4atwXHZmlX9DhuxDikC2Qn8dXYUbmReUjinQbOntXQlyRTRafwldgwrxV+agi3YRO3rUQV/wcV+LL8DHoyZzSTejcXQ1xRc7/uhyzl3kv3Lx8dJFuQKfueohDnjFnZP4o/j7m0ZQH4Es3oDP3IcQV2f6YMF+COZjgUeiZ2dJu6MR9CvG63ILvx4zMCfO80iQi7YLO29cQV3wb34spsr4rumBE2gWdtu8hDln99S1MXeYX4M6leUSaDx3WEK8lRdYT5lR/zPlfnswpzYeOaojXJ4cSfB3Pw+fgtug0W5oJndMQT0/uZGeaXZVyfTZuV5pNpDnQMQ3xxsk0O9Ufz8ZDcdvSfCKThw5piGdP2ioF496JT0c3WcjkKR1T5kYWjCTM78DfQheMyOSgAxriwch35lR/vAbPwOXozS+pHzqeIR6Oal12wvx2fBy6yULqgw5niEdDwpyR+VpMkfXsmHIpp4wfOpohHj234RfwFNwDnWbL+KCDGeLxkJH5p3g1vg53K00uMlroXIZ4vGTBSMJ8FeZkzmWl6UVGA53KENfD/ZiyNCmynvO/FpdLIDIcdCZDXC8ZmfOd+d/wJejZXzIcdCJDXD95xpwjdnP+V74zH4Wu/pLBoPMY4smSMN+FKbJ+BBpmmRt0GkPcDBLmu/FjeAi6lFNmB53FEDeHTLPzaCoj80dwBfqMWTYMncQQN5esAPsw7lcul8j60EEMcfPJDbD3YU7l3KxcOpE10CkMcTvIVDvfmc/E3XELtPqjGOKWkhVgp+GemDD7vbnP0AEMcXtJkfU34GNxAToy9xEuvCFuP6vwJMyOqYXl0kpf4KIb4m5QncyZTRapZGGY+wIX2xB3i3vxOswmi13QaXbX4QIb4m6SY3a/iMdh7mYb5q7ChTXE3aXaaLESq7rMW5ZLL12Bi2qI+8E9eDkmzLuhYe4KXExD3B8yMt+Ol+KL0CLrXYCLaIj7R8J8K16CR6PLOdsMF88Q95fsmPoRXozPxdzNdvVX2+CiGWLJza+EOXWZj8Sd0APw2wIXyxBLqPYy34LnY8K8DA1z0+EiGWKZSgJ9I74LU2R9R3Sa3VS4OIZYZqJaynkWpsj6w0u3kSbBhTHEsjHuwxswpVwPw6Wl+0gT4IIYYpkNmWKnr1yPqf54KG5VupFMknJhRGZLwpzVX6n++DZ8GrpjapJwAQyxDELCnB1TqWTx1/gUdGSeBDS8IZZBSZBjzv76PP4VHoSGuU5ocEMsoyBhTsG4VH98Ix6A80s3k3FCQxtiGSVZMPIT/CwmzPuhz5jHCQ1siGUcZClnwvxpPAX3LF1ORg2Na4hlXGSKnQUjCfNn8PX4CNy0dD8ZBTSoIZZxkzBXI/Pn8ATMumzDPApoSEMsdZEw5zvzDzHT7JdjwuzZX8NAAxpimQSZZifMn8Tj8aGlS8pcofEMsUyKjMw5lTOnjHwcc2TQktI1ZbbQaIZYJk3CnE0WGZmvwOeh+5hnC41liKUpVCNzwvwJPBy9+bUxaCRDLE0jYb4fU/0x0+yD8cGly8pUaBxDLE0kQa7CfCfmML8D0SN2p0KjGGJpOglztWgkh/k9CT1it4LGMMTSFhLmLBrJ3exzcJ/SjfsNDWGIpY0k0D/AM/GRpTv3ExrAEEubqVaAnY5LsX93s/nQhli6QLUF8nWYI3bnYT+Wc/JBDbF0heqO9jfwlfhInI/dDjMf0BBLF0mYr8NsskiNqS2wm2Hmgxli6TJ5zpwjg/4Qd8buLRrhQxli6QM5ZjdHBh2H+c7cnUUjfBhDLH0hU+y7cCU+H7OXeV6JQnvhQxhi6RsJc0bmy/BZ+MsbYCUS7YM3b4ilryTM2QL5QUzBuHxnbt80mzdtiEVWr74NL8KUck2R9faMzLxZQyyyhozMWcp5If4uJszNP5yAN2mIRR5IVn/djOfhEdjsw/x4c4ZYZHryjPkmPBsPwYeV2DQL3pghFpmZTLFzZFDCnLrMz8DtsTkbLXgzhlhk4yTM2cu8CrNjKiNzwjz5OlO8CUMsMjcS5qzLfgumyPr2JU6TgTdgiEUGoyqynrrMv42TOTObP2yIRQYn0+ws5bwaU8r1N3HrEq964A8aYpHhSZjvwBSMS5gPwnrWZfOHDLHI6Mgz5hyxm4Jxf4kH4HjDzB8wxCKjJ2HONPuf8c9xHxzPXmZe2BCLjIdMsWMqWfwTnoiPwdGOzLygIRYZPwlzVWPqtbgXjmbBCC9kiEXqI8+Ys8nicnwN7laiODi8iCEWqZeMylmXnTCnYFxO5tyxRHLu8I8NschkSJizLvv7mJH5pbgY57Zjin9giEUmSzUyfw9TZP1Y3LZEdOPwy4ZYpBkkzKn++B38KB6F25Wozgy/ZIhFmkXCnLO/vosfwpwysqhEdn34oSEWaSYJ8y8w0+wP4GG4/oIR/qMhFmk2VZgzzU6Ys2Nq7T5m/o8hFmkHCXO2PybMF+O++CBDLNIuEuSsy8535lvxZEMs0j6qWszZJbXUEIu0i1vwrZhqFZv5nVikPWTqfA5mF9QDD+fjPxhikeaR777xdrwAn1Aiuz780BCLNIvsdMqBAqkNtRw3XBeKXzDEIpMno27Cezdeik/GBSWmG4ZfNMQikyPhzXrpVGXM6R8rcG7lVfkHhlikfhLe7FzKo6KV+Hu45m7zXOEfGmKReske4oT3k3gMblniOBi8gCEWqYeMvD/GK/F43KHEcDh4IUMsMl5yw+pHmLOoX4aDH8UzHbygIRYZD/nem5H3KjwBd8LRV1HkRQ2xyGjJ3eacNZ1iayfhr+P46hnz4oZYZDRk2pzwph7TX+CuOP76xfwRQywyHNlVVIX3VHx8iVc98AcNscjgZJFGypq+GffHwZ71DgN/1BCLzJ2f47/iWzBlTId71jsM/HFDLDI7crf5HrwG34YHY70FxaeDN2GIRTZMwpvjcK7Fd+BTcfLhreDNGGKRmcnIez2+Ew/FhTi3MivjhjdkiEXWJ0fEfhXPwmfi4hKZ5sGbM8Qia8n65lX4LkzlhYeVqDQX3qQhFlnzrPc/8FzMtsBl2Kxp80zwRg2x9J0cxn4epoBZlkjW/6x3GHjDhlj6SJZI5gTJ9+DzMeHdvMSiXfDGDbH0iWpbYMqgJLy7YLtG3qnwAQyx9IVsC7wEX4C74/h2FtUJH8QQS9fJUTg5QfI43APnle7fDfhAhli6So5//Ri+GBPeya1vHid8MEMsXSMH0X0CX4J74cLS3bsJH9AQS1fITavs6f1VeLEdz3qHgQ9piKXtZHNC1jfnELpfTpux++Gt4MMaYmkrmTZ/GV+LCW+3p80zwQc3xNI2skTyBswhdHtic7YFTgIawBBLm7gRT8HH4dbYn2nzTNAIhljaQCrkvwkT3tywGv8pkm2BxjDE0lRyokbOsjoDUyE/N6wM71RoFEMsTSPhvRPfjY/GBei0eSZoHEMsTeJ2/ADug+3cVVQ3NJQhliaQkfcf8SnoqDsXaDBDLJMij4ruxcvwaejIOwg0nCGWusnyyIT3CjwM+7lIY1TQgIZY6iA3qzLyZmdRSn0eic09QbJN0JCGWMZJwpuR9w78Er4Qu7klcFLQoIZYxkXq9OZuc2oWZXNCv5dHjgsa1hDLqKnCm2qB2Zzw0NLdZBzQwIZYRkWmzT/DhPdE3KV0MxknNLQhlmHJ996ENwXHsjkhq6xcHlkXNLYhlkFJeHPDKhvyszkh4W338a9thEY3xDJX8qgoGxMS3tTpfSzOL11K6obGN8QyWxLeLI/MtDmlPvdHp82ThotgiGU2ZOStwrsCXSLZFLgYhlg2xF2Yc6zOxqejCzWaBhfFEMt0pMj2VzB1eg/BJaXLSNPg4hhiqcjd5izUSIX8lPp8Fi4tXUWaChfJEEtIhfwU2b4QU2R7O3RfbxvgQhnifpOD17+JCW9KfS5F7zi3CS6YIe4nOXj9W/h3eAw+vHQJaRtcPEPcL/Ks92a8CI/FXdFpc5vhAhri/vB9/Hv8A3wUukSyC3AhDXH3+Sn+Ax6PqZDvEskuwQU1xN2kOgonJ0im1Gc2J2xRLrt0CS6sIe4W1c6ij2NG3lROmFcut3QRLrAh7g4J75X4R7g3Gt4+wIU2xO0n0+ZP4aswBcdc39wnuOCGuL3kWe/n8DW4Ly4ql1X6BBfeELeTL+AJ+ATcBn3W21e4+Ia4PeSO89fwT/GJuAhdItl36ASGuPlkZ9G38fWYo3Ay8hpeWQOdwRA3lxwBexO+GVPq07Insj50DEPcTLK++e2Yc6wWo995ZXroHIa4WdyKOQpnOWbavGm5VCLTQycxxM0gp0iej0/G3LAyvDI76CyGeHJUx+G8Hw9Ewytzh05jiCdDDqK7HA/Aheh3XhkMOo8hrpe096fxd9D9vDI8pVPJ+LkXP4vPQafMMjroUIZ4fOQ7b9Y3X4U5x8oi2zJ66FiGePRkeWROkfwiHoee3Szjgw5miEdDRt14D+bw9ZfjDqWZRcYHHc0QD091FE6OgP0z9OB1qQ86myEenKxtTngz8r4BHXmlfuh4hnjuJLwp9Zlqgafh7qU5ReqHDmiIZ0+mzVkeeQO+FR9fmlFkctARDfHsSJ3ef8dqZ5GH0EkzoDMa4pnJ3ea0T07TOAezvnlBaTqRZlA6qTyQhDdrm1fhBXgwGl5pJnROQ7yW6jlvwvtefAZuXppKpJmUTitrp80p9Zn1zQ8uTSTSbOisfQ9xps2pkJ/wPhe3K00j0g7otH0N8f34dXwfHo0W2ZZ2QuftY4izPDKnabwIH4Ee/yrthQ7clxBnldUP8BJ8MSa87uuV9kNH7nqIc4ZVwvshfCkuQ8Mr3YEO3dUQZ4nkD/HDmFKfe5SPLNIt6NxdDHHC+xF8BabsiSOvdBc6eJdCfBtehglvimz7rFe6Dx29CyHOQo0r8NWYOr0W2Zb+QIdva4izRDLPeldi6vSm1OfC8rFE+gMdv40hznu+GlMhfz/cEj0OR/oJnb9NIc57vQZPxCehI69ICUbTydnN1+LJmPAuKW9fRAhEk0OcZ73XYw6hOwg9v1lkKgSjqSHO5oRT8TdwKbq+WWQ6CEeTQpw7zlmocTqmTm/Ob7bomMiGICRNCHGmzT/BszClPjPyuspKZDYQlkmH+Mf4t7gct0enzSJzgdBMKsQJ70X4VHTkFRkUwlN3iFM54YN4KG6LHkQnMgyEqK4Q51nvpZjwZuQ1vCKjgDDVEeIr8XBMeL3bLDJKCNW4QpyR9zo8ArdBb1iJjAPCNeoQJ7ypFngszkc3JoiME0I2qhDnWW8Kjv0xujFBpC4I3DAhzgqrHESXUp/Z0/uQ8rIiUhcEb5AQJ7z34TfwJNy5vJyI1A0BnG2IE9yYsiffwTfizuh3XpFJQghnE+J83014v4upkL8r+qhIpAkQxg2FOOHNzzNtPhf3REdekSZRQjqVTJtzguSNeD4eWH5dRJoGAZ0a4rvxm3ghrkCnzSJNhpBWIc7/plpgwpudRZ7dLNIGCOvtJbwX42G4uPxIRNoAoU2d3iNxUflPItIaNtnk/wEGBoMdpECGHAAAAABJRU5ErkJggg==",e.alt="Start Streaming",e}constructor(e){super(e,g.createRootElement(),g.createContentElement()),this.rootElement.addEventListener("click",(()=>{this.activate()}))}}class p extends d{constructor(e,t,r){super(e,t,r)}update(e){null==e&&null==e||(this.textElement.innerHTML=e)}}class E extends p{static createRootElement(){const e=document.createElement("div");return e.id="infoOverlay",e.className="textDisplayState",e}static createContentElement(){const e=document.createElement("div");return e.id="messageOverlayInner",e}constructor(e){super(e,E.createRootElement(),E.createContentElement())}}class v$1 extends p{static createRootElement(){const e=document.createElement("div");return e.id="errorOverlay",e.className="textDisplayState",e}static createContentElement(){const e=document.createElement("div");return e.id="errorOverlayInner",e}constructor(e){super(e,v$1.createRootElement(),v$1.createContentElement())}}class b extends h$1{static createRootElement(){const e=document.createElement("div");return e.id="afkOverlay",e.className="clickableState",e}static createContentElement(){const e=document.createElement("div");return e.id="afkOverlayInner",e.innerHTML='<center>No activity detected<br>Disconnecting in <span id="afkCountDownNumber"></span> seconds<br>Click to continue<br></center>',e}constructor(e){super(e,b.createRootElement(),b.createContentElement()),this.rootElement.addEventListener("click",(()=>{this.activate()}))}updateCountdown(e){this.textElement.innerHTML=`<center>No activity detected<br>Disconnecting in <span id="afkCountDownNumber">${e}</span> seconds<br>Click to continue<br></center>`}}class f{get rootElement(){return this._rootElement}set rootElement(e){e.onclick=()=>this.toggleFullscreen(),this._rootElement=e}constructor(){this.isFullscreen=!1,document.addEventListener("webkitfullscreenchange",(()=>this.onFullscreenChange()),!1),document.addEventListener("mozfullscreenchange",(()=>this.onFullscreenChange()),!1),document.addEventListener("fullscreenchange",(()=>this.onFullscreenChange()),!1),document.addEventListener("MSFullscreenChange",(()=>this.onFullscreenChange()),!1)}toggleFullscreen(){if(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen();else{const e=this.fullscreenElement;if(!e)return;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullscreen?e.mozRequestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitEnterFullscreen&&e.webkitEnterFullscreen()}this.onFullscreenChange()}onFullscreenChange(){this.isFullscreen=document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement&&null!==document.msFullscreenElement||document.fullscreenElement&&null!==document.fullscreenElement}}class y extends f{constructor(e){super(),this.rootElement=e}}class x extends f{constructor(){super();const e=document.createElement("button");e.type="button",e.classList.add("UiTool"),e.id="fullscreen-btn",e.appendChild(this.maximizeIcon),e.appendChild(this.minimizeIcon),e.appendChild(this.tooltipText),this.rootElement=e}get tooltipText(){return this._tooltipText||(this._tooltipText=document.createElement("span"),this._tooltipText.classList.add("tooltiptext"),this._tooltipText.innerHTML="Fullscreen"),this._tooltipText}get maximizeIcon(){if(!this._maximizeIcon){this._maximizeIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._maximizeIcon.setAttributeNS(null,"id","maximizeIcon"),this._maximizeIcon.setAttributeNS(null,"x","0px"),this._maximizeIcon.setAttributeNS(null,"y","0px"),this._maximizeIcon.setAttributeNS(null,"viewBox","0 0 384.97 384.97");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._maximizeIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M384.97,12.03c0-6.713-5.317-12.03-12.03-12.03H264.847c-6.833,0-11.922,5.39-11.934,12.223c0,6.821,5.101,11.838,11.934,11.838h96.062l-0.193,96.519c0,6.833,5.197,12.03,12.03,12.03c6.833-0.012,12.03-5.197,12.03-12.03l0.193-108.369c0-0.036-0.012-0.06-0.012-0.084C384.958,12.09,384.97,12.066,384.97,12.03z");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M120.496,0H12.403c-0.036,0-0.06,0.012-0.096,0.012C12.283,0.012,12.247,0,12.223,0C5.51,0,0.192,5.317,0.192,12.03L0,120.399c0,6.833,5.39,11.934,12.223,11.934c6.821,0,11.838-5.101,11.838-11.934l0.192-96.339h96.242c6.833,0,12.03-5.197,12.03-12.03C132.514,5.197,127.317,0,120.496,0z");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M120.123,360.909H24.061v-96.242c0-6.833-5.197-12.03-12.03-12.03S0,257.833,0,264.667v108.092c0,0.036,0.012,0.06,0.012,0.084c0,0.036-0.012,0.06-0.012,0.096c0,6.713,5.317,12.03,12.03,12.03h108.092c6.833,0,11.922-5.39,11.934-12.223C132.057,365.926,126.956,360.909,120.123,360.909z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M372.747,252.913c-6.833,0-11.85,5.101-11.838,11.934v96.062h-96.242c-6.833,0-12.03,5.197-12.03,12.03s5.197,12.03,12.03,12.03h108.092c0.036,0,0.06-0.012,0.084-0.012c0.036-0.012,0.06,0.012,0.096,0.012c6.713,0,12.03-5.317,12.03-12.03V264.847C384.97,258.014,379.58,252.913,372.747,252.913z"),e.appendChild(t),e.appendChild(r),e.appendChild(n),e.appendChild(i)}return this._maximizeIcon}get minimizeIcon(){if(!this._minimizeIcon){this._minimizeIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._minimizeIcon.setAttributeNS(null,"id","minimizeIcon"),this._minimizeIcon.setAttributeNS(null,"x","0px"),this._minimizeIcon.setAttributeNS(null,"y","0px"),this._minimizeIcon.setAttributeNS(null,"viewBox","0 0 385.331 385.331");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._minimizeIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M264.943,156.665h108.273c6.833,0,11.934-5.39,11.934-12.211c0-6.833-5.101-11.85-11.934-11.838h-96.242V36.181c0-6.833-5.197-12.03-12.03-12.03s-12.03,5.197-12.03,12.03v108.273c0,0.036,0.012,0.06,0.012,0.084c0,0.036-0.012,0.06-0.012,0.096C252.913,151.347,258.23,156.677,264.943,156.665z");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M120.291,24.247c-6.821,0-11.838,5.113-11.838,11.934v96.242H12.03c-6.833,0-12.03,5.197-12.03,12.03c0,6.833,5.197,12.03,12.03,12.03h108.273c0.036,0,0.06-0.012,0.084-0.012c0.036,0,0.06,0.012,0.096,0.012c6.713,0,12.03-5.317,12.03-12.03V36.181C132.514,29.36,127.124,24.259,120.291,24.247z");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M120.387,228.666H12.115c-6.833,0.012-11.934,5.39-11.934,12.223c0,6.833,5.101,11.85,11.934,11.838h96.242v96.423c0,6.833,5.197,12.03,12.03,12.03c6.833,0,12.03-5.197,12.03-12.03V240.877c0-0.036-0.012-0.06-0.012-0.084c0-0.036,0.012-0.06,0.012-0.096C132.418,233.983,127.1,228.666,120.387,228.666z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M373.3,228.666H265.028c-0.036,0-0.06,0.012-0.084,0.012c-0.036,0-0.06-0.012-0.096-0.012c-6.713,0-12.03,5.317-12.03,12.03v108.273c0,6.833,5.39,11.922,12.223,11.934c6.821,0.012,11.838-5.101,11.838-11.922v-96.242H373.3c6.833,0,12.03-5.197,12.03-12.03S380.134,228.678,373.3,228.666z"),e.appendChild(t),e.appendChild(r),e.appendChild(n),e.appendChild(i)}return this._minimizeIcon}onFullscreenChange(){super.onFullscreenChange();const e=this.minimizeIcon,t=this.maximizeIcon;this.isFullscreen?(e.style.display="inline",e.style.transform="translate(0, 0)",t.style.display="none"):(e.style.display="none",t.style.display="inline",t.style.transform="translate(0, 0)")}}class C{get rootElement(){return this._rootElement||(this._rootElement=document.createElement("button"),this._rootElement.type="button",this._rootElement.classList.add("UiTool"),this._rootElement.id="settingsBtn",this._rootElement.appendChild(this.settingsIcon),this._rootElement.appendChild(this.tooltipText)),this._rootElement}get tooltipText(){return this._tooltipText||(this._tooltipText=document.createElement("span"),this._tooltipText.classList.add("tooltiptext"),this._tooltipText.innerHTML="Settings"),this._tooltipText}get settingsIcon(){if(!this._settingsIcon){this._settingsIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._settingsIcon.setAttributeNS(null,"id","settingsIcon"),this._settingsIcon.setAttributeNS(null,"x","0px"),this._settingsIcon.setAttributeNS(null,"y","0px"),this._settingsIcon.setAttributeNS(null,"viewBox","0 0 478.703 478.703");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._settingsIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M454.2,189.101l-33.6-5.7c-3.5-11.3-8-22.2-13.5-32.6l19.8-27.7c8.4-11.8,7.1-27.9-3.2-38.1l-29.8-29.8\t\t\tc-5.6-5.6-13-8.7-20.9-8.7c-6.2,0-12.1,1.9-17.1,5.5l-27.8,19.8c-10.8-5.7-22.1-10.4-33.8-13.9l-5.6-33.2\t\t\tc-2.4-14.3-14.7-24.7-29.2-24.7h-42.1c-14.5,0-26.8,10.4-29.2,24.7l-5.8,34c-11.2,3.5-22.1,8.1-32.5,13.7l-27.5-19.8\t\t\tc-5-3.6-11-5.5-17.2-5.5c-7.9,0-15.4,3.1-20.9,8.7l-29.9,29.8c-10.2,10.2-11.6,26.3-3.2,38.1l20,28.1\t\t\tc-5.5,10.5-9.9,21.4-13.3,32.7l-33.2,5.6c-14.3,2.4-24.7,14.7-24.7,29.2v42.1c0,14.5,10.4,26.8,24.7,29.2l34,5.8\t\t\tc3.5,11.2,8.1,22.1,13.7,32.5l-19.7,27.4c-8.4,11.8-7.1,27.9,3.2,38.1l29.8,29.8c5.6,5.6,13,8.7,20.9,8.7c6.2,0,12.1-1.9,17.1-5.5\t\t\tl28.1-20c10.1,5.3,20.7,9.6,31.6,13l5.6,33.6c2.4,14.3,14.7,24.7,29.2,24.7h42.2c14.5,0,26.8-10.4,29.2-24.7l5.7-33.6\t\t\tc11.3-3.5,22.2-8,32.6-13.5l27.7,19.8c5,3.6,11,5.5,17.2,5.5l0,0c7.9,0,15.3-3.1,20.9-8.7l29.8-29.8c10.2-10.2,11.6-26.3,3.2-38.1\t\t\tl-19.8-27.8c5.5-10.5,10.1-21.4,13.5-32.6l33.6-5.6c14.3-2.4,24.7-14.7,24.7-29.2v-42.1\t\t\tC478.9,203.801,468.5,191.501,454.2,189.101z M451.9,260.401c0,1.3-0.9,2.4-2.2,2.6l-42,7c-5.3,0.9-9.5,4.8-10.8,9.9\t\t\tc-3.8,14.7-9.6,28.8-17.4,41.9c-2.7,4.6-2.5,10.3,0.6,14.7l24.7,34.8c0.7,1,0.6,2.5-0.3,3.4l-29.8,29.8c-0.7,0.7-1.4,0.8-1.9,0.8\t\t\tc-0.6,0-1.1-0.2-1.5-0.5l-34.7-24.7c-4.3-3.1-10.1-3.3-14.7-0.6c-13.1,7.8-27.2,13.6-41.9,17.4c-5.2,1.3-9.1,5.6-9.9,10.8l-7.1,42\t\t\tc-0.2,1.3-1.3,2.2-2.6,2.2h-42.1c-1.3,0-2.4-0.9-2.6-2.2l-7-42c-0.9-5.3-4.8-9.5-9.9-10.8c-14.3-3.7-28.1-9.4-41-16.8\t\t\tc-2.1-1.2-4.5-1.8-6.8-1.8c-2.7,0-5.5,0.8-7.8,2.5l-35,24.9c-0.5,0.3-1,0.5-1.5,0.5c-0.4,0-1.2-0.1-1.9-0.8l-29.8-29.8\t\t\tc-0.9-0.9-1-2.3-0.3-3.4l24.6-34.5c3.1-4.4,3.3-10.2,0.6-14.8c-7.8-13-13.8-27.1-17.6-41.8c-1.4-5.1-5.6-9-10.8-9.9l-42.3-7.2\t\t\tc-1.3-0.2-2.2-1.3-2.2-2.6v-42.1c0-1.3,0.9-2.4,2.2-2.6l41.7-7c5.3-0.9,9.6-4.8,10.9-10c3.7-14.7,9.4-28.9,17.1-42\t\t\tc2.7-4.6,2.4-10.3-0.7-14.6l-24.9-35c-0.7-1-0.6-2.5,0.3-3.4l29.8-29.8c0.7-0.7,1.4-0.8,1.9-0.8c0.6,0,1.1,0.2,1.5,0.5l34.5,24.6\t\t\tc4.4,3.1,10.2,3.3,14.8,0.6c13-7.8,27.1-13.8,41.8-17.6c5.1-1.4,9-5.6,9.9-10.8l7.2-42.3c0.2-1.3,1.3-2.2,2.6-2.2h42.1\t\t\tc1.3,0,2.4,0.9,2.6,2.2l7,41.7c0.9,5.3,4.8,9.6,10,10.9c15.1,3.8,29.5,9.7,42.9,17.6c4.6,2.7,10.3,2.5,14.7-0.6l34.5-24.8\t\t\tc0.5-0.3,1-0.5,1.5-0.5c0.4,0,1.2,0.1,1.9,0.8l29.8,29.8c0.9,0.9,1,2.3,0.3,3.4l-24.7,34.7c-3.1,4.3-3.3,10.1-0.6,14.7\t\t\tc7.8,13.1,13.6,27.2,17.4,41.9c1.3,5.2,5.6,9.1,10.8,9.9l42,7.1c1.3,0.2,2.2,1.3,2.2,2.6v42.1H451.9z");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M239.4,136.001c-57,0-103.3,46.3-103.3,103.3s46.3,103.3,103.3,103.3s103.3-46.3,103.3-103.3S296.4,136.001,239.4,136.001z M239.4,315.601c-42.1,0-76.3-34.2-76.3-76.3s34.2-76.3,76.3-76.3s76.3,34.2,76.3,76.3S281.5,315.601,239.4,315.601z"),e.appendChild(t),e.appendChild(r)}return this._settingsIcon}}class S{get rootElement(){return this._rootElement||(this._rootElement=document.createElement("button"),this._rootElement.type="button",this._rootElement.classList.add("UiTool"),this._rootElement.id="statsBtn",this._rootElement.appendChild(this.statsIcon),this._rootElement.appendChild(this.tooltipText)),this._rootElement}get tooltipText(){return this._tooltipText||(this._tooltipText=document.createElement("span"),this._tooltipText.classList.add("tooltiptext"),this._tooltipText.innerHTML="Information"),this._tooltipText}get statsIcon(){if(!this._statsIcon){this._statsIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._statsIcon.setAttributeNS(null,"id","statsIcon"),this._statsIcon.setAttributeNS(null,"x","0px"),this._statsIcon.setAttributeNS(null,"y","0px"),this._statsIcon.setAttributeNS(null,"viewBox","0 0 330 330");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._statsIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M165,0.008C74.019,0.008,0,74.024,0,164.999c0,90.977,74.019,164.992,165,164.992s165-74.015,165-164.992C330,74.024,255.981,0.008,165,0.008z M165,299.992c-74.439,0-135-60.557-135-134.992S90.561,30.008,165,30.008s135,60.557,135,134.991C300,239.436,239.439,299.992,165,299.992z");const r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M165,130.008c-8.284,0-15,6.716-15,15v99.983c0,8.284,6.716,15,15,15s15-6.716,15-15v-99.983C180,136.725,173.284,130.008,165,130.008z");const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M165,70.011c-3.95,0-7.811,1.6-10.61,4.39c-2.79,2.79-4.39,6.66-4.39,10.61s1.6,7.81,4.39,10.61c2.79,2.79,6.66,4.39,10.61,4.39s7.81-1.6,10.609-4.39c2.79-2.8,4.391-6.66,4.391-10.61s-1.601-7.82-4.391-10.61C172.81,71.61,168.95,70.011,165,70.011z"),e.appendChild(t),e.appendChild(r),e.appendChild(n)}return this._statsIcon}}class w$1{get rootElement(){return this._rootElement||(this._rootElement=document.createElement("button"),this._rootElement.type="button",this._rootElement.classList.add("UiTool"),this._rootElement.id="xrBtn",this._rootElement.appendChild(this.xrIcon),this._rootElement.appendChild(this.tooltipText)),this._rootElement}get tooltipText(){return this._tooltipText||(this._tooltipText=document.createElement("span"),this._tooltipText.classList.add("tooltiptext"),this._tooltipText.innerHTML="XR"),this._tooltipText}get xrIcon(){if(!this._xrIcon){this._xrIcon=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._xrIcon.setAttributeNS(null,"id","xrIcon"),this._xrIcon.setAttributeNS(null,"x","0px"),this._xrIcon.setAttributeNS(null,"y","0px"),this._xrIcon.setAttributeNS(null,"viewBox","0 0 100 100");const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.classList.add("svgIcon"),this._xrIcon.appendChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"d","M29 41c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zm42-14c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zm12-31H17c-6.6 0-12 5.4-12 12v28c0 6.6 5.4 12 12 12h14.5c3.5 0 6.8-1.5 9-4.1l3.5-4c1.5-1.7 3.7-2.7 6-2.7s4.5 1 6 2.7l3.5 4c2.3 2.6 5.6 4.1 9 4.1H83c6.6 0 12-5.4 12-12V36c0-6.6-5.4-12-12-12zm8 40c0 4.4-3.6 8-8 8H68.5c-2.3 0-4.5-1-6-2.7l-3.5-4c-2.3-2.6-5.6-4.1-9-4.1-3.5 0-6.8 1.5-9 4.1l-3.5 4C36 71 33.8 72 31.5 72H17c-4.4 0-8-3.6-8-8V36c0-4.4 3.6-8 8-8h66c4.4 0 8 3.6 8 8v28z"),e.appendChild(t)}return this._xrIcon}}function T(e){return!e||!!e&&e.isEnabled}function _(e){return null==e||e.creationMode===c.CreateDefaultElement}!function(e){e[e.CreateDefaultElement=0]="CreateDefaultElement",e[e.UseCustomElement=1]="UseCustomElement",e[e.Disable=2]="Disable"}(c||(c={}));class L{constructor(e){e&&!_(e.statsButtonType)||(this.statsIcon=new S),e&&!_(e.fullscreenButtonType)||(this.settingsIcon=new C),e&&!_(e.settingsButtonType)||(this.fullscreenIcon=new x),e&&!_(e.xrIconType)||(this.xrIcon=new w$1)}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div"),this._rootElement.id="controls",this.fullscreenIcon&&this._rootElement.appendChild(this.fullscreenIcon.rootElement),this.settingsIcon&&this._rootElement.appendChild(this.settingsIcon.rootElement),this.statsIcon&&this._rootElement.appendChild(this.statsIcon.rootElement),this.xrIcon&&l.WebXRController.isSessionSupported("immersive-vr").then((e=>{e&&this._rootElement.appendChild(this.xrIcon.rootElement)}))),this._rootElement}}class I{constructor(e,t){this._label=e,this._buttonText=t}addOnClickListener(e){this.button.addEventListener("click",e)}get button(){return this._button||(this._button=document.createElement("input"),this._button.type="button",this._button.value=this._buttonText,this._button.classList.add("overlay-button"),this._button.classList.add("btn-flat")),this._button}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.classList.add("setting");const e=document.createElement("div");e.innerText=this._label,this._rootElement.appendChild(e);const t=document.createElement("label");t.classList.add("btn-overlay"),this._rootElement.appendChild(t),t.appendChild(this.button)}return this._rootElement}}class k{constructor(){this._rootElement=null}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id="settings-panel",this._rootElement.classList.add("panel-wrap");const e=document.createElement("div");e.classList.add("panel"),this._rootElement.appendChild(e);const t=document.createElement("div");t.id="settingsHeading",t.textContent="Settings",e.appendChild(t),e.appendChild(this.settingsCloseButton),e.appendChild(this.settingsContentElement)}return this._rootElement}get settingsContentElement(){return this._settingsContentElement||(this._settingsContentElement=document.createElement("div"),this._settingsContentElement.id="settingsContent"),this._settingsContentElement}get settingsCloseButton(){return this._settingsCloseButton||(this._settingsCloseButton=document.createElement("div"),this._settingsCloseButton.id="settingsClose"),this._settingsCloseButton}show(){this.rootElement.classList.contains("panel-wrap-visible")||this.rootElement.classList.add("panel-wrap-visible")}toggleVisibility(){this.rootElement.classList.toggle("panel-wrap-visible")}hide(){this.rootElement.classList.contains("panel-wrap-visible")&&this.rootElement.classList.remove("panel-wrap-visible")}}class F{get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("section"),this._rootElement.classList.add("settingsContainer");const e=document.createElement("div");e.id="latencyTestHeader",e.classList.add("settings-text"),e.classList.add("settingsHeader"),this._rootElement.appendChild(e);const t=document.createElement("div");t.innerHTML="Latency Test",e.appendChild(t),e.appendChild(this.latencyTestButton);const r=document.createElement("div");r.id="latencyTestContainer",r.classList.add("d-none"),this._rootElement.appendChild(r),r.appendChild(this.latencyTestResultsElement)}return this._rootElement}get latencyTestResultsElement(){return this._latencyTestResultsElement||(this._latencyTestResultsElement=document.createElement("div"),this._latencyTestResultsElement.id="latencyStatsResults",this._latencyTestResultsElement.classList.add("StatsResult")),this._latencyTestResultsElement}get latencyTestButton(){return this._latencyTestButton||(this._latencyTestButton=document.createElement("input"),this._latencyTestButton.type="button",this._latencyTestButton.value="Run Test",this._latencyTestButton.id="btn-start-latency-test",this._latencyTestButton.classList.add("streamTools-button"),this._latencyTestButton.classList.add("btn-flat")),this._latencyTestButton}handleTestResult(e){l.Logger.Log(l.Logger.GetStackTrace(),e.toString(),6);let t="";t+="<div>Net latency RTT (ms): "+e.networkLatency+"</div>",t+="<div>UE Encode (ms): "+e.EncodeMs+"</div>",t+="<div>UE Capture (ms): "+e.CaptureToSendMs+"</div>",t+="<div>Browser send latency (ms): "+e.browserSendLatency+"</div>",t+=e.frameDisplayDeltaTimeMs&&e.browserReceiptTimeMs?"<div>Browser receive latency (ms): "+e.frameDisplayDeltaTimeMs+"</div>":"",t+="<div>Total latency (excluding browser) (ms): "+e.latencyExcludingDecode+"</div>",t+=e.endToEndLatency?"<div>Total latency (ms): "+e.endToEndLatency+"</div>":"",this.latencyTestResultsElement.innerHTML=t}}class P{static formatBytes(e,t){if(0===e)return"0";const r=t<0?0:t,n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"][n]}}class A{}class O{constructor(){this.statsMap=new Map,this.latencyTest=new F}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id="stats-panel",this._rootElement.classList.add("panel-wrap");const e=document.createElement("div");e.classList.add("panel"),this._rootElement.appendChild(e);const t=document.createElement("div");t.id="statsHeading",t.textContent="Information",e.appendChild(t),e.appendChild(this.statsCloseButton),e.appendChild(this.statsContentElement)}return this._rootElement}get statsContentElement(){if(!this._statsContentElement){this._statsContentElement=document.createElement("div"),this._statsContentElement.id="statsContent";const e=document.createElement("div");e.id="streamToolsStats",e.classList.add("container");const t=document.createElement("div");t.id="ControlStats",t.classList.add("row");const r=document.createElement("section");r.id="statistics",r.classList.add("settingsContainer");const n=document.createElement("div");n.id="statisticsHeader",n.classList.add("settings-text"),n.classList.add("settingsHeader");const i=document.createElement("div");i.innerHTML="Session Stats",this._statsContentElement.appendChild(e),e.appendChild(t),t.appendChild(r),r.appendChild(n),n.appendChild(i),r.appendChild(this.statisticsContainer),t.appendChild(this.latencyTest.rootElement)}return this._statsContentElement}get statisticsContainer(){return this._statisticsContainer||(this._statisticsContainer=document.createElement("div"),this._statisticsContainer.id="statisticsContainer",this._statisticsContainer.classList.add("d-none"),this._statisticsContainer.appendChild(this.statsResult)),this._statisticsContainer}get statsResult(){return this._statsResult||(this._statsResult=document.createElement("div"),this._statsResult.id="statisticsResult",this._statsResult.classList.add("StatsResult")),this._statsResult}get statsCloseButton(){return this._statsCloseButton||(this._statsCloseButton=document.createElement("div"),this._statsCloseButton.id="statsClose"),this._statsCloseButton}show(){this.rootElement.classList.contains("panel-wrap-visible")||this.rootElement.classList.add("panel-wrap-visible")}toggleVisibility(){this.rootElement.classList.toggle("panel-wrap-visible")}hide(){this.rootElement.classList.contains("panel-wrap-visible")&&this.rootElement.classList.remove("panel-wrap-visible")}handleStats(e){var t,r,n,i,s;const a=new Intl.NumberFormat(window.navigator.language,{maximumFractionDigits:0}),o=P.formatBytes(e.inboundVideoStats.bytesReceived,2);this.addOrUpdateStat("InboundDataStat","Received",o);const c=Object.prototype.hasOwnProperty.call(e.inboundVideoStats,"packetsLost")?a.format(e.inboundVideoStats.packetsLost):"Chrome only";this.addOrUpdateStat("PacketsLostStat","Packets Lost",c),e.inboundVideoStats.bitrate&&this.addOrUpdateStat("VideoBitrateStat","Video Bitrate (kbps)",e.inboundVideoStats.bitrate.toString()),e.inboundAudioStats.bitrate&&this.addOrUpdateStat("AudioBitrateStat","Audio Bitrate (kbps)",e.inboundAudioStats.bitrate.toString());const h=Object.prototype.hasOwnProperty.call(e.inboundVideoStats,"frameWidth")&&e.inboundVideoStats.frameWidth&&Object.prototype.hasOwnProperty.call(e.inboundVideoStats,"frameHeight")&&e.inboundVideoStats.frameHeight?e.inboundVideoStats.frameWidth+"x"+e.inboundVideoStats.frameHeight:"Chrome only";this.addOrUpdateStat("VideoResStat","Video resolution",h);const d=Object.prototype.hasOwnProperty.call(e.inboundVideoStats,"framesDecoded")?a.format(e.inboundVideoStats.framesDecoded):"Chrome only";this.addOrUpdateStat("FramesDecodedStat","Frames Decoded",d),e.inboundVideoStats.framesPerSecond&&this.addOrUpdateStat("FramerateStat","Framerate",e.inboundVideoStats.framesPerSecond.toString()),this.addOrUpdateStat("FramesDroppedStat","Frames dropped",null===(t=e.inboundVideoStats.framesDropped)||void 0===t?void 0:t.toString()),e.inboundVideoStats.codecId&&this.addOrUpdateStat("VideoCodecStat","Video codec",null!==(n=null===(r=e.codecs.get(e.inboundVideoStats.codecId))||void 0===r?void 0:r.split(" ")[0])&&void 0!==n?n:""),e.inboundAudioStats.codecId&&this.addOrUpdateStat("AudioCodecStat","Audio codec",null!==(s=null===(i=e.codecs.get(e.inboundAudioStats.codecId))||void 0===i?void 0:i.split(" ")[0])&&void 0!==s?s:"");const u=Object.prototype.hasOwnProperty.call(e.candidatePair,"currentRoundTripTime")&&e.isNumber(e.candidatePair.currentRoundTripTime)?a.format(1e3*e.candidatePair.currentRoundTripTime):"Can't calculate";this.addOrUpdateStat("RTTStat","Net RTT (ms)",u),this.addOrUpdateStat("DurationStat","Duration",e.sessionStats.runTime),this.addOrUpdateStat("ControlsInputStat","Controls stream input",e.sessionStats.controlsStreamInput),this.addOrUpdateStat("QPStat","Video quantization parameter",e.sessionStats.videoEncoderAvgQP.toString()),l.Logger.Log(l.Logger.GetStackTrace(),`--------- Stats ---------\n ${e}\n------------------------`,6)}addOrUpdateStat(e,t,r){const n=`${t}: ${r}`;if(this.statsMap.has(e)){const t=this.statsMap.get(e);void 0!==t&&(t.element.innerHTML=n)}else{const i=new A;i.id=e,i.stat=r,i.title=t,i.element=document.createElement("div"),i.element.innerHTML=n,this.statsResult.appendChild(i.element),this.statsMap.set(e,i)}}}class M{constructor(){this.videoEncoderAvgQP=-1,this.statsText="",this.color="",this.orangeQP=26,this.redQP=35}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div"),this._rootElement.id="connection",this._rootElement.classList.add("UiTool"),this._rootElement.appendChild(this.qualityStatus),this._rootElement.appendChild(this.qualityText),this.updateQpTooltip(-1)),this._rootElement}get qualityText(){return this._qualityText||(this._qualityText=document.createElement("span"),this._qualityText.id="qualityText",this._qualityText.classList.add("tooltiptext")),this._qualityText}get qualityStatus(){return this._qualityStatus||(this._qualityStatus=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._qualityStatus.setAttributeNS(null,"id","connectionStrength"),this._qualityStatus.setAttributeNS(null,"x","0px"),this._qualityStatus.setAttributeNS(null,"y","0px"),this._qualityStatus.setAttributeNS(null,"viewBox","0 0 494.45 494.45"),this.qualityStatus.appendChild(this.dot),this.qualityStatus.appendChild(this.middle),this.qualityStatus.appendChild(this.outer),this.qualityStatus.appendChild(this.inner)),this._qualityStatus}get dot(){return this._dot||(this._dot=document.createElementNS("http://www.w3.org/2000/svg","circle"),this._dot.setAttributeNS(null,"id","dot"),this._dot.setAttributeNS(null,"cx","247.125"),this._dot.setAttributeNS(null,"cy","398.925"),this._dot.setAttributeNS(null,"r","35.3")),this._dot}get outer(){return this._outer||(this._outer=document.createElementNS("http://www.w3.org/2000/svg","path"),this._outer.setAttributeNS(null,"id","outer"),this._outer.setAttributeNS(null,"d","M467.925,204.625c-6.8,0-13.5-2.6-18.7-7.8c-111.5-111.4-292.7-111.4-404.1,0c-10.3,10.3-27.1,10.3-37.4,0s-10.3-27.1,0-37.4c64-64,149-99.2,239.5-99.2s175.5,35.2,239.5,99.2c10.3,10.3,10.3,27.1,0,37.4C481.425,202.025,474.625,204.625,467.925,204.625z")),this._outer}get middle(){return this._middle||(this._middle=document.createElementNS("http://www.w3.org/2000/svg","path"),this._middle.setAttributeNS(null,"id","middle"),this._middle.setAttributeNS(null,"d","M395.225,277.325c-6.8,0-13.5-2.6-18.7-7.8c-71.4-71.3-187.4-71.3-258.8,0c-10.3,10.3-27.1,10.3-37.4,0s-10.3-27.1,0-37.4c92-92,241.6-92,333.6,0c10.3,10.3,10.3,27.1,0,37.4C408.725,274.725,401.925,277.325,395.225,277.325z")),this._middle}get inner(){return this._inner||(this._inner=document.createElementNS("http://www.w3.org/2000/svg","path"),this._inner.setAttributeNS(null,"id","inner"),this._inner.setAttributeNS(null,"d","M323.625,348.825c-6.8,0-13.5-2.6-18.7-7.8c-15.4-15.4-36-23.9-57.8-23.9s-42.4,8.5-57.8,23.9c-10.3,10.3-27.1,10.3-37.4,0c-10.3-10.3-10.3-27.1,0-37.4c25.4-25.4,59.2-39.4,95.2-39.4s69.8,14,95.2,39.5c10.3,10.3,10.3,27.1,0,37.4C337.225,346.225,330.425,348.825,323.625,348.825z")),this._inner}blinkVideoQualityStatus(e){let t=e,r=1;const n=setInterval((()=>{r-=.1,this.qualityText.style.opacity=String(Math.abs(2*(r-.5))),r<=.1&&(0==--t?clearInterval(n):r=1)}),100/e)}updateQpTooltip(e){this.videoEncoderAvgQP=e,e>this.redQP?(this.color="red",this.blinkVideoQualityStatus(2),this.statsText=`<div style="color: ${this.color}">Poor encoding quality</div>`,this.outer.setAttributeNS(null,"fill","#3c3b40"),this.middle.setAttributeNS(null,"fill","#3c3b40"),this.inner.setAttributeNS(null,"fill",this.color),this.dot.setAttributeNS(null,"fill",this.color)):e>this.orangeQP?(this.color="orange",this.blinkVideoQualityStatus(1),this.statsText=`<div style="color: ${this.color}">Blocky encoding quality</div>`,this.outer.setAttributeNS(null,"fill","#3c3b40"),this.middle.setAttributeNS(null,"fill",this.color),this.inner.setAttributeNS(null,"fill",this.color),this.dot.setAttributeNS(null,"fill",this.color)):e<=0?(this.color="#b0b0b0",this.outer.setAttributeNS(null,"fill","#3c3b40"),this.middle.setAttributeNS(null,"fill","#3c3b40"),this.inner.setAttributeNS(null,"fill","#3c3b40"),this.dot.setAttributeNS(null,"fill","#3c3b40"),this.statsText=`<div style="color: ${this.color}">Not connected</div>`):(this.color="lime",this.qualityStatus.style.opacity="1",this.statsText=`<div style="color: ${this.color}">Clear encoding quality</div>`,this.outer.setAttributeNS(null,"fill",this.color),this.middle.setAttributeNS(null,"fill",this.color),this.inner.setAttributeNS(null,"fill",this.color),this.dot.setAttributeNS(null,"fill",this.color)),this.qualityText.innerHTML=this.statsText}}class N{constructor(e){this._setting=e}get setting(){return this._setting}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div")),this._rootElement}}class R extends N{constructor(e){super(e),this.label=e.label,this.flag=e.flag}get setting(){return this._setting}get settingsTextElem(){return this._settingsTextElem||(this._settingsTextElem=document.createElement("div"),this._settingsTextElem.innerText=this.setting._label,this._settingsTextElem.title=this.setting.description),this._settingsTextElem}get checkbox(){return this._checkbox||(this._checkbox=document.createElement("input"),this._checkbox.type="checkbox"),this._checkbox}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id=this.setting.id,this._rootElement.classList.add("setting"),this._rootElement.appendChild(this.settingsTextElem);const e=document.createElement("label");e.classList.add("tgl-switch"),this._rootElement.appendChild(e),this.checkbox.title=this.setting.description,this.checkbox.classList.add("tgl"),this.checkbox.classList.add("tgl-flat");const t=document.createElement("div");t.classList.add("tgl-slider"),e.appendChild(this.checkbox),e.appendChild(t),this.checkbox.addEventListener("change",(()=>{this.setting.flag!==this.checkbox.checked&&(this.setting.flag=this.checkbox.checked,this.setting.updateURLParams())}))}return this._rootElement}set flag(e){this.checkbox.checked=e}get flag(){return this.checkbox.checked}set label(e){this.settingsTextElem.innerText=e}get label(){return this.settingsTextElem.innerText}}class z$1 extends N{constructor(e){super(e),this.label=this.setting.label,this.number=this.setting.number}get setting(){return this._setting}get settingsTextElem(){return this._settingsTextElem||(this._settingsTextElem=document.createElement("label"),this._settingsTextElem.innerText=this.setting.label,this._settingsTextElem.title=this.setting.description),this._settingsTextElem}get spinner(){return this._spinner||(this._spinner=document.createElement("input"),this._spinner.type="number",this._spinner.min=this.setting.min.toString(),this._spinner.max=this.setting.max.toString(),this._spinner.value=this.setting.number.toString(),this._spinner.title=this.setting.description,this._spinner.classList.add("form-control")),this._spinner}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div"),this._rootElement.classList.add("setting"),this._rootElement.classList.add("form-group"),this._rootElement.appendChild(this.settingsTextElem),this._rootElement.appendChild(this.spinner),this.spinner.onchange=e=>{const t=e.target,r=Number.parseInt(t.value);Number.isNaN(r)?(l.Logger.Warning(l.Logger.GetStackTrace(),`Could not parse value change into a valid number - value was ${t.value}, resetting value to ${this.setting.min}`),this.setting.number!==this.setting.min&&(this.setting.number=this.setting.min)):this.setting.number!==r&&(this.setting.number=r,this.setting.updateURLParams())}),this._rootElement}set number(e){this.spinner.value=this.setting.clamp(e).toString()}get number(){return+this.spinner.value}set label(e){this.settingsTextElem.innerText=e}get label(){return this.settingsTextElem.innerText}}class B extends N{constructor(e){super(e),this.label=this.setting.label,this.text=this.setting.text}get setting(){return this._setting}get settingsTextElem(){return this._settingsTextElem||(this._settingsTextElem=document.createElement("div"),this._settingsTextElem.innerText=this.setting.label,this._settingsTextElem.title=this.setting.description),this._settingsTextElem}get textbox(){return this._textbox||(this._textbox=document.createElement("input"),this._textbox.classList.add("form-control"),this._textbox.type="textbox"),this._textbox}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id=this.setting.id,this._rootElement.classList.add("setting"),this._rootElement.appendChild(this.settingsTextElem);const e=document.createElement("label");this._rootElement.appendChild(e),this.textbox.title=this.setting.description,e.appendChild(this.textbox),this.textbox.addEventListener("input",(()=>{this.setting.text!==this.textbox.value&&(this.setting.text=this.textbox.value,this.setting.updateURLParams())}))}return this._rootElement}set text(e){this.textbox.value=e}get text(){return this.textbox.value}set label(e){this.settingsTextElem.innerText=e}get label(){return this.settingsTextElem.innerText}}class U extends N{constructor(e){super(e),this.label=this.setting.label,this.options=this.setting.options,this.selected=this.setting.selected}get setting(){return this._setting}get selector(){return this._selector||(this._selector=document.createElement("select"),this._selector.classList.add("form-control"),this._selector.classList.add("settings-option")),this._selector}get settingsTextElem(){return this._settingsTextElem||(this._settingsTextElem=document.createElement("div"),this._settingsTextElem.innerText=this.setting.label,this._settingsTextElem.title=this.setting.description),this._settingsTextElem}set label(e){this.settingsTextElem.innerText=e}get label(){return this.settingsTextElem.innerText}get rootElement(){if(!this._rootElement){this._rootElement=document.createElement("div"),this._rootElement.id=this.setting.id,this._rootElement.classList.add("setting"),this._rootElement.classList.add("form-group"),this._rootElement.appendChild(this.settingsTextElem);const e=document.createElement("label");this._rootElement.appendChild(e),this.selector.title=this.setting.description,e.appendChild(this.selector),this.selector.onchange=()=>{this.setting.selected!==this.selector.value&&(this.setting.selected=this.selector.value,this.setting.updateURLParams())}}return this._rootElement}set options(e){for(let e=this.selector.options.length-1;e>=0;e--)this.selector.remove(e);e.forEach((e=>{const t=document.createElement("option");t.value=e,t.innerHTML=e,this.selector.appendChild(t)}))}get options(){return[...this.selector.options].map((e=>e.value))}set selected(e){const t=this.options.filter((t=>-1!==t.indexOf(e)));t.length&&(this.selector.value=t[0])}get selected(){return this.selector.value}disable(){this.selector.disabled=!0}enable(){this.selector.disabled=!1}}const D="LightMode";class H{constructor(e){this.customFlags=new Map,this.flagsUi=new Map,this.numericParametersUi=new Map,this.textParametersUi=new Map,this.optionParametersUi=new Map,this.createCustomUISettings(e.useUrlParams),this.registerSettingsUIComponents(e)}createCustomUISettings(e){this.customFlags.set(D,new l.SettingFlag(D,"Color Scheme: Dark Mode","Page styling will be either light or dark",!1,e,((e,t)=>{t.label=`Color Scheme: ${e?"Light":"Dark"} Mode`})))}registerSettingsUIComponents(e){for(const t of e.getFlags())this.flagsUi.set(t.id,new R(t));for(const e of Array.from(this.customFlags.values()))this.flagsUi.set(e.id,new R(e));for(const t of e.getTextSettings())this.textParametersUi.set(t.id,new B(t));for(const t of e.getNumericSettings())this.numericParametersUi.set(t.id,new z$1(t));for(const t of e.getOptionSettings())this.optionParametersUi.set(t.id,new U(t))}buildSectionWithHeading(e,t){const r=document.createElement("section");r.classList.add("settingsContainer");const n=document.createElement("div");return n.classList.add("settingsHeader"),n.classList.add("settings-text"),n.textContent=t,r.appendChild(n),e.appendChild(r),r}populateSettingsElement(e){const t=this.buildSectionWithHeading(e,"Pixel Streaming");this.addSettingText(t,this.textParametersUi.get(l.TextParameters.SignallingServerUrl)),this.addSettingOption(t,this.optionParametersUi.get(l.OptionParameters.StreamerId)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.AutoConnect)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.AutoPlayVideo)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.BrowserSendOffer)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.UseMic)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.StartVideoMuted)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.PreferSFU)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.IsQualityController)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.ForceMonoAudio)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.ForceTURN)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.SuppressBrowserKeys)),this.addSettingFlag(t,this.flagsUi.get(l.Flags.AFKDetection)),this.addSettingNumeric(t,this.numericParametersUi.get(l.NumericParameters.AFKTimeoutSecs));const r=this.buildSectionWithHeading(e,"UI");this.addSettingFlag(r,this.flagsUi.get(l.Flags.MatchViewportResolution)),this.addSettingFlag(r,this.flagsUi.get(l.Flags.HoveringMouseMode)),this.addSettingFlag(r,this.flagsUi.get(D));const n=this.buildSectionWithHeading(e,"Input");this.addSettingFlag(n,this.flagsUi.get(l.Flags.KeyboardInput)),this.addSettingFlag(n,this.flagsUi.get(l.Flags.MouseInput)),this.addSettingFlag(n,this.flagsUi.get(l.Flags.TouchInput)),this.addSettingFlag(n,this.flagsUi.get(l.Flags.GamepadInput)),this.addSettingFlag(n,this.flagsUi.get(l.Flags.XRControllerInput));const i=this.buildSectionWithHeading(e,"Encoder");this.addSettingNumeric(i,this.numericParametersUi.get(l.NumericParameters.MinQP)),this.addSettingNumeric(i,this.numericParametersUi.get(l.NumericParameters.MaxQP));const s=this.optionParametersUi.get(l.OptionParameters.PreferredCodec);this.addSettingOption(i,this.optionParametersUi.get(l.OptionParameters.PreferredCodec)),s&&[...s.selector.options].map((e=>e.value)).includes("Only available on Chrome")&&s.disable();const a=this.buildSectionWithHeading(e,"WebRTC");this.addSettingNumeric(a,this.numericParametersUi.get(l.NumericParameters.WebRTCFPS)),this.addSettingNumeric(a,this.numericParametersUi.get(l.NumericParameters.WebRTCMinBitrate)),this.addSettingNumeric(a,this.numericParametersUi.get(l.NumericParameters.WebRTCMaxBitrate))}addSettingText(e,t){t&&(e.appendChild(t.rootElement),this.textParametersUi.set(t.setting.id,t))}addSettingFlag(e,t){t&&(e.appendChild(t.rootElement),this.flagsUi.set(t.setting.id,t))}addSettingNumeric(e,t){t&&(e.appendChild(t.rootElement),this.numericParametersUi.set(t.setting.id,t))}addSettingOption(e,t){t&&(e.appendChild(t.rootElement),this.optionParametersUi.set(t.setting.id,t))}onSettingsChanged({data:{id:e,target:t,type:r}}){if("flag"===r){const r=e,n=t,i=this.flagsUi.get(r);i&&(i.flag!==n.flag&&(i.flag=n.flag),i.label!==n.label&&(i.label=n.label))}else if("number"===r){const r=e,n=t,i=this.numericParametersUi.get(r);i&&(i.number!==n.number&&(i.number=n.number),i.label!==n.label&&(i.label=n.label))}else if("text"===r){const r=e,n=t,i=this.textParametersUi.get(r);i&&(i.text!==n.text&&(i.text=n.text),i.label!==n.label&&(i.label=n.label))}else if("option"===r){const r=e,n=t,i=this.optionParametersUi.get(r);if(i){const e=i.options,t=n.options;e.length===t.length&&e.every((e=>t.includes(e)))||(i.options=n.options),i.selected!==n.selected&&(i.selected=n.selected),i.label!==n.label&&(i.label=n.label)}}}addCustomFlagOnSettingChangedListener(e,t){this.customFlags.has(e)&&(this.customFlags.get(e).onChange=t)}setCustomFlagLabel(e,t){this.customFlags.has(e)?(this.customFlags.get(e).label=t,this.flagsUi.get(e).label=t):l.Logger.Warning(l.Logger.GetStackTrace(),`Cannot set label for flag called ${e} - it does not exist in the Config.flags map.`)}isCustomFlagEnabled(e){return this.customFlags.get(e).flag}}class Q{constructor(e){this._options=e,this.stream=e.stream,this.onColorModeChanged=e.onColorModeChanged,this.configUI=new H(this.stream.config),this.createOverlays(),T(e.statsPanelConfig)&&(this.statsPanel=new O,this.uiFeaturesElement.appendChild(this.statsPanel.rootElement)),T(e.settingsPanelConfig)&&(this.settingsPanel=new k,this.uiFeaturesElement.appendChild(this.settingsPanel.rootElement),this.configureSettings()),e.videoQpIndicatorConfig&&e.videoQpIndicatorConfig.disableIndicator||(this.videoQpIndicator=new M,this.uiFeaturesElement.appendChild(this.videoQpIndicator.rootElement)),this.createButtons(),this.registerCallbacks(),this.showConnectOrAutoConnectOverlays(),this.setColorMode(this.configUI.isCustomFlagEnabled(D))}createOverlays(){this.disconnectOverlay=new u(this.stream.videoElementParent),this.connectOverlay=new m(this.stream.videoElementParent),this.playOverlay=new g(this.stream.videoElementParent),this.infoOverlay=new E(this.stream.videoElementParent),this.errorOverlay=new v$1(this.stream.videoElementParent),this.afkOverlay=new b(this.stream.videoElementParent),this.disconnectOverlay.onAction((()=>this.stream.reconnect())),this.connectOverlay.onAction((()=>this.stream.connect())),this.playOverlay.onAction((()=>this.stream.play()))}createButtons(){const e={statsButtonType:this._options.statsPanelConfig?this._options.statsPanelConfig.visibilityButtonConfig:void 0,settingsButtonType:this._options.settingsPanelConfig?this._options.settingsPanelConfig.visibilityButtonConfig:void 0,fullscreenButtonType:this._options.fullScreenControlsConfig,xrIconType:this._options.xrControlsConfig},t=new L(e);this.uiFeaturesElement.appendChild(t.rootElement);const r=this._options.fullScreenControlsConfig&&this._options.fullScreenControlsConfig.creationMode===c.UseCustomElement?new y(this._options.fullScreenControlsConfig.customElement):t.fullscreenIcon;r&&(r.fullscreenElement=this.rootElement);const n=t.settingsIcon?t.settingsIcon.rootElement:this._options.settingsPanelConfig.visibilityButtonConfig.customElement;n&&(n.onclick=()=>this.settingsClicked()),this.settingsPanel&&(this.settingsPanel.settingsCloseButton.onclick=()=>this.settingsClicked());const i=t.xrIcon?t.xrIcon.rootElement:this._options.xrControlsConfig.creationMode===c.UseCustomElement?this._options.xrControlsConfig.customElement:void 0;i&&(i.onclick=()=>this.stream.toggleXR());const s=t.statsIcon?t.statsIcon.rootElement:this._options.statsPanelConfig.visibilityButtonConfig.customElement;if(s&&(s.onclick=()=>this.statsClicked()),this.statsPanel&&(this.statsPanel.statsCloseButton.onclick=()=>this.statsClicked()),this.settingsPanel){const e=new I("Show FPS","Toggle");e.addOnClickListener((()=>{this.stream.requestShowFps()}));const t=new I("Restart Stream","Restart");t.addOnClickListener((()=>{this.stream.reconnect()}));const r=new I("Request keyframe","Request");r.addOnClickListener((()=>{this.stream.requestIframe()}));const n=this.configUI.buildSectionWithHeading(this.settingsPanel.settingsContentElement,"Commands");n.appendChild(e.rootElement),n.appendChild(r.rootElement),n.appendChild(t.rootElement)}}configureSettings(){this.configUI.populateSettingsElement(this.settingsPanel.settingsContentElement),this.configUI.addCustomFlagOnSettingChangedListener(D,(e=>{this.configUI.setCustomFlagLabel(D,`Color Scheme: ${e?"Light":"Dark"} Mode`),this.setColorMode(e)}))}registerCallbacks(){this.stream.addEventListener("afkWarningActivate",(({data:{countDown:e,dismissAfk:t}})=>this.showAfkOverlay(e,t))),this.stream.addEventListener("afkWarningUpdate",(({data:{countDown:e}})=>this.afkOverlay.updateCountdown(e))),this.stream.addEventListener("afkWarningDeactivate",(()=>this.afkOverlay.hide())),this.stream.addEventListener("afkTimedOut",(()=>this.afkOverlay.hide())),this.stream.addEventListener("videoEncoderAvgQP",(({data:{avgQP:e}})=>this.onVideoEncoderAvgQP(e))),this.stream.addEventListener("webRtcSdp",(()=>this.onWebRtcSdp())),this.stream.addEventListener("webRtcAutoConnect",(()=>this.onWebRtcAutoConnect())),this.stream.addEventListener("webRtcConnecting",(()=>this.onWebRtcConnecting())),this.stream.addEventListener("webRtcConnected",(()=>this.onWebRtcConnected())),this.stream.addEventListener("webRtcFailed",(()=>this.onWebRtcFailed())),this.stream.addEventListener("webRtcDisconnected",(({data:{eventString:e,showActionOrErrorOnDisconnect:t}})=>this.onDisconnect(e,t))),this.stream.addEventListener("videoInitialized",(()=>this.onVideoInitialized())),this.stream.addEventListener("streamLoading",(()=>this.onStreamLoading())),this.stream.addEventListener("playStreamError",(({data:{message:e}})=>this.onPlayStreamError(e))),this.stream.addEventListener("playStream",(()=>this.onPlayStream())),this.stream.addEventListener("playStreamRejected",(({data:{reason:e}})=>this.onPlayStreamRejected(e))),this.stream.addEventListener("loadFreezeFrame",(({data:{shouldShowPlayOverlay:e}})=>this.onLoadFreezeFrame(e))),this.stream.addEventListener("statsReceived",(({data:{aggregatedStats:e}})=>this.onStatsReceived(e))),this.stream.addEventListener("latencyTestResult",(({data:{latencyTimings:e}})=>this.onLatencyTestResults(e))),this.stream.addEventListener("streamerListMessage",(({data:{messageStreamerList:e,autoSelectedStreamerId:t}})=>this.handleStreamerListMessage(e,t))),this.stream.addEventListener("settingsChanged",(e=>this.configUI.onSettingsChanged(e)))}get rootElement(){return this._rootElement||(this._rootElement=document.createElement("div"),this._rootElement.id="playerUI",this._rootElement.classList.add("noselect"),this._rootElement.appendChild(this.stream.videoElementParent),this._rootElement.appendChild(this.uiFeaturesElement)),this._rootElement}get uiFeaturesElement(){return this._uiFeatureElement||(this._uiFeatureElement=document.createElement("div"),this._uiFeatureElement.id="uiFeatures"),this._uiFeatureElement}showDisconnectOverlay(e){this.hideCurrentOverlay(),this.updateDisconnectOverlay(e),this.disconnectOverlay.show(),this.currentOverlay=this.disconnectOverlay}updateDisconnectOverlay(e){this.disconnectOverlay.update(e)}onDisconnectionAction(){this.disconnectOverlay.activate()}hideCurrentOverlay(){null!=this.currentOverlay&&(this.currentOverlay.hide(),this.currentOverlay=null)}showConnectOverlay(){this.hideCurrentOverlay(),this.connectOverlay.show(),this.currentOverlay=this.connectOverlay}showPlayOverlay(){this.hideCurrentOverlay(),this.playOverlay.show(),this.currentOverlay=this.playOverlay}showTextOverlay(e){this.hideCurrentOverlay(),this.infoOverlay.update(e),this.infoOverlay.show(),this.currentOverlay=this.infoOverlay}showErrorOverlay(e){this.hideCurrentOverlay(),this.errorOverlay.update(e),this.errorOverlay.show(),this.currentOverlay=this.errorOverlay}settingsClicked(){this.statsPanel.hide(),this.settingsPanel.toggleVisibility()}statsClicked(){this.settingsPanel.hide(),this.statsPanel.toggleVisibility()}onConnectAction(){this.connectOverlay.activate()}onPlayAction(){this.playOverlay.activate()}showAfkOverlay(e,t){this.hideCurrentOverlay(),this.afkOverlay.updateCountdown(e),this.afkOverlay.onAction((()=>t())),this.afkOverlay.show(),this.currentOverlay=this.afkOverlay}showConnectOrAutoConnectOverlays(){this.stream.config.isFlagEnabled(l.Flags.AutoConnect)||this.showConnectOverlay()}onWebRtcAutoConnect(){this.showTextOverlay("Auto Connecting Now")}onWebRtcSdp(){this.showTextOverlay("WebRTC Connection Negotiated")}onStreamLoading(){const e=document.createElement("span");e.className="visually-hidden",e.innerHTML="Loading...";const t=document.createElement("div");t.id="loading-spinner",t.className="spinner-border ms-2",t.setAttribute("role","status"),t.appendChild(e),this.showTextOverlay("Loading Stream "+t.outerHTML)}onDisconnect(e,t){0==t?this.showErrorOverlay(`Disconnected: ${e}`):this.showDisconnectOverlay(`Disconnected: ${e} <div class="clickableState">Click To Restart</div>`),this.statsPanel.latencyTest.latencyTestButton.onclick=()=>{}}onWebRtcConnecting(){this.showTextOverlay("Starting connection to server, please wait")}onWebRtcConnected(){this.showTextOverlay("WebRTC connected, waiting for video")}onWebRtcFailed(){this.showErrorOverlay("Unable to setup video")}onLoadFreezeFrame(e){!0===e&&(l.Logger.Log(l.Logger.GetStackTrace(),"showing play overlay"),this.showPlayOverlay())}onPlayStream(){this.hideCurrentOverlay()}onPlayStreamError(e){this.showErrorOverlay(e)}onPlayStreamRejected(e){this.showPlayOverlay()}onVideoInitialized(){this.stream.config.isFlagEnabled(l.Flags.AutoPlayVideo)||this.showPlayOverlay(),this.statsPanel.latencyTest.latencyTestButton.onclick=()=>{this.stream.requestLatencyTest()}}onVideoEncoderAvgQP(e){this.videoQpIndicator&&this.videoQpIndicator.updateQpTooltip(e)}onInitialSettings(e){e.PixelStreamingSettings&&e.PixelStreamingSettings.DisableLatencyTest&&(this.statsPanel.latencyTest.latencyTestButton.disabled=!0,this.statsPanel.latencyTest.latencyTestButton.title="Disabled by -PixelStreamingDisableLatencyTester=true",l.Logger.Info(l.Logger.GetStackTrace(),"-PixelStreamingDisableLatencyTester=true, requesting latency report from the the browser to UE is disabled."))}onStatsReceived(e){this.statsPanel.handleStats(e)}onLatencyTestResults(e){this.statsPanel.latencyTest.handleTestResult(e)}handleStreamerListMessage(e,t){null===t&&(0===e.ids.length?this.showDisconnectOverlay('No streamers connected. <div class="clickableState">Click To Restart</div>'):this.showTextOverlay("Multiple streamers detected. Use the dropdown in the settings menu to select the streamer"))}setColorMode(e){this.onColorModeChanged&&this.onColorModeChanged(e)}}const W=(e=>{var t={};return n.d(t,e),t})({default:()=>index$1}),Z=(e=>{var t={};return n.d(t,e),t})({default:()=>jssGlobal}),X=(e=>{var t={};return n.d(t,e),t})({default:()=>camelCase});class j{constructor(e){this.defaultLightModePalette={"--color0":"#e2e0dd80","--color1":"#FFFFFF","--color2":"#000000","--color3":"#0585fe","--color4":"#35b350","--color5":"#ffab00","--color6":"#e1e2dd","--color7":"#c3c4bf"},this.defaultDarkModePalette={"--color0":"#1D1F2280","--color1":"#000000","--color2":"#FFFFFF","--color3":"#0585fe","--color4":"#35b350","--color5":"#ffab00","--color6":"#1e1d22","--color7":"#3c3b40"},this.defaultStyles={":root":{"--color0":"#1D1F2280","--color1":"#000000","--color2":"#FFFFFF","--color3":"#0585fe","--color4":"#35b350","--color5":"#ffab00","--color6":"#1e1d22","--color7":"#3c3b40","--color8":"#41008c","--color9":"#3e0070","--color10":"#2e0052","--color11":"rgba(65,0,139,1)"},".noselect":{userSelect:"none"},"#playerUI":{width:"100%",height:"100%",position:"relative"},"#videoElementParent":{width:"100%",height:"100%",position:"absolute",backgroundColor:"var(--color1)"},"#uiFeatures":{width:"100%",height:"100%",zIndex:"30",position:"relative",color:"var(--color2)",pointerEvents:"none",overflow:"hidden"},".UiTool .tooltiptext":{visibility:"hidden",width:"auto",color:"var(--color2)",textAlign:"center",borderRadius:"15px",padding:"0px 10px",fontFamily:"'Montserrat', sans-serif",fontSize:"0.75rem",letterSpacing:"0.75px",position:"absolute",top:"0",transform:"translateY(25%)",left:"125%",zIndex:"20"},".UiTool:hover .tooltiptext":{visibility:"visible",backgroundColor:"var(--color7)"},"#connection .tooltiptext":{top:"125%",transform:"translateX(-25%)",left:"0",zIndex:"20",padding:"5px 10px"},"#connection":{position:"absolute",bottom:"8%",left:"5%",fontFamily:"'Michroma', sans-serif",height:"3rem",width:"3rem",pointerEvents:"all"},"#settings-panel .tooltiptext":{display:"block",top:"125%",transform:"translateX(-50%)",left:"0",zIndex:"20",padding:"5px 10px",border:"3px solid var(--color3)",width:"max-content",fallbacks:[{width:"max-content"},{border:"3px solid var(--color3)"},{padding:"5px 10px"},{zIndex:"20"},{left:"0"},{transform:"translateX(-50%)"},{top:"125%"},{display:"block"}]},"#controls":{position:"absolute",top:"3%",left:"2%",fontFamily:"'Michroma', sans-serif",pointerEvents:"all",display:"block"},"#controls>*":{marginBottom:"0.5rem",borderRadius:"50%",display:"block",height:"2rem",lineHeight:"1.75rem",padding:"0.5rem"},"#controls #additionalinfo":{textAlign:"center",fontFamily:"'Montserrat', sans-serif"},"#fullscreen-btn":{padding:"0.6rem !important"},"#minimizeIcon":{display:"none"},"#settingsBtn, #statsBtn":{cursor:"pointer"},"#uiFeatures button":{backgroundColor:"var(--color7)",border:"1px solid var(--color7)",color:"var(--color2)",position:"relative",width:"3rem",height:"3rem",padding:"0.5rem",textAlign:"center"},"#uiFeatures button:hover":{backgroundColor:"var(--color3)",border:"3px solid var(--color3)",transition:"0.25s ease",paddingLeft:"0.55rem",paddingTop:"0.55rem"},"#uiFeatures button:active":{border:"3px solid var(--color3)",backgroundColor:"var(--color7)",paddingLeft:"0.55rem",paddingTop:"0.55rem"},".btn-flat":{backgroundColor:"transparent",color:"var(--color2)",fontFamily:"'Montserrat'",fontWeight:"bold",border:"3px solid var(--color3)",borderRadius:"1rem",fontSize:"0.75rem",paddingLeft:"0.5rem",paddingRight:"0.5rem",cursor:"pointer",textAlign:"center"},".btn-flat:hover":{backgroundColor:"var(--color3)",transition:"ease 0.3s"},".btn-flat:disabled":{background:"var(--color7)",borderColor:"var(--color3)",color:"var(--color3)",cursor:"default"},".btn-flat:active":{backgroundColor:"transparent"},".btn-flat:focus":{outline:"none"},"#uiFeatures img":{width:"100%",height:"100%"},".panel-wrap":{position:"absolute",top:"0",bottom:"0",right:"0",height:"100%",minWidth:"20vw",maxWidth:"100vw",transform:"translateX(100%)",transition:".3s ease-out",pointerEvents:"all",backdropFilter:"blur(10px)",webkitBackdropFilter:"blur(10px)",overflowY:"auto",overflowX:"hidden",backgroundColor:"var(--color0)"},".panel-wrap-visible":{transform:"translateX(0%)"},".panel":{overflowY:"auto",padding:"1em"},"#settingsHeading, #statsHeading":{display:"inline-block",fontSize:"2em",marginBlockStart:"0.67em",marginBlockEnd:"0.67em",marginInlineStart:"0px",marginInlineEnd:"0px",position:"relative",padding:"0 0 0 2rem"},"#settingsClose, #statsClose":{margin:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",paddingRight:"0.5rem",fontSize:"2em",float:"right"},"#settingsClose:after, #statsClose:after":{paddingLeft:"0.5rem",display:"inline-block",content:'"\\00d7"'},"#settingsClose:hover, #statsClose:hover":{color:"var(--color3)",transition:"ease 0.3s"},"#settingsContent, #statsContent":{marginLeft:"2rem",marginRight:"2rem"},".setting":{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"0.15rem 10px 0.15rem 10px"},".settings-text":{color:"var(--color2)",verticalAlign:"middle",fontWeight:"normal"},".settings-option":{width:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap"},"#connectOverlay, #playOverlay, #infoOverlay, #errorOverlay, #afkOverlay, #disconnectOverlay":{zIndex:"30",position:"absolute",color:"var(--color2)",fontSize:"1.8em",width:"100%",height:"100%",backgroundColor:"var(--color1)",alignItems:"center",justifyContent:"center",textTransform:"uppercase"},".clickableState":{alignItems:"center",justifyContent:"center",display:"flex",cursor:"pointer"},".textDisplayState":{display:"flex"},".hiddenState":{display:"none"},"#playButton, #connectButton":{display:"inline-block",height:"auto",zIndex:"30"},"img#playButton":{maxWidth:"241px",width:"10%"},"#uiInteraction":{position:"fixed"},"#UIInteractionButtonBoundary":{padding:"2px"},"#UIInteractionButton":{cursor:"pointer"},"#hiddenInput":{position:"absolute",left:"-10%",width:"0px",opacity:"0"},"#editTextButton":{position:"absolute",height:"40px",width:"40px"},".btn-overlay":{verticalAlign:"middle",display:"inline-block"},".tgl-switch":{verticalAlign:"middle",display:"inline-block"},".tgl-switch .tgl":{display:"none"},".tgl, .tgl:after, .tgl:before, .tgl *, .tgl *:after, .tgl *:before, .tgl+.tgl-slider":{webkitBoxSizing:"border-box",boxSizing:"border-box"},".tgl::-moz-selection, .tgl:after::-moz-selection, .tgl:before::-moz-selection, .tgl *::-moz-selection, .tgl *:after::-moz-selection, .tgl *:before::-moz-selection, .tgl+.tgl-slider::-moz-selection":{background:"none"},".tgl::selection, .tgl:after::selection, .tgl:before::selection, .tgl *::selection, .tgl *:after::selection, .tgl *:before::selection, .tgl+.tgl-slider::selection":{background:"none"},".tgl-slider":{},".tgl+.tgl-slider":{outline:"0",display:"block",width:"40px",height:"18px",position:"relative",cursor:"pointer",userSelect:"none"},".tgl+.tgl-slider:after, .tgl+.tgl-slider:before":{position:"relative",display:"block",content:'""',width:"50%",height:"100%"},".tgl+.tgl-slider:after":{left:"0"},".tgl+.tgl-slider:before":{display:"none"},".tgl-flat+.tgl-slider":{padding:"2px",webkitTransition:"all .2s ease",transition:"all .2s ease",background:"var(--color6)",border:"3px solid var(--color7)",borderRadius:"2em"},".tgl-flat+.tgl-slider:after":{webkitTransition:"all .2s ease",transition:"all .2s ease",background:"var(--color7)",content:'""',borderRadius:"1em"},".tgl-flat:checked+.tgl-slider":{border:"3px solid var(--color3)"},".tgl-flat:checked+.tgl-slider:after":{left:"50%",background:"var(--color3)"},".btn-apply":{display:"block !important",marginLeft:"auto",marginRight:"auto",width:"40%"},".form-control":{backgroundColor:"var(--color7)",border:"2px solid var(--color7)",borderRadius:"4px",color:"var(--color2)",textAlign:"right",fontFamily:"inherit"},".form-control:hover":{borderColor:"var(--color7)"},".form-group":{paddingTop:"4px",display:"grid",gridTemplateColumns:"80% 20%",rowGap:"4px",paddingRight:"10px",paddingLeft:"10px"},".form-group label":{verticalAlign:"middle",fontWeight:"normal"},".settingsContainer":{display:"flex",flexDirection:"column",borderBottom:"1px solid var(--color7)",paddingTop:"10px",paddingBottom:"10px"},".settingsContainer> :first-child":{marginTop:"4px",marginBottom:"4px",fontWeight:"bold",justifyContent:"space-between",display:"flex",flexDirection:"row",alignItems:"baseline"},".collapse":{paddingLeft:"5%"},"#streamTools":{borderBottomRightRadius:"5px",borderBottomLeftRadius:"5px",userSelect:"none",position:"absolute",top:"0",right:"2%",zIndex:"100",border:"4px solid var(--colour8)",borderTopWidth:"0px"},".settingsHeader":{fontStyle:"italic"},"#streamToolsHeader":{display:"flex",flexDirection:"row",justifyContent:"space-between",borderBottom:"1px solid var(--colour8)",backgroundColor:"var(--color7)"},".streamTools":{backgroundColor:"var(--color2)",fontFamily:"var(--buttonFont)",fontWeight:"lighter",color:"var(--color7)"},".streamTools-shown>#streamToolsSettings, .streamTools-shown>#streamToolsStats":{display:"block"},"#streamToolsToggle":{width:"100%"},"#qualityStatus":{fontSize:"37px",paddingRight:"4px"},".svgIcon":{fill:"var(--color2)"}};const{customStyles:t,lightModePalette:r,darkModePalette:n}=null!=e?e:{},i={plugins:[(0,Z.default)(),(0,X.default)()]};W.default.setup(i),this.customStyles=t,this.lightModePalette=null!=r?r:this.defaultLightModePalette,this.darkModePalette=null!=n?n:this.defaultDarkModePalette}applyStyleSheet(){W.default.createStyleSheet({"@global":Object.assign(Object.assign({},this.defaultStyles),this.customStyles)}).attach()}applyPalette(e){const t=document.querySelector(":root");t.style.setProperty("--color0",e["--color0"]),t.style.setProperty("--color1",e["--color1"]),t.style.setProperty("--color2",e["--color2"]),t.style.setProperty("--color3",e["--color3"]),t.style.setProperty("--color4",e["--color4"]),t.style.setProperty("--color5",e["--color5"]),t.style.setProperty("--color6",e["--color6"]),t.style.setProperty("--color7",e["--color7"])}setColorMode(e){e?this.applyPalette(this.lightModePalette):this.applyPalette(this.darkModePalette)}}var q=o.ym,V=o.EW,G=o.Mx,J=o.L3,Y=o.rl,K=o.NR,$$9=o.f1,tt=o.IY,et=o.RZ,st=o.XY,it=o.Fk,nt=o.Zh,ot=o.ek,lt=o.MG,at=o.gE,rt=o.tW,ct=o.wr,check=function(e){return e&&e.Math==Math&&e},global$g=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$l=function(e){try{return!!e()}catch(e){return!0}},fails$k=fails$l,descriptors=!fails$k((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),fails$j=fails$l,functionBindNative=!fails$j((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$3=functionBindNative,call$g=Function.prototype.call,functionCall=NATIVE_BIND$3?call$g.bind(call$g):function(){return call$g.apply(call$g,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$3=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$3&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$3(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable;var createPropertyDescriptor$5=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},NATIVE_BIND$2=functionBindNative,FunctionPrototype$2=Function.prototype,call$f=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$2&&FunctionPrototype$2.bind.bind(call$f,call$f),functionUncurryThis=NATIVE_BIND$2?uncurryThisWithBind:function(e){return function(){return call$f.apply(e,arguments)}},uncurryThis$o=functionUncurryThis,toString$a=uncurryThis$o({}.toString),stringSlice$8=uncurryThis$o("".slice),classofRaw$2=function(e){return stringSlice$8(toString$a(e),8,-1)},uncurryThis$n=functionUncurryThis,fails$i=fails$l,classof$7=classofRaw$2,$Object$4=Object,split$3=uncurryThis$n("".split),indexedObject=fails$i((function(){return!$Object$4("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$7(e)?split$3(e,""):$Object$4(e)}:$Object$4,isNullOrUndefined$5=function(e){return null==e},isNullOrUndefined$4=isNullOrUndefined$5,$TypeError$b=TypeError,requireObjectCoercible$8=function(e){if(isNullOrUndefined$4(e))throw $TypeError$b("Can't call method on "+e);return e},IndexedObject$1=indexedObject,requireObjectCoercible$7=requireObjectCoercible$8,toIndexedObject$5=function(e){return IndexedObject$1(requireObjectCoercible$7(e))},documentAll$2="object"==typeof document&&document.all,IS_HTMLDDA=void 0===documentAll$2&&void 0!==documentAll$2,documentAll_1={all:documentAll$2,IS_HTMLDDA:IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$j=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},isCallable$i=isCallable$j,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$8=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$i(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$i(e)},global$f=global$g,isCallable$h=isCallable$j,aFunction=function(e){return isCallable$h(e)?e:void 0},getBuiltIn$4=function(e,t){return arguments.length<2?aFunction(global$f[e]):global$f[e]&&global$f[e][t]},uncurryThis$m=functionUncurryThis,objectIsPrototypeOf=uncurryThis$m({}.isPrototypeOf),engineUserAgent="undefined"!=typeof navigator&&String(navigator.userAgent)||"",global$e=global$g,userAgent=engineUserAgent,process=global$e.process,Deno=global$e.Deno,versions=process&&process.versions||Deno&&Deno.version,v8=versions&&versions.v8,match,version;v8&&(match=v8.split("."),version=match[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&userAgent&&(match=userAgent.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent.match(/Chrome\/(\d+)/),match&&(version=+match[1])));var engineV8Version=version,V8_VERSION=engineV8Version,fails$h=fails$l,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$h((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION&&V8_VERSION<41})),NATIVE_SYMBOL$1=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$1&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$3=getBuiltIn$4,isCallable$g=isCallable$j,isPrototypeOf$2=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$2=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$3("Symbol");return isCallable$g(t)&&isPrototypeOf$2(t.prototype,$Object$3(e))},$String$4=String,tryToString$2=function(e){try{return $String$4(e)}catch(e){return"Object"}},isCallable$f=isCallable$j,tryToString$1=tryToString$2,$TypeError$a=TypeError,aCallable$4=function(e){if(isCallable$f(e))return e;throw $TypeError$a(tryToString$1(e)+" is not a function")},aCallable$3=aCallable$4,isNullOrUndefined$3=isNullOrUndefined$5,getMethod$5=function(e,t){var r=e[t];return isNullOrUndefined$3(r)?void 0:aCallable$3(r)},call$e=functionCall,isCallable$e=isCallable$j,isObject$7=isObject$8,$TypeError$9=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$e(r=e.toString)&&!isObject$7(n=call$e(r,e)))return n;if(isCallable$e(r=e.valueOf)&&!isObject$7(n=call$e(r,e)))return n;if("string"!==t&&isCallable$e(r=e.toString)&&!isObject$7(n=call$e(r,e)))return n;throw $TypeError$9("Can't convert object to primitive value")},shared$4={exports:{}},isPure=!1,global$d=global$g,defineProperty$6=Object.defineProperty,defineGlobalProperty$3=function(e,t){try{defineProperty$6(global$d,e,{value:t,configurable:!0,writable:!0})}catch(r){global$d[e]=t}return t},global$c=global$g,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$c[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$4.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.29.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE",source:"https://github.com/zloirock/core-js"});var requireObjectCoercible$6=requireObjectCoercible$8,$Object$2=Object,toObject$5=function(e){return $Object$2(requireObjectCoercible$6(e))},uncurryThis$l=functionUncurryThis,toObject$4=toObject$5,hasOwnProperty=uncurryThis$l({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$4(e),t)},uncurryThis$k=functionUncurryThis,id=0,postfix=Math.random(),toString$9=uncurryThis$k(1..toString),uid$2=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$9(++id+postfix,36)},global$b=global$g,shared$3=shared$4.exports,hasOwn$b=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$1=global$b.Symbol,WellKnownSymbolsStore=shared$3("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$1.for||Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$1,wellKnownSymbol$g=function(e){return hasOwn$b(WellKnownSymbolsStore,e)||(WellKnownSymbolsStore[e]=NATIVE_SYMBOL&&hasOwn$b(Symbol$1,e)?Symbol$1[e]:createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore[e]},call$d=functionCall,isObject$6=isObject$8,isSymbol$1=isSymbol$2,getMethod$4=getMethod$5,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$f=wellKnownSymbol$g,$TypeError$8=TypeError,TO_PRIMITIVE=wellKnownSymbol$f("toPrimitive"),toPrimitive$1=function(e,t){if(!isObject$6(e)||isSymbol$1(e))return e;var r,n=getMethod$4(e,TO_PRIMITIVE);if(n){if(void 0===t&&(t="default"),r=call$d(n,e,t),!isObject$6(r)||isSymbol$1(r))return r;throw $TypeError$8("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive=toPrimitive$1,isSymbol=isSymbol$2,toPropertyKey$3=function(e){var t=toPrimitive(e,"string");return isSymbol(t)?t:t+""},global$a=global$g,isObject$5=isObject$8,document$1=global$a.document,EXISTS$1=isObject$5(document$1)&&isObject$5(document$1.createElement),documentCreateElement$2=function(e){return EXISTS$1?document$1.createElement(e):{}},DESCRIPTORS$c=descriptors,fails$g=fails$l,createElement=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$c&&!fails$g((function(){return 7!=Object.defineProperty(createElement("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$b=descriptors,call$c=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$4=createPropertyDescriptor$5,toIndexedObject$4=toIndexedObject$5,toPropertyKey$2=toPropertyKey$3,hasOwn$a=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$b?$getOwnPropertyDescriptor$1:function(e,t){if(e=toIndexedObject$4(e),t=toPropertyKey$2(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(e,t)}catch(e){}if(hasOwn$a(e,t))return createPropertyDescriptor$4(!call$c(propertyIsEnumerableModule$1.f,e,t),e[t])};var objectDefineProperty={},DESCRIPTORS$a=descriptors,fails$f=fails$l,v8PrototypeDefineBug=DESCRIPTORS$a&&fails$f((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$4=isObject$8,$String$3=String,$TypeError$7=TypeError,anObject$e=function(e){if(isObject$4(e))return e;throw $TypeError$7($String$3(e)+" is not an object")},DESCRIPTORS$9=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$d=anObject$e,toPropertyKey$1=toPropertyKey$3,$TypeError$6=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$9?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$d(e),t=toPropertyKey$1(t),anObject$d(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var n=$getOwnPropertyDescriptor(e,t);n&&n[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:n[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:n[ENUMERABLE],writable:!1})}return $defineProperty(e,t,r)}:$defineProperty:function(e,t,r){if(anObject$d(e),t=toPropertyKey$1(t),anObject$d(r),IE8_DOM_DEFINE)try{return $defineProperty(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$6("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var DESCRIPTORS$8=descriptors,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$3=createPropertyDescriptor$5,createNonEnumerableProperty$5=DESCRIPTORS$8?function(e,t,r){return definePropertyModule$4.f(e,t,createPropertyDescriptor$3(1,r))}:function(e,t,r){return e[t]=r,e},makeBuiltIn$3={exports:{}},DESCRIPTORS$7=descriptors,hasOwn$9=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$7&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$9(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$7||DESCRIPTORS$7&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},uncurryThis$j=functionUncurryThis,isCallable$d=isCallable$j,store$1=sharedStore,functionToString=uncurryThis$j(Function.toString);isCallable$d(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)});var inspectSource$2=store$1.inspectSource,global$9=global$g,isCallable$c=isCallable$j,WeakMap$1=global$9.WeakMap,weakMapBasicDetection=isCallable$c(WeakMap$1)&&/native code/.test(String(WeakMap$1)),shared$2=shared$4.exports,uid=uid$2,keys=shared$2("keys"),sharedKey$3=function(e){return keys[e]||(keys[e]=uid(e))},hiddenKeys$4={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$8=global$g,isObject$3=isObject$8,createNonEnumerableProperty$4=createNonEnumerableProperty$5,hasOwn$8=hasOwnProperty_1,shared$1=sharedStore,sharedKey$2=sharedKey$3,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$3=global$8.TypeError,WeakMap=global$8.WeakMap,set,get,has,enforce=function(e){return has(e)?get(e):set(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$3(t)||(r=get(t)).type!==e)throw TypeError$3("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$1.state){var store=shared$1.state||(shared$1.state=new WeakMap);store.get=store.get,store.has=store.has,store.set=store.set,set=function(e,t){if(store.has(e))throw TypeError$3(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get=function(e){return store.get(e)||{}},has=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$3[STATE]=!0,set=function(e,t){if(hasOwn$8(e,STATE))throw TypeError$3(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$4(e,STATE,t),t},get=function(e){return hasOwn$8(e,STATE)?e[STATE]:{}},has=function(e){return hasOwn$8(e,STATE)}}var internalState={set:set,get:get,has:has,enforce:enforce,getterFor:getterFor},uncurryThis$i=functionUncurryThis,fails$e=fails$l,isCallable$b=isCallable$j,hasOwn$7=hasOwnProperty_1,DESCRIPTORS$6=descriptors,CONFIGURABLE_FUNCTION_NAME$1=functionName.CONFIGURABLE,inspectSource$1=inspectSource$2,InternalStateModule$4=internalState,enforceInternalState=InternalStateModule$4.enforce,getInternalState$3=InternalStateModule$4.get,$String$2=String,defineProperty$5=Object.defineProperty,stringSlice$7=uncurryThis$i("".slice),replace$6=uncurryThis$i("".replace),join$3=uncurryThis$i([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$6&&!fails$e((function(){return 8!==defineProperty$5((function(){}),"length",{value:8}).length})),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function(e,t,r){"Symbol("===stringSlice$7($String$2(t),0,7)&&(t="["+replace$6($String$2(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!hasOwn$7(e,"name")||CONFIGURABLE_FUNCTION_NAME$1&&e.name!==t)&&(DESCRIPTORS$6?defineProperty$5(e,"name",{value:t,configurable:!0}):e.name=t),CONFIGURABLE_LENGTH&&r&&hasOwn$7(r,"arity")&&e.length!==r.arity&&defineProperty$5(e,"length",{value:r.arity});try{r&&hasOwn$7(r,"constructor")&&r.constructor?DESCRIPTORS$6&&defineProperty$5(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=enforceInternalState(e);return hasOwn$7(n,"source")||(n.source=join$3(TEMPLATE,"string"==typeof t?t:"")),e};Function.prototype.toString=makeBuiltIn$2((function(){return isCallable$b(this)&&getInternalState$3(this).source||inspectSource$1(this)}),"toString");var isCallable$a=isCallable$j,definePropertyModule$3=objectDefineProperty,makeBuiltIn$1=makeBuiltIn$3.exports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$8=function(e,t,r,n){n||(n={});var i=n.enumerable,s=void 0!==n.name?n.name:t;if(isCallable$a(r)&&makeBuiltIn$1(r,s,n),n.global)i?e[t]=r:defineGlobalProperty$1(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:definePropertyModule$3.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},objectGetOwnPropertyNames={},ceil=Math.ceil,floor$4=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$4:ceil)(t)},trunc=mathTrunc,toIntegerOrInfinity$4=function(e){var t=+e;return t!=t||0===t?0:trunc(t)},toIntegerOrInfinity$3=toIntegerOrInfinity$4,max$2=Math.max,min$3=Math.min,toAbsoluteIndex$2=function(e,t){var r=toIntegerOrInfinity$3(e);return r<0?max$2(r+t,0):min$3(r,t)},toIntegerOrInfinity$2=toIntegerOrInfinity$4,min$2=Math.min,toLength$3=function(e){return e>0?min$2(toIntegerOrInfinity$2(e),9007199254740991):0},toLength$2=toLength$3,lengthOfArrayLike$3=function(e){return toLength$2(e.length)},toIndexedObject$3=toIndexedObject$5,toAbsoluteIndex$1=toAbsoluteIndex$2,lengthOfArrayLike$2=lengthOfArrayLike$3,createMethod$2=function(e){return function(t,r,n){var i,s=toIndexedObject$3(t),a=lengthOfArrayLike$2(s),o=toAbsoluteIndex$1(n,a);if(e&&r!=r){for(;a>o;)if((i=s[o++])!=i)return!0}else for(;a>o;o++)if((e||o in s)&&s[o]===r)return e||o||0;return!e&&-1}},arrayIncludes={includes:createMethod$2(!0),indexOf:createMethod$2(!1)},uncurryThis$h=functionUncurryThis,hasOwn$6=hasOwnProperty_1,toIndexedObject$2=toIndexedObject$5,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$4=uncurryThis$h([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$2(e),i=0,s=[];for(r in n)!hasOwn$6(hiddenKeys$2,r)&&hasOwn$6(n,r)&&push$4(s,r);for(;t.length>i;)hasOwn$6(n,r=t[i++])&&(~indexOf$1(s,r)||push$4(s,r));return s},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$1)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$2=getBuiltIn$4,uncurryThis$g=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$c=anObject$e,concat$2=uncurryThis$g([].concat),ownKeys$1=getBuiltIn$2("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule.f(anObject$c(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$2(t,r(e)):t},hasOwn$5=hasOwnProperty_1,ownKeys=ownKeys$1,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$2=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var n=ownKeys(t),i=definePropertyModule$2.f,s=getOwnPropertyDescriptorModule.f,a=0;a<n.length;a++){var o=n[a];hasOwn$5(e,o)||r&&hasOwn$5(r,o)||i(e,o,s(t,o))}},fails$d=fails$l,isCallable$9=isCallable$j,replacement=/#|\.prototype\./,isForced$1=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$9(t)?fails$d(t):!!t)},normalize=isForced$1.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$1.data={},NATIVE=isForced$1.NATIVE="N",POLYFILL=isForced$1.POLYFILL="P",isForced_1=isForced$1,global$7=global$g,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn$7=defineBuiltIn$8,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties=copyConstructorProperties$1,isForced=isForced_1,_export=function(e,t){var r,n,i,s,a,o=e.target,l=e.global,c=e.stat;if(r=l?global$7:c?global$7[o]||defineGlobalProperty(o,{}):(global$7[o]||{}).prototype)for(n in t){if(s=t[n],i=e.dontCallGetSet?(a=getOwnPropertyDescriptor$2(r,n))&&a.value:r[n],!isForced(l?n:o+(c?".":"#")+n,e.forced)&&void 0!==i){if(typeof s==typeof i)continue;copyConstructorProperties(s,i)}(e.sham||i&&i.sham)&&createNonEnumerableProperty$3(s,"sham",!0),defineBuiltIn$7(r,n,s,e)}},wellKnownSymbol$e=wellKnownSymbol$g,TO_STRING_TAG$3=wellKnownSymbol$e("toStringTag"),test={};test[TO_STRING_TAG$3]="z";var toStringTagSupport="[object z]"===String(test),TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$8=isCallable$j,classofRaw$1=classofRaw$2,wellKnownSymbol$d=wellKnownSymbol$g,TO_STRING_TAG$2=wellKnownSymbol$d("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw$1(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$6=TO_STRING_TAG_SUPPORT?classofRaw$1:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$1(e),TO_STRING_TAG$2))?r:CORRECT_ARGUMENTS?classofRaw$1(t):"Object"==(n=classofRaw$1(t))&&isCallable$8(t.callee)?"Arguments":n},classof$5=classof$6,$String$1=String,toString$8=function(e){if("Symbol"===classof$5(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$1(e)},anObject$b=anObject$e,regexpFlags$1=function(){var e=anObject$b(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},fails$c=fails$l,global$6=global$g,$RegExp$2=global$6.RegExp,UNSUPPORTED_Y$1=fails$c((function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),MISSED_STICKY=UNSUPPORTED_Y$1||fails$c((function(){return!$RegExp$2("a","y").sticky})),BROKEN_CARET=UNSUPPORTED_Y$1||fails$c((function(){var e=$RegExp$2("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY,UNSUPPORTED_Y:UNSUPPORTED_Y$1},objectDefineProperties={},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$2=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},DESCRIPTORS$5=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$1=objectDefineProperty,anObject$a=anObject$e,toIndexedObject$1=toIndexedObject$5,objectKeys$1=objectKeys$2;objectDefineProperties.f=DESCRIPTORS$5&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$a(e);for(var r,n=toIndexedObject$1(t),i=objectKeys$1(t),s=i.length,a=0;s>a;)definePropertyModule$1.f(e,r=i[a++],n[r]);return e};var getBuiltIn$1=getBuiltIn$4,html$1=getBuiltIn$1("document","documentElement"),anObject$9=anObject$e,definePropertiesModule=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys=hiddenKeys$4,html=html$1,documentCreateElement$1=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$1("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement$1("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[e]];return NullProtoObject()};hiddenKeys[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE]=anObject$9(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule.f(r,t)},fails$b=fails$l,global$5=global$g,$RegExp$1=global$5.RegExp,regexpUnsupportedDotAll=fails$b((function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),fails$a=fails$l,global$4=global$g,$RegExp=global$4.RegExp,regexpUnsupportedNcg=fails$a((function(){var e=$RegExp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),call$b=functionCall,uncurryThis$f=functionUncurryThis,toString$7=toString$8,regexpFlags=regexpFlags$1,stickyHelpers=regexpStickyHelpers,shared=shared$4.exports,create$3=objectCreate,getInternalState$2=internalState.get,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,nativeReplace=shared("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$6=uncurryThis$f("".charAt),indexOf=uncurryThis$f("".indexOf),replace$5=uncurryThis$f("".replace),stringSlice$6=uncurryThis$f("".slice),UPDATES_LAST_INDEX_WRONG=(re1=/a/,re2=/b*/g,call$b(nativeExec,re1,"a"),call$b(nativeExec,re2,"a"),0!==re1.lastIndex||0!==re2.lastIndex),re1,re2,UNSUPPORTED_Y=stickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG;PATCH&&(patchedExec=function(e){var t,r,n,i,s,a,o,l=this,c=getInternalState$2(l),h=toString$7(e),d=c.raw;if(d)return d.lastIndex=l.lastIndex,t=call$b(patchedExec,d,h),l.lastIndex=d.lastIndex,t;var u=c.groups,p=UNSUPPORTED_Y&&l.sticky,f=call$b(regexpFlags,l),m=l.source,g=0,y=h;if(p&&(f=replace$5(f,"y",""),-1===indexOf(f,"g")&&(f+="g"),y=stringSlice$6(h,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==charAt$6(h,l.lastIndex-1))&&(m="(?: "+m+")",y=" "+y,g++),r=new RegExp("^(?:"+m+")",f)),NPCG_INCLUDED&&(r=new RegExp("^"+m+"$(?!\\s)",f)),UPDATES_LAST_INDEX_WRONG&&(n=l.lastIndex),i=call$b(nativeExec,p?r:l,y),p?i?(i.input=stringSlice$6(i.input,g),i[0]=stringSlice$6(i[0],g),i.index=l.lastIndex,l.lastIndex+=i[0].length):l.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&i&&(l.lastIndex=l.global?i.index+i[0].length:n),NPCG_INCLUDED&&i&&i.length>1&&call$b(nativeReplace,i[0],r,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)})),i&&u)for(i.groups=a=create$3(null),s=0;s<u.length;s++)a[(o=u[s])[0]]=i[o[1]];return i});var regexpExec$2=patchedExec,$$8=_export,exec$3=regexpExec$2;$$8({target:"RegExp",proto:!0,forced:/./.exec!==exec$3},{exec:exec$3});var NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$1=FunctionPrototype.apply,call$a=FunctionPrototype.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$1?call$a.bind(apply$1):function(){return call$a.apply(apply$1,arguments)}),classofRaw=classofRaw$2,uncurryThis$e=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw(e))return uncurryThis$e(e)},uncurryThis$d=functionUncurryThisClause,defineBuiltIn$6=defineBuiltIn$8,regexpExec$1=regexpExec$2,fails$9=fails$l,wellKnownSymbol$c=wellKnownSymbol$g,createNonEnumerableProperty$2=createNonEnumerableProperty$5,SPECIES=wellKnownSymbol$c("species"),RegExpPrototype$2=RegExp.prototype,fixRegexpWellKnownSymbolLogic=function(e,t,r,n){var i=wellKnownSymbol$c(e),s=!fails$9((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=s&&!fails$9((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[SPECIES]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!s||!a||r){var o=uncurryThis$d(/./[i]),l=t(i,""[e],(function(e,t,r,n,i){var a=uncurryThis$d(e),l=t.exec;return l===regexpExec$1||l===RegExpPrototype$2.exec?s&&!i?{done:!0,value:o(t,r,n)}:{done:!0,value:a(r,t,n)}:{done:!1}}));defineBuiltIn$6(String.prototype,e,l[0]),defineBuiltIn$6(RegExpPrototype$2,i,l[1])}n&&createNonEnumerableProperty$2(RegExpPrototype$2[i],"sham",!0)},uncurryThis$c=functionUncurryThis,toIntegerOrInfinity$1=toIntegerOrInfinity$4,toString$6=toString$8,requireObjectCoercible$5=requireObjectCoercible$8,charAt$5=uncurryThis$c("".charAt),charCodeAt$1=uncurryThis$c("".charCodeAt),stringSlice$5=uncurryThis$c("".slice),createMethod$1=function(e){return function(t,r){var n,i,s=toString$6(requireObjectCoercible$5(t)),a=toIntegerOrInfinity$1(r),o=s.length;return a<0||a>=o?e?"":void 0:(n=charCodeAt$1(s,a))<55296||n>56319||a+1===o||(i=charCodeAt$1(s,a+1))<56320||i>57343?e?charAt$5(s,a):n:e?stringSlice$5(s,a,a+2):i-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},charAt$4=stringMultibyte.charAt,advanceStringIndex$1=function(e,t,r){return t+(r?charAt$4(e,t).length:1)},uncurryThis$b=functionUncurryThis,toObject$3=toObject$5,floor$3=Math.floor,charAt$3=uncurryThis$b("".charAt),replace$4=uncurryThis$b("".replace),stringSlice$4=uncurryThis$b("".slice),SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution$1=function(e,t,r,n,i,s){var a=r+e.length,o=n.length,l=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==i&&(i=toObject$3(i),l=SUBSTITUTION_SYMBOLS),replace$4(s,l,(function(s,l){var c;switch(charAt$3(l,0)){case"$":return"$";case"&":return e;case"`":return stringSlice$4(t,0,r);case"'":return stringSlice$4(t,a);case"<":c=i[stringSlice$4(l,1,-1)];break;default:var h=+l;if(0===h)return s;if(h>o){var d=floor$3(h/10);return 0===d?s:d<=o?void 0===n[d-1]?charAt$3(l,1):n[d-1]+charAt$3(l,1):s}c=n[h-1]}return void 0===c?"":c}))},call$9=functionCall,anObject$8=anObject$e,isCallable$7=isCallable$j,classof$4=classofRaw$2,regexpExec=regexpExec$2,$TypeError$5=TypeError,regexpExecAbstract=function(e,t){var r=e.exec;if(isCallable$7(r)){var n=call$9(r,e,t);return null!==n&&anObject$8(n),n}if("RegExp"===classof$4(e))return call$9(regexpExec,e,t);throw $TypeError$5("RegExp#exec called on incompatible receiver")},apply=functionApply,call$8=functionCall,uncurryThis$a=functionUncurryThis,fixRegExpWellKnownSymbolLogic$1=fixRegexpWellKnownSymbolLogic,fails$8=fails$l,anObject$7=anObject$e,isCallable$6=isCallable$j,isNullOrUndefined$2=isNullOrUndefined$5,toIntegerOrInfinity=toIntegerOrInfinity$4,toLength$1=toLength$3,toString$5=toString$8,requireObjectCoercible$4=requireObjectCoercible$8,advanceStringIndex=advanceStringIndex$1,getMethod$3=getMethod$5,getSubstitution=getSubstitution$1,regExpExec$1=regexpExecAbstract,wellKnownSymbol$b=wellKnownSymbol$g,REPLACE=wellKnownSymbol$b("replace"),max$1=Math.max,min$1=Math.min,concat$1=uncurryThis$a([].concat),push$3=uncurryThis$a([].push),stringIndexOf$1=uncurryThis$a("".indexOf),stringSlice$3=uncurryThis$a("".slice),maybeToString=function(e){return void 0===e?e:String(e)},REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails$8((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));fixRegExpWellKnownSymbolLogic$1("replace",(function(e,t,r){var n=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function(e,r){var n=requireObjectCoercible$4(this),i=isNullOrUndefined$2(e)?void 0:getMethod$3(e,REPLACE);return i?call$8(i,e,n,r):call$8(t,toString$5(n),e,r)},function(e,i){var s=anObject$7(this),a=toString$5(e);if("string"==typeof i&&-1===stringIndexOf$1(i,n)&&-1===stringIndexOf$1(i,"$<")){var o=r(t,s,a,i);if(o.done)return o.value}var l=isCallable$6(i);l||(i=toString$5(i));var c=s.global;if(c){var h=s.unicode;s.lastIndex=0}for(var d=[];;){var u=regExpExec$1(s,a);if(null===u)break;if(push$3(d,u),!c)break;""===toString$5(u[0])&&(s.lastIndex=advanceStringIndex(a,toLength$1(s.lastIndex),h))}for(var p="",f=0,m=0;m<d.length;m++){for(var g=toString$5((u=d[m])[0]),y=max$1(min$1(toIntegerOrInfinity(u.index),a.length),0),v=[],b=1;b<u.length;b++)push$3(v,maybeToString(u[b]));var S=u.groups;if(l){var E=concat$1([g],v,y,a);void 0!==S&&push$3(E,S);var C=toString$5(apply(i,void 0,E))}else C=getSubstitution(g,a,y,v,S,i);y>=f&&(p+=stringSlice$3(a,f,y)+C,f=y+g.length)}return p+stringSlice$3(a,f)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var whitespaces$2="\t\n\v\f\r \u2028\u2029\ufeff",uncurryThis$9=functionUncurryThis,requireObjectCoercible$3=requireObjectCoercible$8,toString$4=toString$8,whitespaces$1=whitespaces$2,replace$3=uncurryThis$9("".replace),ltrim=RegExp("^["+whitespaces$1+"]+"),rtrim=RegExp("(^|[^"+whitespaces$1+"])["+whitespaces$1+"]+$"),createMethod=function(e){return function(t){var r=toString$4(requireObjectCoercible$3(t));return 1&e&&(r=replace$3(r,ltrim,"")),2&e&&(r=replace$3(r,rtrim,"$1")),r}},stringTrim={start:createMethod(1),end:createMethod(2),trim:createMethod(3)},PROPER_FUNCTION_NAME$2=functionName.PROPER,fails$7=fails$l,whitespaces=whitespaces$2,non="
",stringTrimForced=function(e){return fails$7((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME$2&&whitespaces[e].name!==e}))},$$7=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$7({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var wellKnownSymbol$a=wellKnownSymbol$g,create$2=objectCreate,defineProperty$4=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$a("unscopables"),ArrayPrototype$1=Array.prototype;null==ArrayPrototype$1[UNSCOPABLES]&&defineProperty$4(ArrayPrototype$1,UNSCOPABLES,{configurable:!0,value:create$2(null)});var addToUnscopables$2=function(e){ArrayPrototype$1[UNSCOPABLES][e]=!0},$$6=_export,$includes=arrayIncludes.includes,fails$6=fails$l,addToUnscopables$1=addToUnscopables$2,BROKEN_ON_SPARSE=fails$6((function(){return!Array(1).includes()}));$$6({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables$1("includes");var isObject$2=isObject$8,classof$3=classofRaw$2,wellKnownSymbol$9=wellKnownSymbol$g,MATCH$1=wellKnownSymbol$9("match"),isRegexp=function(e){var t;return isObject$2(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$3(e))},isRegExp=isRegexp,$TypeError$4=TypeError,notARegexp=function(e){if(isRegExp(e))throw $TypeError$4("The method doesn't accept regular expressions");return e},wellKnownSymbol$8=wellKnownSymbol$g,MATCH=wellKnownSymbol$8("match"),correctIsRegexpLogic=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[MATCH]=!1,"/./"[e](t)}catch(e){}}return!1},$$5=_export,uncurryThis$8=functionUncurryThis,notARegExp$1=notARegexp,requireObjectCoercible$2=requireObjectCoercible$8,toString$3=toString$8,correctIsRegExpLogic$1=correctIsRegexpLogic,stringIndexOf=uncurryThis$8("".indexOf);function __setFunctionName(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}$$5({target:"String",proto:!0,forced:!correctIsRegExpLogic$1("includes")},{includes:function(e){return!!~stringIndexOf(toString$3(requireObjectCoercible$2(this)),toString$3(notARegExp$1(e)),arguments.length>1?arguments[1]:void 0)}});const ArcwareStyles={customStyles:{":root":{"--color0":"#18181A !important","--color1":"#000000","--color2":"#FFFFFF","--color3":"#DAF693 !important","--color4":"#35b350","--color5":"#ffab00","--color6":"#858588 !important","--color7":"#B5B5B7 !important","--color8":"#41008c","--color9":"#3e0070","--color10":"#2e0052","--color11":"rgba(65,0,139,1) !important","--color12":"#222224 !important","--color13":"#f0f0f2 !important","--colorBoxShadow":"rgba(0, 0, 0, 0.20) !important"},"*":{fontFamily:"system-ui"},"#shared-stream-container":{boxSizing:"border-box"},"#shared-stream-container::-webkit-scrollbar":{width:"10px"},"#shared-stream-container::-webkit-scrollbar-track":{background:"var(--color13)",opacity:"0.5",borderRadius:"30px",borderTop:"20px solid var(--color0)",borderRight:"5px solid var(--color0)",borderBottom:"20px solid var(--color0)",borderLeft:"5px solid var(--color0)"},"#shared-stream-container::-webkit-scrollbar-track-piece":{background:"transparent"},"#shared-stream-container::-webkit-scrollbar-thumb":{background:"var(--color13)",width:"8px",borderRight:"2px solid var(--color0)",borderLeft:"2px solid var(--color0)",transition:"all ease-in-out 0.3s",borderRadius:"7px"},"#shared-stream-container::-webkit-scrollbar-thumb:hover":{transition:"all ease-in-out 0.3s",background:"var(--color3)"},"#playerUI, #videoElementParent":{position:"absolute",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",top:0,right:0,bottom:0,left:0,margin:"auto",boxSizing:"border-box",pointerEvents:"all"},"#streamingVideo":{maxWidth:"100%",maxHeight:"100%",boxSizing:"border-box",background:"#18181A"},"#uiFeatures #controls":{top:"auto",left:"auto",bottom:"10px",right:"20px",display:"flex",flexDirection:"column-reverse"},"#uiFeatures #connection":{bottom:"5px",left:"10px",width:"2.5rem",heihgt:"2.5rem"},"#uiFeatures button":{backgroundColor:"var(--color12)",border:"none",position:"relative",width:"45px",height:"45px",padding:"0.5rem",textAlign:"center",cursor:"pointer",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",boxShadow:"0px 0px 24px 0px var(--colorBoxShadow)",borderRadius:"3px",outline:"none"},"#uiFeatures button:hover, #uiFeatures button:active":{padding:"0 !important",border:"none"},"#uiFeatures button #audioIconMuted, #uiFeatures button #audioIconUnmuted, #uiFeatures button #micIconMuted, #uiFeatures button #micIconUnmuted":{width:"31px",height:"28px"},"#uiFeatures button #maximizeIcon, #uiFeatures button #minimizeIcon":{width:"25px",height:"25px"},"#stopIcon, #playIcon":{width:"30px",height:"30px"},"#uiFeatures button .tooltiptext":{right:"125%",left:"auto",boxShadow:"0px 0px 24px 0px var(--colorBoxShadow)",borderRadius:"3px",backgroundColor:"var(--color12)",width:"95px",visibility:"hidden!important"},"@media (hover: hover) and (pointer: fine)":{"#uiFeatures button:hover .tooltiptext":{visibility:"visible!important"}},"#controls>*":{marginBottom:"0.5rem",display:"block",lineHeight:"1.75rem",padding:"0.5rem",backgroundColor:"var(--color12)"},"#uiFeatures #settingsIcon, #uiFeatures #statsIcon":{width:"27px",height:"27px"},".svgIcon":{fill:"var(--color13)"},"#uiFeatures button:hover .svgIcon, #uiFeatures button:active .svgIcon":{fill:"var(--color12)"},".tgl-switch .tgl-slider, .tgl-flat:checked+.tgl-slider":{border:"3px solid transparent"},".tgl-switch .tgl-slider":{background:"none"},".tgl-switch .tgl-slider::before":{content:"''",display:"block",background:"var(--color6)",position:"absolute",height:"50%",width:"90%",borderRadius:"5px",margin:"auto",top:"0",bottom:"0",left:"0",right:"0"},".tgl-switch .tgl-slider::after":{height:"13px",width:"13px",borderRadius:"50%",top:"-2px",left:"-1%"},".tgl-flat:checked+.tgl-slider:after":{left:"62%",background:"var(--color3)"},".form-control":{backgroundColor:"transparent",border:"1px solid var(--color13)",borderRadius:"2px",color:"var(--color13)",textAlign:"left",fontFamily:"inherit",padding:"5px 15px "},".btn-flat":{background:"var(--color3)",color:"var(--color12)",border:"none",padding:"7px 50px",cursor:"pointer",borderRadius:"4px",textTransform:"uppercase",minWidth:"175px"},".btn-flat:disabled":{background:"var(--color7)",borderColor:"var(--color3)",color:"var(--color3)",cursor:"default"},".btn-flat:focus":{outline:"none"},".arcware-logo-loader":{position:"relative",display:"block",width:"12.5%",height:"12.5%"},"#playOverlay img#playButton":{width:"5%"},"#disconnectOverlay, #errorOverlay":{textTransform:"initial",textAlign:"center",fontSize:"20px",lineHeight:2.5},"#disconnectOverlay .clickableState":{textTransform:"initial",textAlign:"center",color:"#DAF693",padding:"5px",fontSize:"18px",border:"1px solid #DAF693",margin:"25px auto 0",width:"180px"},"#afkOverlay":{background:"none",transition:"all ease-in-out 0.5s",opacity:1,pointerEvents:"initial"},"#afkOverlayInner":{textTransform:"initial",background:"#18181A",padding:"20px 10px 30px",fontSize:"18px",width:"360px",textAlign:"center",lineHeight:2.5},"#afkOverlayInner center::first-line":{textTransform:"uppercase",color:"#FF8461",fontWeight:"bold",fontSize:"24px"},"#afkOverlayInner #afkCountDownNumber":{color:"#DAF693",fontSize:"26px",lineHeight:"22px"},"#afkOverlayInner center .retry-button":{textTransform:"initial",textAlign:"center",color:"#DAF693",padding:"5px",fontSize:"18px",border:"1px solid #DAF693",margin:"25px auto 0",width:"180px"},"#connectOverlay #connectButton":{textTransform:"initial",textAlign:"center",color:"#DAF693",padding:"5px 5px 8px",fontSize:"18px",border:"1px solid #DAF693",margin:"25px auto 0",width:"180px"},"#connectOverlay .connection-text":{textTransform:"initial",textAlign:"center",margin:"25px auto 0"},"#connectOverlay .connection-text .title":{color:"#ffffff",fontSize:"18px",margin:"5px 0"},"#connectOverlay .connection-text .subtitle":{color:"#ffffff",opacity:.5,fontSize:"12px",margin:"10px 0"},"#infoOverlay.hiddenState":{display:"none"},"#disconnectOverlay, #playOverlay, #errorOverlay, #microphoneOverlay, #connectOverlay":{background:"#18181A",display:"flex",transition:"all ease-in-out 0.5s",opacity:1,pointerEvents:"initial"},"#microphoneOverlay":{textTransform:"initial",padding:"20px 30px",fontSize:"14px",height:"230px",width:"360px",textAlign:"center",lineHeight:1.25,position:"absolute",margin:"auto",top:"0",bottom:"0",left:"0",right:"0",justifyContent:"center",alignItems:"center",flexDirection:"column",zIndex:99999},"#microphoneOverlay .title":{fontSize:"24px",position:"relative",marginBottom:"20px",color:"#F0F0F2"},"#microphoneOverlay .title:after":{content:"''",display:"inline-block",animation:"dotty steps(1,end) 1s infinite",position:"absolute"},"#microphoneOverlay p":{margin:0,color:"#858588"},"#microphoneOverlay svg":{height:"65px",marginBottom:"15px",marginTop:"-5px"},"#microphoneOverlay .svgIcon":{fill:"#DAF693"},"#disconnectOverlay.hiddenState, #playOverlay.hiddenState, #errorOverlay.hiddenState, #afkOverlay.hiddenState, #microphoneOverlay.hiddenState":{opacity:0,pointerEvents:"none"},"#disconnectOverlay.mic-overlay-is-visible, #errorOverlay.mic-overlay-is-visible, #infoOverlay.mic-overlay-is-visible":{opacity:0,pointerEvents:"none"},"#infoOverlay.hiddenState, #connectOverlay.hiddenState":{display:"none"},"#connectOverlay":{display:"flex",flexDirection:"column-reverse",alignItems:"center",justifyContent:"center"},"#infoOverlay":{display:"none"},".love-letters-box-root":{display:"flex",position:"absolute",width:"100%",height:"100%",color:"#ffffff",justifyContent:"center",alignItems:"center",flexDirection:"column",background:"#18181A",zIndex:1},".love-letters-box-root.fade-out":{opacity:0,transition:"opacity 0.5s"},"#letters-block":{position:"absolute",top:0,left:0,right:0,bottom:0,margin:"auto",color:"#ffffff",zIndex:4,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",fontSize:"16px",textTransform:"initial",textAlign:"center"},"#letters-wrapper":{height:"77px",overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",marginTop:"10px",paddingBottom:"2px"},"#letters-wrapper p":{textAlign:"center",lineHeight:1.25,fontSize:"16px"},".letter-animation:nth-last-of-type(1)::after":{display:"inline-block",animation:"dotty steps(1,end) 1s infinite",content:"''",position:"absolute"},".letter-animation":{transition:"all 0.5s ease-in-out",transformOrigin:"bottom",margin:"0 auto"},".letter-animation-enter":{animation:"fadeInUp 0.75s ease-out"},".letter-animation-exit":{opacity:0,scale:.9,transition:"all ease-in-out 1s",margin:0},"@keyframes dotty":{"0%":{content:"''"},"25%":{content:"'.'"},"50%":{content:"'..'"},"75%":{content:"'...'"},"100%":{content:"''"}},"@keyframes fadeInUp":{from:{opacity:0,transform:" translateY(5px)",scale:.9},to:{opacity:1,transform:"translateY(0)",scale:1}},".hidden":{display:"none",opacity:0},".visible":{display:"block",opacity:1,transition:"opacity 1s ease-out"}}};class AudioIcon{constructor(){this.audioIconUnmuted=this.createAudioIconUnmuted(),this.audioIconMuted=this.createAudioIconMuted()}createAudioIconUnmuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","audioIconUnmuted"),t.setAttributeNS(null,"x","31px"),t.setAttributeNS(null,"y","28px"),t.setAttributeNS(null,"viewBox","0 0 31 28");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M21.0008,0.0720318C20.556,-0.117811,20.0379,0.0805569,19.8435,0.514827C19.6492,0.949098,19.8522,1.45512,20.297,1.6449C25.1233,3.70434,28.242,8.35761,28.2422,13.4998C28.2422,18.6423,25.1234,23.2957,20.2966,25.3551C19.8518,25.5448,19.6488,26.0508,19.8431,26.4852C19.9874,26.8077,20.3102,27,20.649,27C20.7664,27,20.8859,26.9769,21.0004,26.928C26.4674,24.5954,30,19.3246,30,13.4997C29.9998,7.67531,26.4674,2.40462,21.0008,0.0720318Z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M21.2351,6.69434C20.8735,6.37822,20.3179,6.4082,19.9941,6.76134C19.6703,7.11454,19.701,7.65706,20.0627,7.97324C21.6712,9.37932,22.5937,11.3937,22.5937,13.5C22.5937,15.6062,21.6711,17.6206,20.0627,19.0267C19.701,19.3428,19.6703,19.8854,19.9941,20.2386C20.1677,20.4279,20.4079,20.5244,20.6492,20.5244C20.8579,20.5244,21.0674,20.4522,21.2351,20.3056C23.2157,18.5744,24.3515,16.0937,24.3515,13.4999C24.3515,10.9061,23.2156,8.42553,21.2351,6.69434Z");const s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttributeNS(null,"d","M15.3973,2.16277C15.1018,2.01658,14.7473,2.04502,14.4803,2.23623L7.65176,7.12598H0.878906C0.393516,7.12598,0,7.51024,0,7.98422V19.0155C0,19.4895,0.393516,19.8738,0.878906,19.8738H7.6517L14.4802,24.7637C14.6339,24.8737,14.8164,24.9298,15.0001,24.9298C15.1356,24.9298,15.2718,24.8992,15.3973,24.8371C15.6927,24.6909,15.8789,24.395,15.8789,24.0716V2.9282C15.8789,2.60482,15.6927,2.30884,15.3973,2.16277ZM14.121,22.3778L8.45918,18.3234C8.30842,18.2154,8.12637,18.1572,7.93939,18.1572H1.75781V8.84246H7.93939C8.12631,8.84246,8.30842,8.78422,8.45912,8.67636L14.121,4.62197V22.3778Z"),r.appendChild(n),r.appendChild(i),r.appendChild(s),t}createAudioIconMuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","audioIconMuted"),t.setAttributeNS(null,"x","31px"),t.setAttributeNS(null,"y","28px"),t.setAttributeNS(null,"viewBox","0 -1 31 28");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"d","M16.3501,0.829286C16.046,0.678799,15.6811,0.708072,15.4062,0.904912L8.37681,5.93848H1.40476C0.90509,5.93848,0.5,6.33404,0.5,6.82196V18.1777C0.5,18.6657,0.90509,19.0612,1.40476,19.0612H8.37675L15.4061,24.0949C15.5643,24.2082,15.7522,24.2659,15.9412,24.2659C16.0808,24.2659,16.221,24.2344,16.3501,24.1705C16.6542,24.02,16.8459,23.7154,16.8459,23.3825V1.61724C16.8459,1.28434,16.6542,0.979655,16.3501,0.829286ZM15.0364,21.6389L9.20798,17.4652C9.05278,17.3541,8.86538,17.2942,8.6729,17.2942H2.30951V7.70544H8.6729C8.86532,7.70544,9.05278,7.64548,9.20792,7.53446L15.0364,3.36082V21.6389Z");const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d","M25.2799,11.7634L21.8442,8.32748C21.6206,8.10399,21.6206,7.74264,21.8442,7.51915C22.0676,7.29566,22.429,7.29566,22.6525,7.51915L26.0883,10.955L29.524,7.51915C29.7476,7.29566,30.1088,7.29566,30.3323,7.51915C30.5559,7.74264,30.5559,8.10399,30.3323,8.32748L26.8966,11.7634L30.3323,15.1992C30.5559,15.4227,30.5559,15.7841,30.3323,16.0076C30.2209,16.1191,30.0745,16.1751,29.9281,16.1751C29.7818,16.1751,29.6355,16.1191,29.524,16.0076L26.0883,12.5717L22.6525,16.0076C22.541,16.1191,22.3947,16.1751,22.2483,16.1751C22.102,16.1751,21.9556,16.1191,21.8442,16.0076C21.6206,15.7841,21.6206,15.4227,21.8442,15.1992L25.2799,11.7634Z"),r.appendChild(n),r.appendChild(i),t}}class AudioButton{constructor(e){this.stream=e,this.setAudioMutedByDefault(),this.button=this.createButton(),this.audioIcon=new AudioIcon,this.tooltipText=this.createTooltipText(),this.button.appendChild(this.tooltipText),this.button.appendChild(this.audioIcon.audioIconMuted),this.button.appendChild(this.audioIcon.audioIconUnmuted),this.audioIcon.audioIconUnmuted.style.display="none",this.button.addEventListener("click",this.toggleAudio.bind(this)),this.onVolumeChange=this.onVolumeChange.bind(this);this.stream.webRtcController.videoPlayer.videoElement.addEventListener("volumechange",this.onVolumeChange.bind(this))}setAudioMutedByDefault(){const e=this.stream.videoElementParent;if(e){const t=e.querySelector("video");t&&this.stream.toggleAudio(t,!0)}}createButton(){var e;const t=document.createElement("button");return null==t||t.setAttribute("id","audioBtn"),null==t||t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Mute/Unmute",t}toggleAudio(){const e=this.stream.videoElementParent;if(e){const t=e.querySelector("video");if(t){const e=!t.muted;this.stream.toggleAudio(t,e),this.updateAudioIcon(e)}}}updateAudioIcon(e){e?(this.audioIcon.audioIconUnmuted.style.display="none",this.audioIcon.audioIconMuted.style.display="block"):(this.audioIcon.audioIconMuted.style.display="none",this.audioIcon.audioIconUnmuted.style.display="block")}get element(){return this.button}onVolumeChange(e){const t=e.target;this.updateAudioIcon(t.muted)}}class MicIcon{constructor(){this.micIconUnmuted=this.createMicIconUnmuted(),this.micIconMuted=this.createMicIconMuted()}createMicIconUnmuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","micIconUnmuted"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M12 14c1.66,0,2.99-1.34,2.99-3L15,5c0-1.66-1.34-3-3-3S9,3.34,9,5v6c0,1.66,1.34,3,3,3zm5.3-3c0,3-2.54,5.1-5.3,5.1S6.7,14,6.7,11H5c0,3.41,2.72,6.23,6,6.72V21h2v-3.28c3.28-.48,6-3.3,6-6.72h-1.7z"),r.appendChild(n),t}createMicIconMuted(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","micIconMuted"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M19,11h-1.7c0,.74-.16,1.43-.43,2.05l1.23,1.23c.56-.98.9-2.09.9-3.28zm-4.02.17c0-.06.02-.11.02-.17V5c0-1.66-1.34-3-3-3S9,3.34,9,5v.18l5.98,5.99zM4.27,3,3,4.27l6.01,6.01V11c0,1.66,1.33,3,2.99,3,.22,0,.44-.03.65-.08l1.66,1.66c-.71.33-1.5.52-2.31.52-2.76,0-5.3-2.1-5.3-5.1H5c0,3.41,2.72,6.23,6,6.72V21h2v-3.28c.91-.13,1.77-.45,2.54-.9L19.73,21,21,19.73,4.27,3z"),r.appendChild(n),t}}class MicButton{constructor(e){this.stream=e,this.setMicMutedByDefault(),this.button=this.createButton(),this.micIcon=new MicIcon,this.tooltipText=this.createTooltipText(),this.button.appendChild(this.tooltipText),this.button.appendChild(this.micIcon.micIconMuted),this.button.appendChild(this.micIcon.micIconUnmuted),this.micIcon.micIconUnmuted.style.display="none",this.button.addEventListener("click",this.toggleMic.bind(this))}setMicMutedByDefault(){const e=this.stream.videoElementParent;if(e){e.querySelector("video")&&this.stream.toggleMic(!1,!0)}}createButton(){var e;const t=document.createElement("button");return t.setAttribute("id","micBtn"),t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Mic on/off",t}toggleMic(){var e,t;const r=null===(t=null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.isFlagEnabled(Ot.UseMic);this.stream.toggleMic(!r,!1),this.updateMicIcon(!r)}updateMicIcon(e){e?(this.micIcon.micIconMuted.style.display="none",this.micIcon.micIconUnmuted.style.display="block"):(this.micIcon.micIconUnmuted.style.display="none",this.micIcon.micIconMuted.style.display="block")}get element(){return this.button}}class StopIcon{constructor(){this.stopIcon=this.createStopIcon()}createStopIcon(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","stopIcon"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 -1 24 24");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),null==t||t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M6 6h12v12H6z"),r.appendChild(n),t}}class PlayIcon{constructor(){this.playIcon=this.createPlayIcon()}createPlayIcon(){var e;const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"id","playIcon"),t.setAttributeNS(null,"x","24px"),t.setAttributeNS(null,"y","24px"),t.setAttributeNS(null,"viewBox","0 0 24 24");const r=document.createElementNS("http://www.w3.org/2000/svg","g");null===(e=null==r?void 0:r.classList)||void 0===e||e.add("svgIcon"),t.appendChild(r);const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttributeNS(null,"d","M8 5v14l11-7z"),r.appendChild(n),t}}class StopButton{constructor(e){this.isStreaming=!0,this.stream=e,this.button=this.createButton(),this.stopIcon=new StopIcon,this.playIcon=new PlayIcon,this.tooltipText=this.createTooltipText(),this.button.appendChild(this.tooltipText),this.button.appendChild(this.stopIcon.stopIcon),this.button.addEventListener("click",this.toggleStreaming.bind(this)),e.onStreamingStateChange(this.updateButtonState.bind(this))}createButton(){var e;const t=document.createElement("button");return null==t||t.setAttribute("id","stopBtn"),null==t||t.setAttribute("type","button"),null===(e=null==t?void 0:t.classList)||void 0===e||e.add("UiTool"),t}createTooltipText(){var e;const t=document.createElement("span");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("tooltiptext"),t.innerHTML="Disconnect",t}toggleStreaming(){var e;this.isStreaming=!this.isStreaming,this.updateButtonIcon(),this.isStreaming?null===(e=this.stream)||void 0===e||e.webRtcController.restartStreamAutomatically():this.stream.disconnect()}updateButtonIcon(){const e=this.isStreaming?this.stopIcon.stopIcon:this.playIcon.playIcon,t=this.isStreaming?"Disconnect":"Reconnect";this.tooltipText.innerHTML=t,this.button.firstChild&&this.button.removeChild(this.button.children[1]),this.button.appendChild(e)}get element(){return this.button}updateButtonState(e){this.isStreaming=e,this.updateButtonIcon()}}var _a;const TextKeyRegex=/^(\['([a-zA-Z 0-9-_]+)'\] )/;function findElementByTextContent(e,t){const r=TextKeyRegex.exec(t);if(!r)return null;const n=t.replace(r[1],""),i=r[2].trim(),s=(e||document).querySelectorAll(n);let a=null;return s.forEach((e=>{var t;null==e||e.innerHTML.trim(),!a&&(null===(t=null==e?void 0:e.innerHTML)||void 0===t?void 0:t.includes(`>${i}<`))&&(a=e)})),a}const removals={"#StreamerId":!0,"#ss":!0,"#TimeoutIfIdle":!0,"#OfferToReceive":!0,"#preferSFU":!0,"#ForceTURN":!0,"#LightMode":!0,"#UseMic":!0,"#MatchViewportRes":!0,"#HoveringMouse":!0,"['AFK timeout'] div.setting.form-group:not([id])":!0,"['Encoder'] section.settingsContainer:not([id])":!0,"['WebRTC'] section.settingsContainer:not([id])":!0,"['UI'] section.settingsContainer:not([id])":!0,"#StartVideoMuted":!0};function remove(e,t){!0===removals[e]&&t&&(t.style.display="none")}class ArcwareApplication extends G{get rootElement(){return super.rootElement}constructor(e){var t,r,n,i,s,a,o,l,c,h,d,u;super(e),this.responseCallback=null,this.ArcwareSection=this.configUI.buildSectionWithHeading(this.settingsPanel.settingsContentElement,"Arcware Cloud"),this.stream=null==e?void 0:e.stream,this.emitUIInteraction=this.emitUIInteraction.bind(this),this.adjustSettingsPanel(),this.createAudioToggleButton(),this.createMicToggleButton(),this.createStopButton(),this.applyArcwareStyles(),this.videoElementParent=null===(t=null==this?void 0:this.stream)||void 0===t?void 0:t.videoElementParent,this.parentElement=null===(r=null==this?void 0:this.videoElementParent)||void 0===r?void 0:r.parentElement,this.webRtcController=null===(n=null==this?void 0:this.stream)||void 0===n?void 0:n._webRtcController,null===(s=null===(i=null==this?void 0:this.stream)||void 0===i?void 0:i.loveLetterHandler)||void 0===s||s.add((e=>{var t,r,n;if((null==this?void 0:this.playOverlay)&&e&&(null==this?void 0:this.parentElement)){const i=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#infoOverlay");if(i){null===(r=null==i?void 0:i.classList)||void 0===r||r.remove("hiddenState");const t=null==i?void 0:i.querySelector("#messageOverlayInner");t&&(t.innerHTML=null===(n=null==e?void 0:e.reason)||void 0===n?void 0:n.replace("LL: ",""))}}})),null===(a=null==this?void 0:this.stream)||void 0===a||a.addResponseEventListener("ue-response",(e=>null==this?void 0:this.applicationResponse(e))),null===(l=null===(o=null==this?void 0:this.stream)||void 0===o?void 0:o.sessionIdHandler)||void 0===l||l.add((e=>{var t;null===(t=null==this?void 0:this.statsPanel)||void 0===t||t.addOrUpdateStat("sessionId","SessionId",e)})),null===(h=null===(c=null==this?void 0:this.stream)||void 0===c?void 0:c.videoInitializedHandler)||void 0===h||h.add((()=>{var e,t,r;null===(e=null==this?void 0:this.currentOverlay)||void 0===e||e.hide(),(null===(t=null==this?void 0:this.stream)||void 0===t?void 0:t.streamInfo)&&(null==this||this.autoPlayHandler(null===(r=null==this?void 0:this.stream)||void 0===r?void 0:r.streamInfo))}));null===(u=null===(d=null==this?void 0:this.stream)||void 0===d?void 0:d.videoInitializedHandler)||void 0===u||u.add((()=>{null==this||this.uiDefaultButtonVisibilty("fullscreenButton","#fullscreen-btn"),null==this||this.uiDefaultButtonVisibilty("settingsButton","#settingsBtn"),null==this||this.uiDefaultButtonVisibilty("infoButton","#statsBtn"),null==this||this.uiDefaultButtonVisibilty("audioButton","#audioBtn"),null==this||this.uiDefaultButtonVisibilty("stopButton","#stopBtn"),null==this||this.uiDefaultButtonVisibilty("connectionStrengthIcon","#connection"),null==this||this.uiDefaultButtonVisibilty("micButton","#micBtn"),this.uiElementsVisibility(!0)}).bind(this)),this.uiElementsVisibility(!1),this.addTextToConnectOverlay(),this.preventDefaultKeyboardEvents()}uiElementsVisibility(e){var t,r,n,i,s,a,o,l,c,h;const d=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#controls");d&&(e?(null===(r=null==d?void 0:d.classList)||void 0===r||r.remove("hidden"),null===(n=null==d?void 0:d.classList)||void 0===n||n.add("visible")):(null===(i=null==d?void 0:d.classList)||void 0===i||i.remove("visible"),null===(s=null==d?void 0:d.classList)||void 0===s||s.add("hidden")));const u=null===(a=null==this?void 0:this.parentElement)||void 0===a?void 0:a.querySelector("#connection");u&&(e?(null===(o=null==u?void 0:u.classList)||void 0===o||o.remove("hidden"),null===(l=null==u?void 0:u.classList)||void 0===l||l.add("visible")):(null===(c=null==u?void 0:u.classList)||void 0===c||c.remove("visible"),null===(h=null==u?void 0:u.classList)||void 0===h||h.add("hidden")))}adjustSettingsPanel(){var e,t,r,n,i,s,a,o,l,c,h,d,u,p;const f=null===(e=null==this?void 0:this.ArcwareSection)||void 0===e?void 0:e.parentElement;f&&(null==f||f.removeChild(null==this?void 0:this.ArcwareSection),null==f||f.insertBefore(null==this?void 0:this.ArcwareSection,null==f?void 0:f.firstChild));const m=null===(t=null==this?void 0:this.settingsPanel)||void 0===t?void 0:t.settingsContentElement;if(m){m.style.minWidth="400px";for(const e in removals)if(TextKeyRegex.test(e)){remove(e,findElementByTextContent(m,e))}else{remove(e,m.querySelector(e))}const e=findElementByTextContent(m,"['Restart Stream'] section > div.setting");if(e){const t=null==e?void 0:e.querySelector("div");t&&(t.textContent="Reconnect to Stream");const r=null==e?void 0:e.querySelector("label > input");r&&(r.value="reconnect")}}{const e=document.createElement("div");null===(r=null==e?void 0:e.classList)||void 0===r||r.add("setting"),e.textContent="Keep in mind, these settings will be applied in your current session only.",e.style.paddingBottom="15px",null===(n=null==this?void 0:this.ArcwareSection)||void 0===n||n.appendChild(e)}null===(i=null==this?void 0:this.ArcwareSection)||void 0===i||i.appendChild(new ot(new ts(null===(s=null==ArcwareApplication?void 0:ArcwareApplication.Flags)||void 0===s?void 0:s.noSession,"Disable SessionId","Disable sessionId based reconnection.",null===(o=null===(a=null==this?void 0:this.stream)||void 0===a?void 0:a.session)||void 0===o?void 0:o.noSession,!0)).rootElement),null===(l=null==this?void 0:this.ArcwareSection)||void 0===l||l.appendChild(new rt(new rs("signalling-url","Signalling URL","Signalling URL",`${null===(h=null===(c=null==this?void 0:this.stream)||void 0===c?void 0:c.config)||void 0===h?void 0:h.getTextSettingValue("ss")}?${null===(p=null===(u=null===(d=null==this?void 0:this.stream)||void 0===d?void 0:d.config)||void 0===u?void 0:u.urlFlags)||void 0===p?void 0:p.slice(1)}`,!1)).rootElement)}createAudioToggleButton(){var e;const t=new AudioButton(null==this?void 0:this.stream),r=(null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.videoElementParent).parentElement;if(r){const e=null==r?void 0:r.querySelector("#uiFeatures");if(e){const r=null==e?void 0:e.querySelector("#controls");r&&(null==r||r.appendChild(null==t?void 0:t.element))}}}createMicToggleButton(){var e;const t=new MicButton(null==this?void 0:this.stream),r=(null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.videoElementParent).parentElement;if(r){const e=null==r?void 0:r.querySelector("#uiFeatures");if(e){const r=null==e?void 0:e.querySelector("#controls");r&&(null==r||r.appendChild(null==t?void 0:t.element))}}}createStopButton(){var e,t,r,n;if(!0===(null===(r=null===(t=null===(e=this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.settings)||void 0===r?void 0:r.stopButton)){const e=new StopButton(null==this?void 0:this.stream),t=(null===(n=null==this?void 0:this.stream)||void 0===n?void 0:n.videoElementParent).parentElement;if(t){const r=null==t?void 0:t.querySelector("#uiFeatures");if(r){const t=null==r?void 0:r.querySelector("#controls");t&&(null==t||t.appendChild(null==e?void 0:e.element))}}}}uiDefaultButtonVisibilty(e,t){var r,n,i;if(null==this?void 0:this.parentElement){const s=null===(r=null==this?void 0:this.parentElement)||void 0===r?void 0:r.querySelector(t);if(!1===(null===(i=null===(n=null==this?void 0:this.stream)||void 0===n?void 0:n.config)||void 0===i?void 0:i.settings[e])&&s){null==s||s.remove();const t=this.uiFeaturesElement,r=t.querySelector("#stats-panel"),n=t.querySelector("#settings-panel");t&&("infoButton"===e&&(null==r||r.remove()),"settingsButton"===e&&(null==n||n.remove()))}const a=/iPad|iPhone|iPod/.test(null===navigator||void 0===navigator?void 0:navigator.userAgent);"fullscreenButton"===e&&a&&s&&(null==s||s.remove())}}preventDefaultKeyboardEvents(){if(this.videoElementParent){this.videoElementParent.addEventListener("keydown",(function(e){"Tab"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),e.stopPropagation())}),!0);this.uiFeaturesElement.querySelectorAll("button").forEach((e=>{e.addEventListener("keydown",(function(t){" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),e.blur())}))}))}}autoPlayHandler(e){var t;const{videoPlayer:r}=null==this?void 0:this.webRtcController,n=null===(t=null==e?void 0:e.streamInfo)||void 0===t?void 0:t.autoPlay,i=null==r?void 0:r.isPaused();if(n&&i&&r){const e=null==r?void 0:r.getVideoElement();if(e){const t=null==e?void 0:e.parentElement;if(t){const e=null==t?void 0:t.querySelector("#playOverlay");e&&(null==e||e.remove())}null==e||e.play()}}}getApplicationResponse(e){var t;null===(t=null==this?void 0:this.stream)||void 0===t||t.addResponseEventListener("ue-response",(t=>{e(t)}))}applicationResponse(e){(null==this?void 0:this.responseCallback)&&(null==this||this.responseCallback(e))}applyArcwareStyles(){const e=new st(ArcwareStyles);null==e||e.applyStyleSheet()}emitUIInteraction(e){var t;e&&(null===(t=null==this?void 0:this.webRtcController)||void 0===t||t.emitUIInteraction(e))}addTextToConnectOverlay(){var e,t,r,n;if(!(null===(r=null===(t=null===(e=null==this?void 0:this.stream)||void 0===e?void 0:e.config)||void 0===t?void 0:t.initialSettings)||void 0===r?void 0:r.AutoConnect)&&this.videoElementParent){const e=null===(n=null==this?void 0:this.parentElement)||void 0===n?void 0:n.querySelector("#connectOverlay");if(e){const t=document.createElement("div");t.className="connection-text",e.appendChild(t);const r=document.createElement("p");r.className="title",r.textContent="Click on the button below to start the connection to the streaming.",t.appendChild(r);const n=document.createElement("p");n.className="subtitle",n.textContent="After clicking the button, it may take a few seconds for the connection to start. Don't worry if you don't see an immediate reaction.",t.appendChild(n)}}}}ArcwareApplication.Flags=(_a=class{},__setFunctionName(_a,"Flags"),_a.noSession="noSession",_a);var $$4=_export,uncurryThis$7=functionUncurryThisClause,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,toLength=toLength$3,toString$2=toString$8,notARegExp=notARegexp,requireObjectCoercible$1=requireObjectCoercible$8,correctIsRegExpLogic=correctIsRegexpLogic,nativeStartsWith=uncurryThis$7("".startsWith),stringSlice$2=uncurryThis$7("".slice),min=Math.min,CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic("startsWith"),MDN_POLYFILL_BUG=!(CORRECT_IS_REGEXP_LOGIC||(descriptor=getOwnPropertyDescriptor$1(String.prototype,"startsWith"),!descriptor||descriptor.writable)),descriptor;$$4({target:"String",proto:!0,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{startsWith:function(e){var t=toString$2(requireObjectCoercible$1(this));notARegExp(e);var r=toLength(min(arguments.length>1?arguments[1]:void 0,t.length)),n=toString$2(e);return nativeStartsWith?nativeStartsWith(t,n,r):stringSlice$2(t,r,r+n.length)===n}});var iterators={},fails$5=fails$l,correctPrototypeGetter=!fails$5((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$4=hasOwnProperty_1,isCallable$5=isCallable$j,toObject$2=toObject$5,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(e){var t=toObject$2(e);if(hasOwn$4(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$5(r)&&t instanceof r?r.prototype:t instanceof $Object?ObjectPrototype:null},fails$4=fails$l,isCallable$4=isCallable$j,isObject$1=isObject$8,getPrototypeOf$1=objectGetPrototypeOf,defineBuiltIn$5=defineBuiltIn$8,wellKnownSymbol$7=wellKnownSymbol$g,ITERATOR$6=wellKnownSymbol$7("iterator"),BUGGY_SAFARI_ITERATORS$1=!1,IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator;[].keys&&(arrayIterator=[].keys(),"next"in arrayIterator?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$1(getPrototypeOf$1(arrayIterator)),PrototypeOfArrayIteratorPrototype!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype)):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$1(IteratorPrototype$2)||fails$4((function(){var e={};return IteratorPrototype$2[ITERATOR$6].call(e)!==e}));NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={}),isCallable$4(IteratorPrototype$2[ITERATOR$6])||defineBuiltIn$5(IteratorPrototype$2,ITERATOR$6,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},defineProperty$3=objectDefineProperty.f,hasOwn$3=hasOwnProperty_1,wellKnownSymbol$6=wellKnownSymbol$g,TO_STRING_TAG$1=wellKnownSymbol$6("toStringTag"),setToStringTag$4=function(e,t,r){e&&!r&&(e=e.prototype),e&&!hasOwn$3(e,TO_STRING_TAG$1)&&defineProperty$3(e,TO_STRING_TAG$1,{configurable:!0,value:t})},IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$1=objectCreate,createPropertyDescriptor$2=createPropertyDescriptor$5,setToStringTag$3=setToStringTag$4,Iterators$4=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,n){var i=t+" Iterator";return e.prototype=create$1(IteratorPrototype$1,{next:createPropertyDescriptor$2(+!n,r)}),setToStringTag$3(e,i,!1),Iterators$4[i]=returnThis$1,e},uncurryThis$6=functionUncurryThis,aCallable$2=aCallable$4,functionUncurryThisAccessor=function(e,t,r){try{return uncurryThis$6(aCallable$2(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},isCallable$3=isCallable$j,$String=String,$TypeError$3=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$3(e))return e;throw $TypeError$3("Can't set "+$String(e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$6=anObject$e,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThisAccessor(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject$6(r),aPossiblePrototype(n),t?e(r,n):r.__proto__=n,r}}():void 0),$$3=_export,call$7=functionCall,FunctionName=functionName,isCallable$2=isCallable$j,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf=objectSetPrototypeOf,setToStringTag$2=setToStringTag$4,createNonEnumerableProperty$1=createNonEnumerableProperty$5,defineBuiltIn$4=defineBuiltIn$8,wellKnownSymbol$5=wellKnownSymbol$g,Iterators$3=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$5=wellKnownSymbol$5("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,n,i,s,a){createIteratorConstructor$1(r,t,n);var o,l,c,h=function(e){if(e===i&&m)return m;if(!BUGGY_SAFARI_ITERATORS&&e in p)return p[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",u=!1,p=e.prototype,f=p[ITERATOR$5]||p["@@iterator"]||i&&p[i],m=!BUGGY_SAFARI_ITERATORS&&f||h(i),g="Array"==t&&p.entries||f;if(g&&(o=getPrototypeOf(g.call(new e)))!==Object.prototype&&o.next&&(getPrototypeOf(o)!==IteratorPrototype&&(setPrototypeOf?setPrototypeOf(o,IteratorPrototype):isCallable$2(o[ITERATOR$5])||defineBuiltIn$4(o,ITERATOR$5,returnThis)),setToStringTag$2(o,d,!0)),PROPER_FUNCTION_NAME$1&&i==VALUES&&f&&f.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME?createNonEnumerableProperty$1(p,"name",VALUES):(u=!0,m=function(){return call$7(f,this)})),i)if(l={values:h(VALUES),keys:s?m:h(KEYS),entries:h(ENTRIES)},a)for(c in l)(BUGGY_SAFARI_ITERATORS||u||!(c in p))&&defineBuiltIn$4(p,c,l[c]);else $$3({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||u},l);return p[ITERATOR$5]!==m&&defineBuiltIn$4(p,ITERATOR$5,m,{name:i}),Iterators$3[t]=m,l},createIterResultObject$2=function(e,t){return{value:e,done:t}},toIndexedObject=toIndexedObject$5,addToUnscopables=addToUnscopables$2,Iterators$2=iterators,InternalStateModule$3=internalState,defineProperty$2=objectDefineProperty.f,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$2,DESCRIPTORS$4=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$3=InternalStateModule$3.set,getInternalState$1=InternalStateModule$3.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",(function(e,t){setInternalState$3(this,{type:ARRAY_ITERATOR,target:toIndexedObject(e),index:0,kind:t})}),(function(){var e=getInternalState$1(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,createIterResultObject$1(void 0,!0)):createIterResultObject$1("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),values=Iterators$2.Arguments=Iterators$2.Array;if(addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries"),DESCRIPTORS$4&&"values"!==values.name)try{defineProperty$2(values,"name",{value:"values"})}catch(e){}var domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},documentCreateElement=documentCreateElement$2,classList=documentCreateElement("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,global$3=global$g,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty=createNonEnumerableProperty$5,wellKnownSymbol$4=wellKnownSymbol$g,ITERATOR$4=wellKnownSymbol$4("iterator"),TO_STRING_TAG=wellKnownSymbol$4("toStringTag"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function(e,t){if(e){if(e[ITERATOR$4]!==ArrayValues)try{createNonEnumerableProperty(e,ITERATOR$4,ArrayValues)}catch(t){e[ITERATOR$4]=ArrayValues}if(e[TO_STRING_TAG]||createNonEnumerableProperty(e,TO_STRING_TAG,t),DOMIterables[t])for(var r in ArrayIteratorMethods)if(e[r]!==ArrayIteratorMethods[r])try{createNonEnumerableProperty(e,r,ArrayIteratorMethods[r])}catch(t){e[r]=ArrayIteratorMethods[r]}}};for(var COLLECTION_NAME in DOMIterables)handlePrototype(global$3[COLLECTION_NAME]&&global$3[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");var charAt$2=stringMultibyte.charAt,toString$1=toString$8,InternalStateModule$2=internalState,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$2,STRING_ITERATOR="String Iterator",setInternalState$2=InternalStateModule$2.set,getInternalState=InternalStateModule$2.getterFor(STRING_ITERATOR);defineIterator(String,"String",(function(e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString$1(e),index:0})}),(function(){var e,t=getInternalState(this),r=t.string,n=t.index;return n>=r.length?createIterResultObject(void 0,!0):(e=charAt$2(r,n),t.index+=e.length,createIterResultObject(e,!1))}));var fails$3=fails$l,wellKnownSymbol$3=wellKnownSymbol$g,DESCRIPTORS$3=descriptors,IS_PURE=isPure,ITERATOR$3=wellKnownSymbol$3("iterator"),urlConstructorDetection=!fails$3((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),IS_PURE&&!e.toJSON||!t.size&&(IS_PURE||!DESCRIPTORS$3)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$3]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),uncurryThis$5=functionUncurryThisClause,aCallable$1=aCallable$4,NATIVE_BIND=functionBindNative,bind$3=uncurryThis$5(uncurryThis$5.bind),functionBindContext=function(e,t){return aCallable$1(e),void 0===t?e:NATIVE_BIND?bind$3(e,t):function(){return e.apply(t,arguments)}},makeBuiltIn=makeBuiltIn$3.exports,defineProperty$1=objectDefineProperty,defineBuiltInAccessor$2=function(e,t,r){return r.get&&makeBuiltIn(r.get,t,{getter:!0}),r.set&&makeBuiltIn(r.set,t,{setter:!0}),defineProperty$1.f(e,t,r)},isPrototypeOf$1=objectIsPrototypeOf,$TypeError$2=TypeError,anInstance$2=function(e,t){if(isPrototypeOf$1(t,e))return e;throw $TypeError$2("Incorrect invocation")},DESCRIPTORS$2=descriptors,uncurryThis$4=functionUncurryThis,call$6=functionCall,fails$2=fails$l,objectKeys=objectKeys$2,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$1=toObject$5,IndexedObject=indexedObject,$assign=Object.assign,defineProperty=Object.defineProperty,concat=uncurryThis$4([].concat),objectAssign=!$assign||fails$2((function(){if(DESCRIPTORS$2&&1!==$assign({b:1},$assign(defineProperty({},"a",{enumerable:!0,get:function(){defineProperty(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys($assign({},t)).join("")!=n}))?function(e,t){for(var r=toObject$1(e),n=arguments.length,i=1,s=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;n>i;)for(var o,l=IndexedObject(arguments[i++]),c=s?concat(objectKeys(l),s(l)):objectKeys(l),h=c.length,d=0;h>d;)o=c[d++],DESCRIPTORS$2&&!call$6(a,l,o)||(r[o]=l[o]);return r}:$assign,call$5=functionCall,anObject$5=anObject$e,getMethod$2=getMethod$5,iteratorClose$1=function(e,t,r){var n,i;anObject$5(e);try{if(!(n=getMethod$2(e,"return"))){if("throw"===t)throw r;return r}n=call$5(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return anObject$5(n),r},anObject$4=anObject$e,iteratorClose=iteratorClose$1,callWithSafeIterationClosing$1=function(e,t,r,n){try{return n?t(anObject$4(r)[0],r[1]):t(r)}catch(t){iteratorClose(e,"throw",t)}},wellKnownSymbol$2=wellKnownSymbol$g,Iterators$1=iterators,ITERATOR$2=wellKnownSymbol$2("iterator"),ArrayPrototype=Array.prototype,isArrayIteratorMethod$1=function(e){return void 0!==e&&(Iterators$1.Array===e||ArrayPrototype[ITERATOR$2]===e)},uncurryThis$3=functionUncurryThis,fails$1=fails$l,isCallable$1=isCallable$j,classof$2=classof$6,getBuiltIn=getBuiltIn$4,inspectSource=inspectSource$2,noop=function(){},empty=[],construct=getBuiltIn("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$2=uncurryThis$3(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$1(e))return!1;try{return construct(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$1(e))return!1;switch(classof$2(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$2(constructorRegExp,inspectSource(e))}catch(e){return!0}};isConstructorLegacy.sham=!0;var isConstructor$1=!construct||fails$1((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,toPropertyKey=toPropertyKey$3,definePropertyModule=objectDefineProperty,createPropertyDescriptor$1=createPropertyDescriptor$5,createProperty$2=function(e,t,r){var n=toPropertyKey(t);n in e?definePropertyModule.f(e,n,createPropertyDescriptor$1(0,r)):e[n]=r},classof$1=classof$6,getMethod$1=getMethod$5,isNullOrUndefined$1=isNullOrUndefined$5,Iterators=iterators,wellKnownSymbol$1=wellKnownSymbol$g,ITERATOR$1=wellKnownSymbol$1("iterator"),getIteratorMethod$3=function(e){if(!isNullOrUndefined$1(e))return getMethod$1(e,ITERATOR$1)||getMethod$1(e,"@@iterator")||Iterators[classof$1(e)]},call$4=functionCall,aCallable=aCallable$4,anObject$3=anObject$e,tryToString=tryToString$2,getIteratorMethod$2=getIteratorMethod$3,$TypeError$1=TypeError,getIterator$2=function(e,t){var r=arguments.length<2?getIteratorMethod$2(e):t;if(aCallable(r))return anObject$3(call$4(r,e));throw $TypeError$1(tryToString(e)+" is not iterable")},bind$2=functionBindContext,call$3=functionCall,toObject=toObject$5,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$1,isConstructor=isConstructor$1,lengthOfArrayLike$1=lengthOfArrayLike$3,createProperty$1=createProperty$2,getIterator$1=getIterator$2,getIteratorMethod$1=getIteratorMethod$3,$Array$1=Array,arrayFrom$1=function(e){var t=toObject(e),r=isConstructor(this),n=arguments.length,i=n>1?arguments[1]:void 0,s=void 0!==i;s&&(i=bind$2(i,n>2?arguments[2]:void 0));var a,o,l,c,h,d,u=getIteratorMethod$1(t),p=0;if(!u||this===$Array$1&&isArrayIteratorMethod(u))for(a=lengthOfArrayLike$1(t),o=r?new this(a):$Array$1(a);a>p;p++)d=s?i(t[p],p):t[p],createProperty$1(o,p,d);else for(h=(c=getIterator$1(t,u)).next,o=r?new this:[];!(l=call$3(h,c)).done;p++)d=s?callWithSafeIterationClosing(c,i,[l.value,p],!0):l.value,createProperty$1(o,p,d);return o.length=p,o},toAbsoluteIndex=toAbsoluteIndex$2,lengthOfArrayLike=lengthOfArrayLike$3,createProperty=createProperty$2,$Array=Array,max=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike(e),i=toAbsoluteIndex(t,n),s=toAbsoluteIndex(void 0===r?n:r,n),a=$Array(max(s-i,0)),o=0;i<s;i++,o++)createProperty(a,o,e[i]);return a.length=o,a},uncurryThis$2=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError=RangeError,exec$1=uncurryThis$2(regexSeparators.exec),floor$2=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$2("".charCodeAt),join$2=uncurryThis$2([].join),push$2=uncurryThis$2([].push),replace$2=uncurryThis$2("".replace),split$2=uncurryThis$2("".split),toLowerCase$1=uncurryThis$2("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=charCodeAt(e,r++);if(i>=55296&&i<=56319&&r<n){var s=charCodeAt(e,r++);56320==(64512&s)?push$2(t,((1023&i)<<10)+(1023&s)+65536):(push$2(t,i),r--)}else push$2(t,i)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$2(e/damp):e>>1,e+=floor$2(e/t);e>baseMinusTMin*tMax>>1;)e=floor$2(e/baseMinusTMin),n+=base;return floor$2(n+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,r,n=[],i=(e=ucs2decode(e)).length,s=initialN,a=0,o=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$2(n,fromCharCode(r));var l=n.length,c=l;for(l&&push$2(n,delimiter);c<i;){var h=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=s&&r<h&&(h=r);var d=c+1;if(h-s>floor$2((maxInt-a)/d))throw $RangeError(OVERFLOW_ERROR);for(a+=(h-s)*d,s=h,t=0;t<e.length;t++){if((r=e[t])<s&&++a>maxInt)throw $RangeError(OVERFLOW_ERROR);if(r==s){for(var u=a,p=base;;){var f=p<=o?tMin:p>=o+tMax?tMax:p-o;if(u<f)break;var m=u-f,g=base-f;push$2(n,fromCharCode(digitToBasic(f+m%g))),u=floor$2(m/g),p+=base}push$2(n,fromCharCode(digitToBasic(u))),o=adapt(a,d,c==l),a=0,c++}}a++,s++}return join$2(n,"")},stringPunycodeToAscii=function(e){var t,r,n=[],i=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<i.length;t++)r=i[t],push$2(n,exec$1(regexNonASCII,r)?"xn--"+encode(r):r);return join$2(n,".")},$TypeError=TypeError,validateArgumentsLength$2=function(e,t){if(e<t)throw $TypeError("Not enough arguments");return e},defineBuiltIn$3=defineBuiltIn$8,defineBuiltIns$1=function(e,t,r){for(var n in t)defineBuiltIn$3(e,n,t[n],r);return e},arraySlice$1=arraySliceSimple,floor$1=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$1(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$1(e,0,n),t),mergeSort(arraySlice$1(e,n),t),t)},insertionSort=function(e,t){for(var r,n,i=e.length,s=1;s<i;){for(n=s,r=e[s];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==s++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var i=t.length,s=r.length,a=0,o=0;a<i||o<s;)e[a+o]=a<i&&o<s?n(t[a],r[o])<=0?t[a++]:r[o++]:a<i?t[a++]:r[o++];return e},arraySort$1=mergeSort,$$2=_export,global$2=global$g,call$2=functionCall,uncurryThis$1=functionUncurryThis,DESCRIPTORS$1=descriptors,USE_NATIVE_URL$1=urlConstructorDetection,defineBuiltIn$2=defineBuiltIn$8,defineBuiltInAccessor$1=defineBuiltInAccessor$2,defineBuiltIns=defineBuiltIns$1,setToStringTag$1=setToStringTag$4,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$1=internalState,anInstance$1=anInstance$2,isCallable=isCallable$j,hasOwn$2=hasOwnProperty_1,bind$1=functionBindContext,classof=classof$6,anObject$2=anObject$e,isObject=isObject$8,$toString$2=toString$8,create=objectCreate,createPropertyDescriptor=createPropertyDescriptor$5,getIterator=getIterator$2,getIteratorMethod=getIteratorMethod$3,validateArgumentsLength$1=validateArgumentsLength$2,wellKnownSymbol=wellKnownSymbol$g,arraySort=arraySort$1,ITERATOR=wellKnownSymbol("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$1=InternalStateModule$1.set,getInternalParamsState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$1)return global$2[e];var t=getOwnPropertyDescriptor(global$2,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,RegExp$1=global$2.RegExp,TypeError$2=global$2.TypeError,decodeURIComponent$1=global$2.decodeURIComponent,encodeURIComponent$1=global$2.encodeURIComponent,charAt$1=uncurryThis$1("".charAt),join$1=uncurryThis$1([].join),push$1=uncurryThis$1([].push),replace$1=uncurryThis$1("".replace),shift$1=uncurryThis$1([].shift),splice=uncurryThis$1([].splice),split$1=uncurryThis$1("".split),stringSlice$1=uncurryThis$1("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent$1(e)}catch(t){return e}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent$1(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$1(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$1(e,1):e:$toString$2(e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,s,a,o,l=getIteratorMethod(e);if(l)for(r=(t=getIterator(e,l)).next;!(n=call$2(r,t)).done;){if(s=(i=getIterator(anObject$2(n.value))).next,(a=call$2(s,i)).done||(o=call$2(s,i)).done||!call$2(s,i).done)throw TypeError$2("Expected sequence with length 2");push$1(this.entries,{key:$toString$2(a.value),value:$toString$2(o.value)})}else for(var c in e)hasOwn$2(e,c)&&push$1(this.entries,{key:c,value:$toString$2(e[c])})},parseQuery:function(e){if(e)for(var t,r,n=split$1(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=split$1(t,"="),push$1(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$1(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$1(r,serialize(e.key)+"="+serialize(e.value));return join$1(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$1(this,URLSearchParamsPrototype);var e=setInternalState$1(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));DESCRIPTORS$1||(this.length=e.entries.length)},URLSearchParamsPrototype=URLSearchParamsConstructor.prototype;if(defineBuiltIns(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$1(arguments.length,2);var r=getInternalParamsState(this);push$1(r.entries,{key:$toString$2(e),value:$toString$2(t)}),DESCRIPTORS$1||this.length++,r.updateURL()},delete:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$2(e),i=0;i<r.length;)r[i].key===n?splice(r,i,1):i++;DESCRIPTORS$1||(this.length=r.length),t.updateURL()},get:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$2(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$2(e),n=[],i=0;i<t.length;i++)t[i].key===r&&push$1(n,t[i].value);return n},has:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$2(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$1(arguments.length,1);for(var r,n=getInternalParamsState(this),i=n.entries,s=!1,a=$toString$2(e),o=$toString$2(t),l=0;l<i.length;l++)(r=i[l]).key===a&&(s?splice(i,l--,1):(s=!0,r.value=o));s||push$1(i,{key:a,value:o}),DESCRIPTORS$1||(this.length=i.length),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$1(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$2(URLSearchParamsPrototype,ITERATOR,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$2(URLSearchParamsPrototype,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),DESCRIPTORS$1&&defineBuiltInAccessor$1(URLSearchParamsPrototype,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0}),setToStringTag$1(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$2({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$1&&isCallable(Headers)){var headersHas=uncurryThis$1(HeadersPrototype.has),headersSet=uncurryThis$1(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject(e)){var t,r=e.body;if(classof(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers(e.headers):new Headers,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create(e,{body:createPropertyDescriptor(0,$toString$2(r)),headers:createPropertyDescriptor(0,t)})}return e};if(isCallable(nativeFetch)&&$$2({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable(NativeRequest)){var RequestConstructor=function(e){return anInstance$1(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$2({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$1=_export,DESCRIPTORS=descriptors,USE_NATIVE_URL=urlConstructorDetection,global$1=global$g,bind=functionBindContext,uncurryThis=functionUncurryThis,defineBuiltIn$1=defineBuiltIn$8,defineBuiltInAccessor=defineBuiltInAccessor$2,anInstance=anInstance$2,hasOwn$1=hasOwnProperty_1,assign$1=objectAssign,arrayFrom=arrayFrom$1,arraySlice=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString$1=toString$8,setToStringTag=setToStringTag$4,validateArgumentsLength=validateArgumentsLength$2,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule=internalState,setInternalState=InternalStateModule.set,getInternalURLState=InternalStateModule.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$1.URL,TypeError$1=global$1.TypeError,parseInt$1=global$1.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis("".charAt),exec=uncurryThis(/./.exec),join=uncurryThis([].join),numberToString=uncurryThis(1..toString),pop=uncurryThis([].pop),push=uncurryThis([].push),replace=uncurryThis("".replace),shift=uncurryThis([].shift),split=uncurryThis("".split),stringSlice=uncurryThis("".slice),toLowerCase=uncurryThis("".toLowerCase),unshift=uncurryThis([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,EOF,parseIPv4=function(e){var t,r,n,i,s,a,o,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=l[n]))return e;if(s=10,i.length>1&&"0"==charAt(i,0)&&(s=exec(HEX_START,i)?16:8,i=stringSlice(i,8==s?1:2)),""===i)a=0;else{if(!exec(10==s?DEC:8==s?OCT:HEX,i))return e;a=parseInt$1(i,s)}push(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=pow(256,5-t))return null}else if(a>255)return null;for(o=pop(r),n=0;n<r.length;n++)o+=r[n]*pow(256,3-n);return o},parseIPv6=function(e){var t,r,n,i,s,a,o,l=[0,0,0,0,0,0,0,0],c=0,h=null,d=0,u=function(){return charAt(e,d)};if(":"==u()){if(":"!=charAt(e,1))return;d+=2,h=++c}for(;u();){if(8==c)return;if(":"!=u()){for(t=r=0;r<4&&exec(HEX,u());)t=16*t+parseInt$1(u(),16),d++,r++;if("."==u()){if(0==r)return;if(d-=r,c>6)return;for(n=0;u();){if(i=null,n>0){if(!("."==u()&&n<4))return;d++}if(!exec(DIGIT,u()))return;for(;exec(DIGIT,u());){if(s=parseInt$1(u(),10),null===i)i=s;else{if(0==i)return;i=10*i+s}if(i>255)return;d++}l[c]=256*l[c]+i,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==u()){if(d++,!u())return}else if(u())return;l[c++]=t}else{if(null!==h)return;d++,h=++c}}if(null!==h)for(a=c-h,c=7;0!=c&&a>0;)o=l[c],l[c--]=l[h+a-1],l[h+--a]=o;else if(8!=c)return;return l},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,i=0,s=0;s<8;s++)0!==e[s]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=s),++i);return i>r&&(t=n,r=i),t},serializeHost=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor(e/256);return join(t,".")}if("object"==typeof e){for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign$1({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign$1({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign$1({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return r>32&&r<127&&!hasOwn$1(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(r=charAt(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var n,i,s,a=$toString$1(e);if(t){if(i=this.parse(a))throw TypeError$1(i);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),i=this.parse(a,null,n))throw TypeError$1(i);(s=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=s}};URLState.prototype={type:"URL",parse:function(e,t,r){var n,i,s,a,o=this,l=t||SCHEME_START,c=0,h="",d=!1,u=!1,p=!1;for(e=$toString$1(e),t||(o.scheme="",o.username="",o.password="",o.host=null,o.port=null,o.path=[],o.query=null,o.fragment=null,o.cannotBeABaseURL=!1,e=replace(e,LEADING_C0_CONTROL_OR_SPACE,""),e=replace(e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),e=replace(e,TAB_AND_NEW_LINE,""),n=arrayFrom(e);c<=n.length;){switch(i=n[c],l){case SCHEME_START:if(!i||!exec(ALPHA,i)){if(t)return INVALID_SCHEME;l=NO_SCHEME;continue}h+=toLowerCase(i),l=SCHEME;break;case SCHEME:if(i&&(exec(ALPHANUMERIC,i)||"+"==i||"-"==i||"."==i))h+=toLowerCase(i);else{if(":"!=i){if(t)return INVALID_SCHEME;h="",l=NO_SCHEME,c=0;continue}if(t&&(o.isSpecial()!=hasOwn$1(specialSchemes,h)||"file"==h&&(o.includesCredentials()||null!==o.port)||"file"==o.scheme&&!o.host))return;if(o.scheme=h,t)return void(o.isSpecial()&&specialSchemes[o.scheme]==o.port&&(o.port=null));h="","file"==o.scheme?l=FILE:o.isSpecial()&&r&&r.scheme==o.scheme?l=SPECIAL_RELATIVE_OR_AUTHORITY:o.isSpecial()?l=SPECIAL_AUTHORITY_SLASHES:"/"==n[c+1]?(l=PATH_OR_AUTHORITY,c++):(o.cannotBeABaseURL=!0,push(o.path,""),l=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=i)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==i){o.scheme=r.scheme,o.path=arraySlice(r.path),o.query=r.query,o.fragment="",o.cannotBeABaseURL=!0,l=FRAGMENT;break}l="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=i||"/"!=n[c+1]){l=RELATIVE;continue}l=SPECIAL_AUTHORITY_IGNORE_SLASHES,c++;break;case PATH_OR_AUTHORITY:if("/"==i){l=AUTHORITY;break}l=PATH;continue;case RELATIVE:if(o.scheme=r.scheme,i==EOF)o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,o.path=arraySlice(r.path),o.query=r.query;else if("/"==i||"\\"==i&&o.isSpecial())l=RELATIVE_SLASH;else if("?"==i)o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,o.path=arraySlice(r.path),o.query="",l=QUERY;else{if("#"!=i){o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,o.path=arraySlice(r.path),o.path.length--,l=PATH;continue}o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,o.path=arraySlice(r.path),o.query=r.query,o.fragment="",l=FRAGMENT}break;case RELATIVE_SLASH:if(!o.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){o.username=r.username,o.password=r.password,o.host=r.host,o.port=r.port,l=PATH;continue}l=AUTHORITY}else l=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(l=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=i||"/"!=charAt(h,c+1))continue;c++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=i&&"\\"!=i){l=AUTHORITY;continue}break;case AUTHORITY:if("@"==i){d&&(h="%40"+h),d=!0,s=arrayFrom(h);for(var f=0;f<s.length;f++){var m=s[f];if(":"!=m||p){var g=percentEncode(m,userinfoPercentEncodeSet);p?o.password+=g:o.username+=g}else p=!0}h=""}else if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&o.isSpecial()){if(d&&""==h)return INVALID_AUTHORITY;c-=arrayFrom(h).length+1,h="",l=HOST}else h+=i;break;case HOST:case HOSTNAME:if(t&&"file"==o.scheme){l=FILE_HOST;continue}if(":"!=i||u){if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&o.isSpecial()){if(o.isSpecial()&&""==h)return INVALID_HOST;if(t&&""==h&&(o.includesCredentials()||null!==o.port))return;if(a=o.parseHost(h))return a;if(h="",l=PATH_START,t)return;continue}"["==i?u=!0:"]"==i&&(u=!1),h+=i}else{if(""==h)return INVALID_HOST;if(a=o.parseHost(h))return a;if(h="",l=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,i)){if(i==EOF||"/"==i||"?"==i||"#"==i||"\\"==i&&o.isSpecial()||t){if(""!=h){var y=parseInt$1(h,10);if(y>65535)return INVALID_PORT;o.port=o.isSpecial()&&y===specialSchemes[o.scheme]?null:y,h=""}if(t)return;l=PATH_START;continue}return INVALID_PORT}h+=i;break;case FILE:if(o.scheme="file","/"==i||"\\"==i)l=FILE_SLASH;else{if(!r||"file"!=r.scheme){l=PATH;continue}if(i==EOF)o.host=r.host,o.path=arraySlice(r.path),o.query=r.query;else if("?"==i)o.host=r.host,o.path=arraySlice(r.path),o.query="",l=QUERY;else{if("#"!=i){startsWithWindowsDriveLetter(join(arraySlice(n,c),""))||(o.host=r.host,o.path=arraySlice(r.path),o.shortenPath()),l=PATH;continue}o.host=r.host,o.path=arraySlice(r.path),o.query=r.query,o.fragment="",l=FRAGMENT}}break;case FILE_SLASH:if("/"==i||"\\"==i){l=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join(arraySlice(n,c),""))&&(isWindowsDriveLetter(r.path[0],!0)?push(o.path,r.path[0]):o.host=r.host),l=PATH;continue;case FILE_HOST:if(i==EOF||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&isWindowsDriveLetter(h))l=PATH;else if(""==h){if(o.host="",t)return;l=PATH_START}else{if(a=o.parseHost(h))return a;if("localhost"==o.host&&(o.host=""),t)return;h="",l=PATH_START}continue}h+=i;break;case PATH_START:if(o.isSpecial()){if(l=PATH,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=EOF&&(l=PATH,"/"!=i))continue}else o.fragment="",l=FRAGMENT;else o.query="",l=QUERY;break;case PATH:if(i==EOF||"/"==i||"\\"==i&&o.isSpecial()||!t&&("?"==i||"#"==i)){if(isDoubleDot(h)?(o.shortenPath(),"/"==i||"\\"==i&&o.isSpecial()||push(o.path,"")):isSingleDot(h)?"/"==i||"\\"==i&&o.isSpecial()||push(o.path,""):("file"==o.scheme&&!o.path.length&&isWindowsDriveLetter(h)&&(o.host&&(o.host=""),h=charAt(h,0)+":"),push(o.path,h)),h="","file"==o.scheme&&(i==EOF||"?"==i||"#"==i))for(;o.path.length>1&&""===o.path[0];)shift(o.path);"?"==i?(o.query="",l=QUERY):"#"==i&&(o.fragment="",l=FRAGMENT)}else h+=percentEncode(i,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==i?(o.query="",l=QUERY):"#"==i?(o.fragment="",l=FRAGMENT):i!=EOF&&(o.path[0]+=percentEncode(i,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=i?i!=EOF&&("'"==i&&o.isSpecial()?o.query+="%27":o.query+="#"==i?"%23":percentEncode(i,C0ControlPercentEncodeSet)):(o.fragment="",l=FRAGMENT);break;case FRAGMENT:i!=EOF&&(o.fragment+=percentEncode(i,fragmentPercentEncodeSet))}c++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn$1(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,s=e.port,a=e.path,o=e.query,l=e.fragment,c=t+":";return null!==i?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=serializeHost(i),null!==s&&(c+=":"+s)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+join(a,"/"):"",null!==o&&(c+="?"+o),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$1(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString$1(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString$1(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString$1(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString$1(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString$1(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString$1(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=$toString$1(e))?("#"==charAt(e,0)&&(e=stringSlice(e,1)),this.fragment="",this.parse(e,FRAGMENT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=anInstance(this,URLPrototype),r=validateArgumentsLength(arguments.length,1)>1?arguments[1]:void 0,n=setInternalState(t,new URLState(e,!1,r));DESCRIPTORS||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS&&(defineBuiltInAccessor(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn$1(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn$1(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn$1(URLConstructor,"createObjectURL",bind(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn$1(URLConstructor,"revokeObjectURL",bind(nativeRevokeObjectURL,NativeURL))}setToStringTag(URLConstructor,"URL"),$$1({global:!0,constructor:!0,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS},{URL:URLConstructor});var sameValue$1=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},call$1=functionCall,fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic,anObject$1=anObject$e,isNullOrUndefined=isNullOrUndefined$5,requireObjectCoercible=requireObjectCoercible$8,sameValue=sameValue$1,toString=toString$8,getMethod=getMethod$5,regExpExec=regexpExecAbstract,util,objectUtil;fixRegExpWellKnownSymbolLogic("search",(function(e,t,r){return[function(t){var r=requireObjectCoercible(this),n=isNullOrUndefined(t)?void 0:getMethod(t,e);return n?call$1(n,t,r):new RegExp(t)[e](toString(r))},function(e){var n=anObject$1(this),i=toString(e),s=r(t,n,i);if(s.done)return s.value;var a=n.lastIndex;sameValue(a,0)||(n.lastIndex=0);var o=regExpExec(n,i);return sameValue(n.lastIndex,a)||(n.lastIndex=a),null===o?-1:o.index}]})),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(util||(util={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:null===e?ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){const r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let r;switch(e.code){case ZodIssueCode.invalid_type:r=e.received===ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${util.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${util.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${util.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,util.assertNever(e)}return{message:r}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],a={...i,path:s};let o="";const l=n.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(a,{data:t,defaultError:o}).message;return{...i,path:s,message:i.message||o}},EMPTY_PATH=[];function addIssueToContext(e,t){const r=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e))});e.common.issues.push(r)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return INVALID;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t)r.push({key:await e.key,value:await e.value});return ParseStatus.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:i}=n;if("aborted"===t.status)return INVALID;if("aborted"===i.status)return INVALID;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||void 0===i.value&&!n.alwaysSet||(r[t.value]=i.value)}return{status:e.value,value:r}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>"aborted"===e.status,isDirty=e=>"dirty"===e.status,isValid=e=>"valid"===e.status,isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise;var errorUtil;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError},description:i}}class ZodType{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},i=this._parseSync({data:e,path:n.path,parent:n});return handleResult(n,i)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await(isAsync(n)?n:Promise.resolve(n));return handleResult(r,i)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const i=e(t),s=()=>n.addIssue({code:ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(s(),!1))):!!i||(s(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[a-z][a-z0-9]*$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,datetimeRegex=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):0===e.precision?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function isValidIP(e,t){return!("v4"!==t&&t||!ipv4Regex.test(e))||!("v6"!==t&&t||!ipv6Regex.test(e))}class ZodString extends ZodType{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==ZodParsedType.string){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:t.parsedType}),INVALID}const t=new ParseStatus;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const i=e.data.length>n.value,s=e.data.length<n.value;(i||s)&&(r=this._getOrReturnCtx(e,r),i?addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)emailRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"email",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"emoji",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)uuidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"uuid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)cuidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"cuid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)cuid2Regex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)ulidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"ulid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch(i){r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"url",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"regex",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){datetimeRegex(n).test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else"ip"===n.kind?isValidIP(e.data,n.version)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"ip",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()):util.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(r)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...errorUtil.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...errorUtil.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...errorUtil.errToObj(t)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==ZodParsedType.number){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:t.parsedType}),INVALID}let t;const r=new ParseStatus;for(const n of this._def.checks)if("int"===n.kind)util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==floatSafeRemainder(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_finite,message:n.message}),r.dirty()):util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,r,n){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:errorUtil.toString(n)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:t.parsedType}),INVALID}let t;const r=new ParseStatus;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,r,n){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:errorUtil.toString(n)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:t.parsedType}),INVALID}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==ZodParsedType.date){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:t.parsedType}),INVALID}if(isNaN(e.data.getTime())){return addIssueToContext(this._getOrReturnCtx(e),{code:ZodIssueCode.invalid_date}),INVALID}const t=new ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):util.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:t.parsedType}),INVALID}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:t.parsedType}),INVALID}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.null){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:t.parsedType}),INVALID}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:t.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:t.parsedType}),INVALID}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==ZodParsedType.array)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:t.parsedType}),INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;(e||i)&&(addIssueToContext(t,{code:e?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:i?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new ParseInputLazyPath(t,e,t.path,r))))).then((e=>ParseStatus.mergeArray(r,e)));const i=[...t.data].map(((e,r)=>n.type._parseSync(new ParseInputLazyPath(t,e,t.path,r))));return ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map((e=>deepPartialify(e)))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ZodParsedType.object){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||s.push(e);const a=[];for(const e of i){const t=n[e],i=r.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)a.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)s.length>0&&(addIssueToContext(r,{code:ZodIssueCode.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const n=r.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>ParseStatus.mergeObjectSync(t,e))):ParseStatus.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,s,a;const o=null!==(s=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=errorUtil.errToObj(e).message)&&void 0!==a?a:o}:{message:o}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};return util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};return util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};return util.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new ZodObject({...this._def,shape:()=>t})}required(e){const t={};return util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ZodOptional;)e=e._def.innerType;t[r]=e}})),new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new ZodError(e.ctx.common.issues)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:r}),INVALID}));{let e;const n=[];for(const i of r){const r={...t,common:{...t.common,issues:[]},parent:null},s=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new ZodError(e)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:i}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?Object.keys(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:null;class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.object)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(addIssueToContext(t,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=getDiscriminator(r.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...processCreateParams(r)})}}function mergeValues(e,t){const r=getParsedType(e),n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===ZodParsedType.object&&n===ZodParsedType.object){const r=util.objectKeys(t),n=util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),i={...e,...t};for(const r of n){const n=mergeValues(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const i=mergeValues(e[n],t[n]);if(!i.valid)return{valid:!1};r.push(i.data)}return{valid:!0,data:r}}return r===ZodParsedType.date&&n===ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(isAborted(e)||isAborted(n))return INVALID;const i=mergeValues(e.value,n.value);return i.valid?((isDirty(e)||isDirty(n))&&t.dirty(),{status:t.value,value:i.data}):(addIssueToContext(r,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ZodIntersection.create=(e,t,r)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(r)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(r.data.length<this._def.items.length)return addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&r.data.length>this._def.items.length&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new ParseInputLazyPath(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>ParseStatus.mergeArray(t,e))):ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;const n=[],i=this._def.keyType,s=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new ParseInputLazyPath(r,e,r.path,e)),value:s._parse(new ParseInputLazyPath(r,r.data[e],r.path,e))});return r.common.async?ParseStatus.mergeObjectAsync(t,n):ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(r)}:{keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.map)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:r.parsedType}),INVALID;const n=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map((([e,t],s)=>({key:n._parse(new ParseInputLazyPath(r,e,r.path,[s,"key"])),value:i._parse(new ParseInputLazyPath(r,t,r.path,[s,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of s){const n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of s){const n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,r)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(r)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.set)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:r.parsedType}),INVALID;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function s(e){const r=new Set;for(const n of e){if("aborted"===n.status)return INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const a=[...r.data.values()].map(((e,t)=>i._parse(new ParseInputLazyPath(r,e,r.path,t))));return r.common.async?Promise.all(a).then((e=>s(e))):s(a)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.function)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:t.parsedType}),INVALID;function r(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return OK((async function(...t){const a=new ZodError([]),o=await e._def.args.parseAsync(t,i).catch((e=>{throw a.addIssue(r(t,e)),a})),l=await Reflect.apply(s,this,o),c=await e._def.returns._def.type.parseAsync(l,i).catch((e=>{throw a.addIssue(n(l,e)),a}));return c}))}{const e=this;return OK((function(...t){const a=e._def.args.safeParse(t,i);if(!a.success)throw new ZodError([r(t,a.error)]);const o=Reflect.apply(s,this,a.data),l=e._def.returns.safeParse(o,i);if(!l.success)throw new ZodError([n(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(r)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});class ZodEnum extends ZodType{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{expected:util.joinValues(r),received:t.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:r}),INVALID}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return ZodEnum.create(e)}exclude(e){return ZodEnum.create(this.options.filter((t=>!e.includes(t))))}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(e){const t=util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ZodParsedType.string&&r.parsedType!==ZodParsedType.number){const e=util.objectValues(t);return addIssueToContext(r,{expected:util.joinValues(e),received:r.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(-1===t.indexOf(e.data)){const e=util.objectValues(t);return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:e}),INVALID}return OK(e.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.promise&&!1===t.common.async)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:t.parsedType}),INVALID;const r=t.parsedType===ZodParsedType.promise?t.data:Promise.resolve(t.data);return OK(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{addIssueToContext(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){const e=n.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r}))):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!isValid(e))return e;const s=n.transform(e.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>isValid(e)?Promise.resolve(n.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}util.assertNever(n)}}ZodEffects.create=(e,t,r)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(r)}),ZodEffects.createWithPreprocess=(e,t,r)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(r)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return isAsync(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.nan){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:t.parsedType}),INVALID}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e);return isValid(t)&&(t.value=Object.freeze(t.value)),t}}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});const custom=(e,t={},r)=>e?ZodAny.create().superRefine(((n,i)=>{var s,a;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(a=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===a||a,l="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...l,fatal:o})}})):ZodAny.create(),late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom((t=>t instanceof e),t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap:setErrorMap,getErrorMap:getErrorMap,makeIssue:makeIssue,EMPTY_PATH:EMPTY_PATH,addIssueToContext:addIssueToContext,ParseStatus:ParseStatus,INVALID:INVALID,DIRTY:DIRTY,OK:OK,isAborted:isAborted,isDirty:isDirty,isValid:isValid,isAsync:isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType:ZodParsedType,getParsedType:getParsedType,ZodType:ZodType,ZodString:ZodString,ZodNumber:ZodNumber,ZodBigInt:ZodBigInt,ZodBoolean:ZodBoolean,ZodDate:ZodDate,ZodSymbol:ZodSymbol,ZodUndefined:ZodUndefined,ZodNull:ZodNull,ZodAny:ZodAny,ZodUnknown:ZodUnknown,ZodNever:ZodNever,ZodVoid:ZodVoid,ZodArray:ZodArray,ZodObject:ZodObject,ZodUnion:ZodUnion,ZodDiscriminatedUnion:ZodDiscriminatedUnion,ZodIntersection:ZodIntersection,ZodTuple:ZodTuple,ZodRecord:ZodRecord,ZodMap:ZodMap,ZodSet:ZodSet,ZodFunction:ZodFunction,ZodLazy:ZodLazy,ZodLiteral:ZodLiteral,ZodEnum:ZodEnum,ZodNativeEnum:ZodNativeEnum,ZodPromise:ZodPromise,ZodEffects:ZodEffects,ZodTransformer:ZodEffects,ZodOptional:ZodOptional,ZodNullable:ZodNullable,ZodDefault:ZodDefault,ZodCatch:ZodCatch,ZodNaN:ZodNaN,BRAND:BRAND,ZodBranded:ZodBranded,ZodPipeline:ZodPipeline,ZodReadonly:ZodReadonly,custom:custom,Schema:ZodType,ZodSchema:ZodType,late:late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean:oboolean,onumber:onumber,optional:optionalType,ostring:ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER,ZodIssueCode:ZodIssueCode,quotelessJson:quotelessJson,ZodError:ZodError}),moment$1={exports:{}},module;module=moment$1,module.exports=function(){var e,t;function r(){return e.apply(null,arguments)}function n(t){e=t}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(a(e,t))return!1;return!0}function l(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var r,n=[],i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function u(e,t){for(var r in t)a(t,r)&&(e[r]=t[r]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,r,n){return Zr(e,t,r,n,!0).utc()}function f(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function m(e){return null==e._pf&&(e._pf=f()),e._pf}function g(e){if(null==e._isValid){var r=m(e),n=t.call(r.parsedDateParts,(function(e){return null!=e})),i=!isNaN(e._d.getTime())&&r.overflow<0&&!r.empty&&!r.invalidEra&&!r.invalidMonth&&!r.invalidWeekday&&!r.weekdayMismatch&&!r.nullInput&&!r.invalidFormat&&!r.userInvalidated&&(!r.meridiem||r.meridiem&&n);if(e._strict&&(i=i&&0===r.charsLeftOver&&0===r.unusedTokens.length&&void 0===r.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function y(e){var t=p(NaN);return null!=e?u(m(t),e):m(t).userInvalidated=!0,t}t=Array.prototype.some?Array.prototype.some:function(e){var t,r=Object(this),n=r.length>>>0;for(t=0;t<n;t++)if(t in r&&e.call(this,r[t],t,r))return!0;return!1};var v=r.momentProperties=[],b=!1;function S(e,t){var r,n,i,s=v.length;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=m(t)),l(t._locale)||(e._locale=t._locale),s>0)for(r=0;r<s;r++)l(i=t[n=v[r]])||(e[n]=i);return e}function E(e){S(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,r.updateOffset(this),b=!1)}function C(e){return e instanceof E||null!=e&&null!=e._isAMomentObject}function _(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function T(e,t){var n=!0;return u((function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var i,s,o,l=[],c=arguments.length;for(s=0;s<c;s++){if(i="","object"==typeof arguments[s]){for(o in i+="\n["+s+"] ",arguments[0])a(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[s];l.push(i)}_(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var x,P={};function w(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),P[e]||(_(t),P[e]=!0)}function I(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function k(e){var t,r;for(r in e)a(e,r)&&(I(t=e[r])?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function A(e,t){var r,n=u({},e);for(r in t)a(t,r)&&(s(e[r])&&s(t[r])?(n[r]={},u(n[r],e[r]),u(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)a(e,r)&&!a(t,r)&&s(e[r])&&(n[r]=u({},n[r]));return n}function M(e){null!=e&&this.set(e)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,x=Object.keys?Object.keys:function(e){var t,r=[];for(t in e)a(e,t)&&r.push(t);return r};var R={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function O(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return I(n)?n.call(t,r):n}function $(e,t,r){var n=""+Math.abs(e),i=t-n.length;return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var D=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,F={},N={};function B(e,t,r,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&(N[e]=i),t&&(N[t[0]]=function(){return $(i.apply(this,arguments),t[1],t[2])}),r&&(N[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function V(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function U(e){var t,r,n=e.match(D);for(t=0,r=n.length;t<r;t++)N[n[t]]?n[t]=N[n[t]]:n[t]=V(n[t]);return function(t){var i,s="";for(i=0;i<r;i++)s+=I(n[i])?n[i].call(t,e):n[i];return s}}function z(e,t){return e.isValid()?(t=j(t,e.localeData()),F[t]=F[t]||U(t),F[t](e)):e.localeData().invalidDate()}function j(e,t){var r=5;function n(e){return t.longDateFormat(e)||e}for(L.lastIndex=0;r>=0&&L.test(e);)e=e.replace(L,n),L.lastIndex=0,r-=1;return e}var G={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function H(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(D).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var Z="Invalid date";function W(){return this._invalidDate}var K="%d",Y=/\d{1,2}/;function q(e){return this._ordinal.replace("%d",e)}var Q={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function X(e,t,r,n){var i=this._relativeTime[r];return I(i)?i(e,t,r,n):i.replace(/%d/i,e)}function J(e,t){var r=this._relativeTime[e>0?"future":"past"];return I(r)?r(t):r.replace(/%s/i,t)}var ee={};function te(e,t){var r=e.toLowerCase();ee[r]=ee[r+"s"]=ee[t]=e}function re(e){return"string"==typeof e?ee[e]||ee[e.toLowerCase()]:void 0}function ne(e){var t,r,n={};for(r in e)a(e,r)&&(t=re(r))&&(n[t]=e[r]);return n}var ie={};function se(e,t){ie[e]=t}function ae(e){var t,r=[];for(t in e)a(e,t)&&r.push({unit:t,priority:ie[t]});return r.sort((function(e,t){return e.priority-t.priority})),r}function oe(e){return e%4==0&&e%100!=0||e%400==0}function le(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ce(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=le(t)),r}function he(e,t){return function(n){return null!=n?(ue(this,e,n),r.updateOffset(this,t),this):de(this,e)}}function de(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function ue(e,t,r){e.isValid()&&!isNaN(r)&&("FullYear"===t&&oe(e.year())&&1===e.month()&&29===e.date()?(r=ce(r),e._d["set"+(e._isUTC?"UTC":"")+t](r,e.month(),Xe(r,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](r))}function pe(e){return I(this[e=re(e)])?this[e]():this}function fe(e,t){if("object"==typeof e){var r,n=ae(e=ne(e)),i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(I(this[e=re(e)]))return this[e](t);return this}var me,ge=/\d/,ye=/\d\d/,ve=/\d{3}/,be=/\d{4}/,Se=/[+-]?\d{6}/,Ee=/\d\d?/,Ce=/\d\d\d\d?/,_e=/\d\d\d\d\d\d?/,Te=/\d{1,3}/,xe=/\d{1,4}/,Pe=/[+-]?\d{1,6}/,we=/\d+/,Ie=/[+-]?\d+/,ke=/Z|[+-]\d\d:?\d\d/gi,Ae=/Z|[+-]\d\d(?::?\d\d)?/gi,Me=/[+-]?\d+(\.\d{1,3})?/,Re=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function Oe(e,t,r){me[e]=I(t)?t:function(e,n){return e&&r?r:t}}function $e(e,t){return a(me,e)?me[e](t._strict,t._locale):new RegExp(De(e))}function De(e){return Le(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,r,n,i){return t||r||n||i})))}function Le(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}me={};var Fe={};function Ne(e,t){var r,n,i=t;for("string"==typeof e&&(e=[e]),c(t)&&(i=function(e,r){r[t]=ce(e)}),n=e.length,r=0;r<n;r++)Fe[e[r]]=i}function Be(e,t){Ne(e,(function(e,r,n,i){n._w=n._w||{},t(e,n._w,n,i)}))}function Ve(e,t,r){null!=t&&a(Fe,e)&&Fe[e](t,r._a,r,e)}var Ue,ze=0,je=1,Ge=2,He=3,Ze=4,We=5,Ke=6,Ye=7,qe=8;function Qe(e,t){return(e%t+t)%t}function Xe(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=Qe(t,12);return e+=(t-r)/12,1===r?oe(e)?29:28:31-r%7%2}Ue=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},B("M",["MM",2],"Mo",(function(){return this.month()+1})),B("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),B("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),te("month","M"),se("month",8),Oe("M",Ee),Oe("MM",Ee,ye),Oe("MMM",(function(e,t){return t.monthsShortRegex(e)})),Oe("MMMM",(function(e,t){return t.monthsRegex(e)})),Ne(["M","MM"],(function(e,t){t[je]=ce(e)-1})),Ne(["MMM","MMMM"],(function(e,t,r,n){var i=r._locale.monthsParse(e,n,r._strict);null!=i?t[je]=i:m(r).invalidMonth=e}));var Je="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),et="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),tt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,rt=Re,nt=Re;function it(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||tt).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone}function st(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[tt.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function at(e,t,r){var n,i,s,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)s=p([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return r?"MMM"===t?-1!==(i=Ue.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ue.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ue.call(this._shortMonthsParse,a))||-1!==(i=Ue.call(this._longMonthsParse,a))?i:null:-1!==(i=Ue.call(this._longMonthsParse,a))||-1!==(i=Ue.call(this._shortMonthsParse,a))?i:null}function ot(e,t,r){var n,i,s;if(this._monthsParseExact)return at.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=p([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),r&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(r&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}}function lt(e,t){var r;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=ce(t);else if(!c(t=e.localeData().monthsParse(t)))return e;return r=Math.min(e.date(),Xe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,r),e}function ct(e){return null!=e?(lt(this,e),r.updateOffset(this,!0),this):de(this,"Month")}function ht(){return Xe(this.year(),this.month())}function dt(e){return this._monthsParseExact?(a(this,"_monthsRegex")||pt.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=rt),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function ut(e){return this._monthsParseExact?(a(this,"_monthsRegex")||pt.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=nt),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function pt(){function e(e,t){return t.length-e.length}var t,r,n=[],i=[],s=[];for(t=0;t<12;t++)r=p([2e3,t]),n.push(this.monthsShort(r,"")),i.push(this.months(r,"")),s.push(this.months(r,"")),s.push(this.monthsShort(r,""));for(n.sort(e),i.sort(e),s.sort(e),t=0;t<12;t++)n[t]=Le(n[t]),i[t]=Le(i[t]);for(t=0;t<24;t++)s[t]=Le(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function ft(e){return oe(e)?366:365}B("Y",0,0,(function(){var e=this.year();return e<=9999?$(e,4):"+"+e})),B(0,["YY",2],0,(function(){return this.year()%100})),B(0,["YYYY",4],0,"year"),B(0,["YYYYY",5],0,"year"),B(0,["YYYYYY",6,!0],0,"year"),te("year","y"),se("year",1),Oe("Y",Ie),Oe("YY",Ee,ye),Oe("YYYY",xe,be),Oe("YYYYY",Pe,Se),Oe("YYYYYY",Pe,Se),Ne(["YYYYY","YYYYYY"],ze),Ne("YYYY",(function(e,t){t[ze]=2===e.length?r.parseTwoDigitYear(e):ce(e)})),Ne("YY",(function(e,t){t[ze]=r.parseTwoDigitYear(e)})),Ne("Y",(function(e,t){t[ze]=parseInt(e,10)})),r.parseTwoDigitYear=function(e){return ce(e)+(ce(e)>68?1900:2e3)};var mt=he("FullYear",!0);function gt(){return oe(this.year())}function yt(e,t,r,n,i,s,a){var o;return e<100&&e>=0?(o=new Date(e+400,t,r,n,i,s,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,r,n,i,s,a),o}function vt(e){var t,r;return e<100&&e>=0?((r=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function bt(e,t,r){var n=7+t-r;return-(7+vt(e,0,n).getUTCDay()-t)%7+n-1}function St(e,t,r,n,i){var s,a,o=1+7*(t-1)+(7+r-n)%7+bt(e,n,i);return o<=0?a=ft(s=e-1)+o:o>ft(e)?(s=e+1,a=o-ft(e)):(s=e,a=o),{year:s,dayOfYear:a}}function Et(e,t,r){var n,i,s=bt(e.year(),t,r),a=Math.floor((e.dayOfYear()-s-1)/7)+1;return a<1?n=a+Ct(i=e.year()-1,t,r):a>Ct(e.year(),t,r)?(n=a-Ct(e.year(),t,r),i=e.year()+1):(i=e.year(),n=a),{week:n,year:i}}function Ct(e,t,r){var n=bt(e,t,r),i=bt(e+1,t,r);return(ft(e)-n+i)/7}function _t(e){return Et(e,this._week.dow,this._week.doy).week}B("w",["ww",2],"wo","week"),B("W",["WW",2],"Wo","isoWeek"),te("week","w"),te("isoWeek","W"),se("week",5),se("isoWeek",5),Oe("w",Ee),Oe("ww",Ee,ye),Oe("W",Ee),Oe("WW",Ee,ye),Be(["w","ww","W","WW"],(function(e,t,r,n){t[n.substr(0,1)]=ce(e)}));var Tt={dow:0,doy:6};function xt(){return this._week.dow}function Pt(){return this._week.doy}function wt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function It(e){var t=Et(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function kt(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function At(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Mt(e,t){return e.slice(t,7).concat(e.slice(0,t))}B("d",0,"do","day"),B("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),B("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),B("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),B("e",0,0,"weekday"),B("E",0,0,"isoWeekday"),te("day","d"),te("weekday","e"),te("isoWeekday","E"),se("day",11),se("weekday",11),se("isoWeekday",11),Oe("d",Ee),Oe("e",Ee),Oe("E",Ee),Oe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Oe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Oe("dddd",(function(e,t){return t.weekdaysRegex(e)})),Be(["dd","ddd","dddd"],(function(e,t,r,n){var i=r._locale.weekdaysParse(e,n,r._strict);null!=i?t.d=i:m(r).invalidWeekday=e})),Be(["d","e","E"],(function(e,t,r,n){t[n]=ce(e)}));var Rt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ot="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$t="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Dt=Re,Lt=Re,Ft=Re;function Nt(e,t){var r=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Mt(r,this._week.dow):e?r[e.day()]:r}function Bt(e){return!0===e?Mt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Vt(e){return!0===e?Mt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ut(e,t,r){var n,i,s,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return r?"dddd"===t?-1!==(i=Ue.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ue.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ue.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ue.call(this._weekdaysParse,a))||-1!==(i=Ue.call(this._shortWeekdaysParse,a))||-1!==(i=Ue.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ue.call(this._shortWeekdaysParse,a))||-1!==(i=Ue.call(this._weekdaysParse,a))||-1!==(i=Ue.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ue.call(this._minWeekdaysParse,a))||-1!==(i=Ue.call(this._weekdaysParse,a))||-1!==(i=Ue.call(this._shortWeekdaysParse,a))?i:null}function zt(e,t,r){var n,i,s;if(this._weekdaysParseExact)return Ut.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=p([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function jt(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=kt(e,this.localeData()),this.add(e-t,"d")):t}function Gt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ht(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=At(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Zt(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Yt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Dt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Wt(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Yt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Lt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Kt(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Yt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ft),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yt(){function e(e,t){return t.length-e.length}var t,r,n,i,s,a=[],o=[],l=[],c=[];for(t=0;t<7;t++)r=p([2e3,1]).day(t),n=Le(this.weekdaysMin(r,"")),i=Le(this.weekdaysShort(r,"")),s=Le(this.weekdays(r,"")),a.push(n),o.push(i),l.push(s),c.push(n),c.push(i),c.push(s);a.sort(e),o.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function qt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function Xt(e,t){B(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Jt(e,t){return t._meridiemParse}function er(e){return"p"===(e+"").toLowerCase().charAt(0)}B("H",["HH",2],0,"hour"),B("h",["hh",2],0,qt),B("k",["kk",2],0,Qt),B("hmm",0,0,(function(){return""+qt.apply(this)+$(this.minutes(),2)})),B("hmmss",0,0,(function(){return""+qt.apply(this)+$(this.minutes(),2)+$(this.seconds(),2)})),B("Hmm",0,0,(function(){return""+this.hours()+$(this.minutes(),2)})),B("Hmmss",0,0,(function(){return""+this.hours()+$(this.minutes(),2)+$(this.seconds(),2)})),Xt("a",!0),Xt("A",!1),te("hour","h"),se("hour",13),Oe("a",Jt),Oe("A",Jt),Oe("H",Ee),Oe("h",Ee),Oe("k",Ee),Oe("HH",Ee,ye),Oe("hh",Ee,ye),Oe("kk",Ee,ye),Oe("hmm",Ce),Oe("hmmss",_e),Oe("Hmm",Ce),Oe("Hmmss",_e),Ne(["H","HH"],He),Ne(["k","kk"],(function(e,t,r){var n=ce(e);t[He]=24===n?0:n})),Ne(["a","A"],(function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e})),Ne(["h","hh"],(function(e,t,r){t[He]=ce(e),m(r).bigHour=!0})),Ne("hmm",(function(e,t,r){var n=e.length-2;t[He]=ce(e.substr(0,n)),t[Ze]=ce(e.substr(n)),m(r).bigHour=!0})),Ne("hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2;t[He]=ce(e.substr(0,n)),t[Ze]=ce(e.substr(n,2)),t[We]=ce(e.substr(i)),m(r).bigHour=!0})),Ne("Hmm",(function(e,t,r){var n=e.length-2;t[He]=ce(e.substr(0,n)),t[Ze]=ce(e.substr(n))})),Ne("Hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2;t[He]=ce(e.substr(0,n)),t[Ze]=ce(e.substr(n,2)),t[We]=ce(e.substr(i))}));var tr=/[ap]\.?m?\.?/i,rr=he("Hours",!0);function nr(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var ir,sr={calendar:R,longDateFormat:G,invalidDate:Z,ordinal:K,dayOfMonthOrdinalParse:Y,relativeTime:Q,months:Je,monthsShort:et,week:Tt,weekdays:Rt,weekdaysMin:$t,weekdaysShort:Ot,meridiemParse:tr},ar={},or={};function lr(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}function cr(e){return e?e.toLowerCase().replace("_","-"):e}function hr(e){for(var t,r,n,i,s=0;s<e.length;){for(t=(i=cr(e[s]).split("-")).length,r=(r=cr(e[s+1]))?r.split("-"):null;t>0;){if(n=ur(i.slice(0,t).join("-")))return n;if(r&&r.length>=t&&lr(i,r)>=t-1)break;t--}s++}return ir}function dr(e){return null!=e.match("^[^/\\\\]*$")}function ur(e){var t=null;if(void 0===ar[e]&&module&&module.exports&&dr(e))try{t=ir._abbr,commonjsRequire("./locale/"+e),pr(t)}catch(t){ar[e]=null}return ar[e]}function pr(e,t){var r;return e&&((r=l(t)?gr(e):fr(e,t))?ir=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ir._abbr}function fr(e,t){if(null!==t){var r,n=sr;if(t.abbr=e,null!=ar[e])w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ar[e]._config;else if(null!=t.parentLocale)if(null!=ar[t.parentLocale])n=ar[t.parentLocale]._config;else{if(null==(r=ur(t.parentLocale)))return or[t.parentLocale]||(or[t.parentLocale]=[]),or[t.parentLocale].push({name:e,config:t}),null;n=r._config}return ar[e]=new M(A(n,t)),or[e]&&or[e].forEach((function(e){fr(e.name,e.config)})),pr(e),ar[e]}return delete ar[e],null}function mr(e,t){if(null!=t){var r,n,i=sr;null!=ar[e]&&null!=ar[e].parentLocale?ar[e].set(A(ar[e]._config,t)):(null!=(n=ur(e))&&(i=n._config),t=A(i,t),null==n&&(t.abbr=e),(r=new M(t)).parentLocale=ar[e],ar[e]=r),pr(e)}else null!=ar[e]&&(null!=ar[e].parentLocale?(ar[e]=ar[e].parentLocale,e===pr()&&pr(e)):null!=ar[e]&&delete ar[e]);return ar[e]}function gr(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ir;if(!i(e)){if(t=ur(e))return t;e=[e]}return hr(e)}function yr(){return x(ar)}function vr(e){var t,r=e._a;return r&&-2===m(e).overflow&&(t=r[je]<0||r[je]>11?je:r[Ge]<1||r[Ge]>Xe(r[ze],r[je])?Ge:r[He]<0||r[He]>24||24===r[He]&&(0!==r[Ze]||0!==r[We]||0!==r[Ke])?He:r[Ze]<0||r[Ze]>59?Ze:r[We]<0||r[We]>59?We:r[Ke]<0||r[Ke]>999?Ke:-1,m(e)._overflowDayOfYear&&(t<ze||t>Ge)&&(t=Ge),m(e)._overflowWeeks&&-1===t&&(t=Ye),m(e)._overflowWeekday&&-1===t&&(t=qe),m(e).overflow=t),e}var br=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Er=/Z|[+-]\d\d(?::?\d\d)?/,Cr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],_r=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Tr=/^\/?Date\((-?\d+)/i,xr=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Pr={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function wr(e){var t,r,n,i,s,a,o=e._i,l=br.exec(o)||Sr.exec(o),c=Cr.length,h=_r.length;if(l){for(m(e).iso=!0,t=0,r=c;t<r;t++)if(Cr[t][1].exec(l[1])){i=Cr[t][0],n=!1!==Cr[t][2];break}if(null==i)return void(e._isValid=!1);if(l[3]){for(t=0,r=h;t<r;t++)if(_r[t][1].exec(l[3])){s=(l[2]||" ")+_r[t][0];break}if(null==s)return void(e._isValid=!1)}if(!n&&null!=s)return void(e._isValid=!1);if(l[4]){if(!Er.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=i+(s||"")+(a||""),Br(e)}else e._isValid=!1}function Ir(e,t,r,n,i,s){var a=[kr(e),et.indexOf(t),parseInt(r,10),parseInt(n,10),parseInt(i,10)];return s&&a.push(parseInt(s,10)),a}function kr(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ar(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Mr(e,t,r){return!e||Ot.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(m(r).weekdayMismatch=!0,r._isValid=!1,!1)}function Rr(e,t,r){if(e)return Pr[e];if(t)return 0;var n=parseInt(r,10),i=n%100;return(n-i)/100*60+i}function Or(e){var t,r=xr.exec(Ar(e._i));if(r){if(t=Ir(r[4],r[3],r[2],r[5],r[6],r[7]),!Mr(r[1],t,e))return;e._a=t,e._tzm=Rr(r[8],r[9],r[10]),e._d=vt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0}else e._isValid=!1}function $r(e){var t=Tr.exec(e._i);null===t?(wr(e),!1===e._isValid&&(delete e._isValid,Or(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Dr(e,t,r){return null!=e?e:null!=t?t:r}function Lr(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Fr(e){var t,r,n,i,s,a=[];if(!e._d){for(n=Lr(e),e._w&&null==e._a[Ge]&&null==e._a[je]&&Nr(e),null!=e._dayOfYear&&(s=Dr(e._a[ze],n[ze]),(e._dayOfYear>ft(s)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),r=vt(s,0,e._dayOfYear),e._a[je]=r.getUTCMonth(),e._a[Ge]=r.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=n[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[He]&&0===e._a[Ze]&&0===e._a[We]&&0===e._a[Ke]&&(e._nextDay=!0,e._a[He]=0),e._d=(e._useUTC?vt:yt).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[He]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(m(e).weekdayMismatch=!0)}}function Nr(e){var t,r,n,i,s,a,o,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(s=1,a=4,r=Dr(t.GG,e._a[ze],Et(Wr(),1,4).year),n=Dr(t.W,1),((i=Dr(t.E,1))<1||i>7)&&(l=!0)):(s=e._locale._week.dow,a=e._locale._week.doy,c=Et(Wr(),s,a),r=Dr(t.gg,e._a[ze],c.year),n=Dr(t.w,c.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+s,(t.e<0||t.e>6)&&(l=!0)):i=s),n<1||n>Ct(r,s,a)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(o=St(r,n,i,s,a),e._a[ze]=o.year,e._dayOfYear=o.dayOfYear)}function Br(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,n,i,s,a,o,l,c=""+e._i,h=c.length,d=0;for(l=(i=j(e._f,e._locale).match(D)||[]).length,t=0;t<l;t++)s=i[t],(n=(c.match($e(s,e))||[])[0])&&((a=c.substr(0,c.indexOf(n))).length>0&&m(e).unusedInput.push(a),c=c.slice(c.indexOf(n)+n.length),d+=n.length),N[s]?(n?m(e).empty=!1:m(e).unusedTokens.push(s),Ve(s,n,e)):e._strict&&!n&&m(e).unusedTokens.push(s);m(e).charsLeftOver=h-d,c.length>0&&m(e).unusedInput.push(c),e._a[He]<=12&&!0===m(e).bigHour&&e._a[He]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[He]=Vr(e._locale,e._a[He],e._meridiem),null!==(o=m(e).era)&&(e._a[ze]=e._locale.erasConvertYear(o,e._a[ze])),Fr(e),vr(e)}else Or(e);else wr(e)}function Vr(e,t,r){var n;return null==r?t:null!=e.meridiemHour?e.meridiemHour(t,r):null!=e.isPM?((n=e.isPM(r))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function Ur(e){var t,r,n,i,s,a,o=!1,l=e._f.length;if(0===l)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<l;i++)s=0,a=!1,t=S({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Br(t),g(t)&&(a=!0),s+=m(t).charsLeftOver,s+=10*m(t).unusedTokens.length,m(t).score=s,o?s<n&&(n=s,r=t):(null==n||s<n||a)&&(n=s,r=t,a&&(o=!0));u(e,r||t)}function zr(e){if(!e._d){var t=ne(e._i),r=void 0===t.day?t.date:t.day;e._a=d([t.year,t.month,r,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),Fr(e)}}function jr(e){var t=new E(vr(Gr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Gr(e){var t=e._i,r=e._f;return e._locale=e._locale||gr(e._l),null===t||void 0===r&&""===t?y({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),C(t)?new E(vr(t)):(h(t)?e._d=t:i(r)?Ur(e):r?Br(e):Hr(e),g(e)||(e._d=null),e))}function Hr(e){var t=e._i;l(t)?e._d=new Date(r.now()):h(t)?e._d=new Date(t.valueOf()):"string"==typeof t?$r(e):i(t)?(e._a=d(t.slice(0),(function(e){return parseInt(e,10)})),Fr(e)):s(t)?zr(e):c(t)?e._d=new Date(t):r.createFromInputFallback(e)}function Zr(e,t,r,n,a){var l={};return!0!==t&&!1!==t||(n=t,t=void 0),!0!==r&&!1!==r||(n=r,r=void 0),(s(e)&&o(e)||i(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=r,l._i=e,l._f=t,l._strict=n,jr(l)}function Wr(e,t,r,n){return Zr(e,t,r,n,!1)}r.createFromInputFallback=T("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),r.ISO_8601=function(){},r.RFC_2822=function(){};var Kr=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Wr.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:y()})),Yr=T("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Wr.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:y()}));function qr(e,t){var r,n;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Wr();for(r=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](r)||(r=t[n]);return r}function Qr(){return qr("isBefore",[].slice.call(arguments,0))}function Xr(){return qr("isAfter",[].slice.call(arguments,0))}var Jr=function(){return Date.now?Date.now():+new Date},en=["year","quarter","month","week","day","hour","minute","second","millisecond"];function tn(e){var t,r,n=!1,i=en.length;for(t in e)if(a(e,t)&&(-1===Ue.call(en,t)||null!=e[t]&&isNaN(e[t])))return!1;for(r=0;r<i;++r)if(e[en[r]]){if(n)return!1;parseFloat(e[en[r]])!==ce(e[en[r]])&&(n=!0)}return!0}function rn(){return this._isValid}function nn(){return wn(NaN)}function sn(e){var t=ne(e),r=t.year||0,n=t.quarter||0,i=t.month||0,s=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,l=t.minute||0,c=t.second||0,h=t.millisecond||0;this._isValid=tn(t),this._milliseconds=+h+1e3*c+6e4*l+1e3*o*60*60,this._days=+a+7*s,this._months=+i+3*n+12*r,this._data={},this._locale=gr(),this._bubble()}function an(e){return e instanceof sn}function on(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function ln(e,t,r){var n,i=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),a=0;for(n=0;n<i;n++)(r&&e[n]!==t[n]||!r&&ce(e[n])!==ce(t[n]))&&a++;return a+s}function cn(e,t){B(e,0,0,(function(){var e=this.utcOffset(),r="+";return e<0&&(e=-e,r="-"),r+$(~~(e/60),2)+t+$(~~e%60,2)}))}cn("Z",":"),cn("ZZ",""),Oe("Z",Ae),Oe("ZZ",Ae),Ne(["Z","ZZ"],(function(e,t,r){r._useUTC=!0,r._tzm=dn(Ae,e)}));var hn=/([\+\-]|\d\d)/gi;function dn(e,t){var r,n,i=(t||"").match(e);return null===i?null:0===(n=60*(r=((i[i.length-1]||[])+"").match(hn)||["-",0,0])[1]+ce(r[2]))?0:"+"===r[0]?n:-n}function un(e,t){var n,i;return t._isUTC?(n=t.clone(),i=(C(e)||h(e)?e.valueOf():Wr(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),r.updateOffset(n,!1),n):Wr(e).local()}function pn(e){return-Math.round(e._d.getTimezoneOffset())}function fn(e,t,n){var i,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=dn(Ae,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(i=pn(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==e&&(!t||this._changeInProgress?Rn(this,wn(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:pn(this)}function mn(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function gn(e){return this.utcOffset(0,e)}function yn(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(pn(this),"m")),this}function vn(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=dn(ke,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function bn(e){return!!this.isValid()&&(e=e?Wr(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function Sn(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function En(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return S(t,this),(t=Gr(t))._a?(e=t._isUTC?p(t._a):Wr(t._a),this._isDSTShifted=this.isValid()&&ln(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Cn(){return!!this.isValid()&&!this._isUTC}function _n(){return!!this.isValid()&&this._isUTC}function Tn(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var xn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Pn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function wn(e,t){var r,n,i,s=e,o=null;return an(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(o=xn.exec(e))?(r="-"===o[1]?-1:1,s={y:0,d:ce(o[Ge])*r,h:ce(o[He])*r,m:ce(o[Ze])*r,s:ce(o[We])*r,ms:ce(on(1e3*o[Ke]))*r}):(o=Pn.exec(e))?(r="-"===o[1]?-1:1,s={y:In(o[2],r),M:In(o[3],r),w:In(o[4],r),d:In(o[5],r),h:In(o[6],r),m:In(o[7],r),s:In(o[8],r)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(i=An(Wr(s.from),Wr(s.to)),(s={}).ms=i.milliseconds,s.M=i.months),n=new sn(s),an(e)&&a(e,"_locale")&&(n._locale=e._locale),an(e)&&a(e,"_isValid")&&(n._isValid=e._isValid),n}function In(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function kn(e,t){var r={};return r.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function An(e,t){var r;return e.isValid()&&t.isValid()?(t=un(t,e),e.isBefore(t)?r=kn(e,t):((r=kn(t,e)).milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function Mn(e,t){return function(r,n){var i;return null===n||isNaN(+n)||(w(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=n,n=i),Rn(this,wn(r,n),e),this}}function Rn(e,t,n,i){var s=t._milliseconds,a=on(t._days),o=on(t._months);e.isValid()&&(i=null==i||i,o&<(e,de(e,"Month")+o*n),a&&ue(e,"Date",de(e,"Date")+a*n),s&&e._d.setTime(e._d.valueOf()+s*n),i&&r.updateOffset(e,a||o))}wn.fn=sn.prototype,wn.invalid=nn;var On=Mn(1,"add"),$n=Mn(-1,"subtract");function Dn(e){return"string"==typeof e||e instanceof String}function Ln(e){return C(e)||h(e)||Dn(e)||c(e)||Nn(e)||Fn(e)||null==e}function Fn(e){var t,r,n=s(e)&&!o(e),i=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],c=l.length;for(t=0;t<c;t+=1)r=l[t],i=i||a(e,r);return n&&i}function Nn(e){var t=i(e),r=!1;return t&&(r=0===e.filter((function(t){return!c(t)&&Dn(e)})).length),t&&r}function Bn(e){var t,r,n=s(e)&&!o(e),i=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<l.length;t+=1)r=l[t],i=i||a(e,r);return n&&i}function Vn(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function Un(e,t){1===arguments.length&&(arguments[0]?Ln(arguments[0])?(e=arguments[0],t=void 0):Bn(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Wr(),i=un(n,this).startOf("day"),s=r.calendarFormat(this,i)||"sameElse",a=t&&(I(t[s])?t[s].call(this,n):t[s]);return this.format(a||this.localeData().calendar(s,this,Wr(n)))}function zn(){return new E(this)}function jn(e,t){var r=C(e)?e:Wr(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf())}function Gn(e,t){var r=C(e)?e:Wr(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf())}function Hn(e,t,r,n){var i=C(e)?e:Wr(e),s=C(t)?t:Wr(t);return!!(this.isValid()&&i.isValid()&&s.isValid())&&("("===(n=n||"()")[0]?this.isAfter(i,r):!this.isBefore(i,r))&&(")"===n[1]?this.isBefore(s,r):!this.isAfter(s,r))}function Zn(e,t){var r,n=C(e)?e:Wr(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf()))}function Wn(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Kn(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Yn(e,t,r){var n,i,s;if(!this.isValid())return NaN;if(!(n=un(e,this)).isValid())return NaN;switch(i=6e4*(n.utcOffset()-this.utcOffset()),t=re(t)){case"year":s=qn(this,n)/12;break;case"month":s=qn(this,n);break;case"quarter":s=qn(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-i)/864e5;break;case"week":s=(this-n-i)/6048e5;break;default:s=this-n}return r?s:le(s)}function qn(e,t){if(e.date()<t.date())return-qn(t,e);var r=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(r,"months");return-(r+(t-n<0?(t-n)/(n-e.clone().add(r-1,"months")):(t-n)/(e.clone().add(r+1,"months")-n)))||0}function Qn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Xn(e){if(!this.isValid())return null;var t=!0!==e,r=t?this.clone().utc():this;return r.year()<0||r.year()>9999?z(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):I(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",z(r,"Z")):z(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,r,n,i="moment",s="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",s="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",n=s+'[")]',this.format(e+t+r+n)}function ei(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=z(this,e);return this.localeData().postformat(t)}function ti(e,t){return this.isValid()&&(C(e)&&e.isValid()||Wr(e).isValid())?wn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ri(e){return this.from(Wr(),e)}function ni(e,t){return this.isValid()&&(C(e)&&e.isValid()||Wr(e).isValid())?wn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ii(e){return this.to(Wr(),e)}function si(e){var t;return void 0===e?this._locale._abbr:(null!=(t=gr(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ai=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function oi(){return this._locale}var li=1e3,ci=60*li,hi=60*ci,di=3506328*hi;function ui(e,t){return(e%t+t)%t}function pi(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-di:new Date(e,t,r).valueOf()}function fi(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-di:Date.UTC(e,t,r)}function mi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?fi:pi,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ui(t+(this._isUTC?0:this.utcOffset()*ci),hi);break;case"minute":t=this._d.valueOf(),t-=ui(t,ci);break;case"second":t=this._d.valueOf(),t-=ui(t,li)}return this._d.setTime(t),r.updateOffset(this,!0),this}function gi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?fi:pi,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=hi-ui(t+(this._isUTC?0:this.utcOffset()*ci),hi)-1;break;case"minute":t=this._d.valueOf(),t+=ci-ui(t,ci)-1;break;case"second":t=this._d.valueOf(),t+=li-ui(t,li)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function yi(){return this._d.valueOf()-6e4*(this._offset||0)}function vi(){return Math.floor(this.valueOf()/1e3)}function bi(){return new Date(this.valueOf())}function Si(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ei(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ci(){return this.isValid()?this.toISOString():null}function _i(){return g(this)}function Ti(){return u({},m(this))}function xi(){return m(this).overflow}function Pi(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function wi(e,t){var n,i,s,a=this._eras||gr("en")._eras;for(n=0,i=a.length;n<i;++n)switch("string"==typeof a[n].since&&(s=r(a[n].since).startOf("day"),a[n].since=s.valueOf()),typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":s=r(a[n].until).startOf("day").valueOf(),a[n].until=s.valueOf()}return a}function Ii(e,t,r){var n,i,s,a,o,l=this.eras();for(e=e.toUpperCase(),n=0,i=l.length;n<i;++n)if(s=l[n].name.toUpperCase(),a=l[n].abbr.toUpperCase(),o=l[n].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(a===e)return l[n];break;case"NNNN":if(s===e)return l[n];break;case"NNNNN":if(o===e)return l[n]}else if([s,a,o].indexOf(e)>=0)return l[n]}function ki(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Ai(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].name;if(n[e].until<=r&&r<=n[e].since)return n[e].name}return""}function Mi(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].narrow;if(n[e].until<=r&&r<=n[e].since)return n[e].narrow}return""}function Ri(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].abbr;if(n[e].until<=r&&r<=n[e].since)return n[e].abbr}return""}function Oi(){var e,t,n,i,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=s[e].since<=s[e].until?1:-1,i=this.clone().startOf("day").valueOf(),s[e].since<=i&&i<=s[e].until||s[e].until<=i&&i<=s[e].since)return(this.year()-r(s[e].since).year())*n+s[e].offset;return this.year()}function $i(e){return a(this,"_erasNameRegex")||Ui.call(this),e?this._erasNameRegex:this._erasRegex}function Di(e){return a(this,"_erasAbbrRegex")||Ui.call(this),e?this._erasAbbrRegex:this._erasRegex}function Li(e){return a(this,"_erasNarrowRegex")||Ui.call(this),e?this._erasNarrowRegex:this._erasRegex}function Fi(e,t){return t.erasAbbrRegex(e)}function Ni(e,t){return t.erasNameRegex(e)}function Bi(e,t){return t.erasNarrowRegex(e)}function Vi(e,t){return t._eraYearOrdinalRegex||we}function Ui(){var e,t,r=[],n=[],i=[],s=[],a=this.eras();for(e=0,t=a.length;e<t;++e)n.push(Le(a[e].name)),r.push(Le(a[e].abbr)),i.push(Le(a[e].narrow)),s.push(Le(a[e].name)),s.push(Le(a[e].abbr)),s.push(Le(a[e].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+n.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+i.join("|")+")","i")}function zi(e,t){B(0,[e,e.length],0,t)}function ji(e){return Yi.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Gi(e){return Yi.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Hi(){return Ct(this.year(),1,4)}function Zi(){return Ct(this.isoWeekYear(),1,4)}function Wi(){var e=this.localeData()._week;return Ct(this.year(),e.dow,e.doy)}function Ki(){var e=this.localeData()._week;return Ct(this.weekYear(),e.dow,e.doy)}function Yi(e,t,r,n,i){var s;return null==e?Et(this,n,i).year:(t>(s=Ct(e,n,i))&&(t=s),qi.call(this,e,t,r,n,i))}function qi(e,t,r,n,i){var s=St(e,t,r,n,i),a=vt(s.year,0,s.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Qi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}B("N",0,0,"eraAbbr"),B("NN",0,0,"eraAbbr"),B("NNN",0,0,"eraAbbr"),B("NNNN",0,0,"eraName"),B("NNNNN",0,0,"eraNarrow"),B("y",["y",1],"yo","eraYear"),B("y",["yy",2],0,"eraYear"),B("y",["yyy",3],0,"eraYear"),B("y",["yyyy",4],0,"eraYear"),Oe("N",Fi),Oe("NN",Fi),Oe("NNN",Fi),Oe("NNNN",Ni),Oe("NNNNN",Bi),Ne(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,r,n){var i=r._locale.erasParse(e,n,r._strict);i?m(r).era=i:m(r).invalidEra=e})),Oe("y",we),Oe("yy",we),Oe("yyy",we),Oe("yyyy",we),Oe("yo",Vi),Ne(["y","yy","yyy","yyyy"],ze),Ne(["yo"],(function(e,t,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[ze]=r._locale.eraYearOrdinalParse(e,i):t[ze]=parseInt(e,10)})),B(0,["gg",2],0,(function(){return this.weekYear()%100})),B(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),zi("gggg","weekYear"),zi("ggggg","weekYear"),zi("GGGG","isoWeekYear"),zi("GGGGG","isoWeekYear"),te("weekYear","gg"),te("isoWeekYear","GG"),se("weekYear",1),se("isoWeekYear",1),Oe("G",Ie),Oe("g",Ie),Oe("GG",Ee,ye),Oe("gg",Ee,ye),Oe("GGGG",xe,be),Oe("gggg",xe,be),Oe("GGGGG",Pe,Se),Oe("ggggg",Pe,Se),Be(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,r,n){t[n.substr(0,2)]=ce(e)})),Be(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),B("Q",0,"Qo","quarter"),te("quarter","Q"),se("quarter",7),Oe("Q",ge),Ne("Q",(function(e,t){t[je]=3*(ce(e)-1)})),B("D",["DD",2],"Do","date"),te("date","D"),se("date",9),Oe("D",Ee),Oe("DD",Ee,ye),Oe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Ne(["D","DD"],Ge),Ne("Do",(function(e,t){t[Ge]=ce(e.match(Ee)[0])}));var Xi=he("Date",!0);function Ji(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}B("DDD",["DDDD",3],"DDDo","dayOfYear"),te("dayOfYear","DDD"),se("dayOfYear",4),Oe("DDD",Te),Oe("DDDD",ve),Ne(["DDD","DDDD"],(function(e,t,r){r._dayOfYear=ce(e)})),B("m",["mm",2],0,"minute"),te("minute","m"),se("minute",14),Oe("m",Ee),Oe("mm",Ee,ye),Ne(["m","mm"],Ze);var es=he("Minutes",!1);B("s",["ss",2],0,"second"),te("second","s"),se("second",15),Oe("s",Ee),Oe("ss",Ee,ye),Ne(["s","ss"],We);var ts,rs,ns=he("Seconds",!1);for(B("S",0,0,(function(){return~~(this.millisecond()/100)})),B(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),B(0,["SSS",3],0,"millisecond"),B(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),B(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),B(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),B(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),B(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),B(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),te("millisecond","ms"),se("millisecond",16),Oe("S",Te,ge),Oe("SS",Te,ye),Oe("SSS",Te,ve),ts="SSSS";ts.length<=9;ts+="S")Oe(ts,we);function is(e,t){t[Ke]=ce(1e3*("0."+e))}for(ts="S";ts.length<=9;ts+="S")Ne(ts,is);function ss(){return this._isUTC?"UTC":""}function as(){return this._isUTC?"Coordinated Universal Time":""}rs=he("Milliseconds",!1),B("z",0,0,"zoneAbbr"),B("zz",0,0,"zoneName");var os=E.prototype;function ls(e){return Wr(1e3*e)}function cs(){return Wr.apply(null,arguments).parseZone()}function hs(e){return e}os.add=On,os.calendar=Un,os.clone=zn,os.diff=Yn,os.endOf=gi,os.format=ei,os.from=ti,os.fromNow=ri,os.to=ni,os.toNow=ii,os.get=pe,os.invalidAt=xi,os.isAfter=jn,os.isBefore=Gn,os.isBetween=Hn,os.isSame=Zn,os.isSameOrAfter=Wn,os.isSameOrBefore=Kn,os.isValid=_i,os.lang=ai,os.locale=si,os.localeData=oi,os.max=Yr,os.min=Kr,os.parsingFlags=Ti,os.set=fe,os.startOf=mi,os.subtract=$n,os.toArray=Si,os.toObject=Ei,os.toDate=bi,os.toISOString=Xn,os.inspect=Jn,"undefined"!=typeof Symbol&&null!=Symbol.for&&(os[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),os.toJSON=Ci,os.toString=Qn,os.unix=vi,os.valueOf=yi,os.creationData=Pi,os.eraName=Ai,os.eraNarrow=Mi,os.eraAbbr=Ri,os.eraYear=Oi,os.year=mt,os.isLeapYear=gt,os.weekYear=ji,os.isoWeekYear=Gi,os.quarter=os.quarters=Qi,os.month=ct,os.daysInMonth=ht,os.week=os.weeks=wt,os.isoWeek=os.isoWeeks=It,os.weeksInYear=Wi,os.weeksInWeekYear=Ki,os.isoWeeksInYear=Hi,os.isoWeeksInISOWeekYear=Zi,os.date=Xi,os.day=os.days=jt,os.weekday=Gt,os.isoWeekday=Ht,os.dayOfYear=Ji,os.hour=os.hours=rr,os.minute=os.minutes=es,os.second=os.seconds=ns,os.millisecond=os.milliseconds=rs,os.utcOffset=fn,os.utc=gn,os.local=yn,os.parseZone=vn,os.hasAlignedHourOffset=bn,os.isDST=Sn,os.isLocal=Cn,os.isUtcOffset=_n,os.isUtc=Tn,os.isUTC=Tn,os.zoneAbbr=ss,os.zoneName=as,os.dates=T("dates accessor is deprecated. Use date instead.",Xi),os.months=T("months accessor is deprecated. Use month instead",ct),os.years=T("years accessor is deprecated. Use year instead",mt),os.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mn),os.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",En);var ds=M.prototype;function us(e,t,r,n){var i=gr(),s=p().set(n,t);return i[r](s,e)}function ps(e,t,r){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return us(e,t,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=us(e,n,r,"month");return i}function fs(e,t,r,n){"boolean"==typeof e?(c(t)&&(r=t,t=void 0),t=t||""):(r=t=e,e=!1,c(t)&&(r=t,t=void 0),t=t||"");var i,s=gr(),a=e?s._week.dow:0,o=[];if(null!=r)return us(t,(r+a)%7,n,"day");for(i=0;i<7;i++)o[i]=us(t,(i+a)%7,n,"day");return o}function ms(e,t){return ps(e,t,"months")}function gs(e,t){return ps(e,t,"monthsShort")}function ys(e,t,r){return fs(e,t,r,"weekdays")}function vs(e,t,r){return fs(e,t,r,"weekdaysShort")}function bs(e,t,r){return fs(e,t,r,"weekdaysMin")}ds.calendar=O,ds.longDateFormat=H,ds.invalidDate=W,ds.ordinal=q,ds.preparse=hs,ds.postformat=hs,ds.relativeTime=X,ds.pastFuture=J,ds.set=k,ds.eras=wi,ds.erasParse=Ii,ds.erasConvertYear=ki,ds.erasAbbrRegex=Di,ds.erasNameRegex=$i,ds.erasNarrowRegex=Li,ds.months=it,ds.monthsShort=st,ds.monthsParse=ot,ds.monthsRegex=ut,ds.monthsShortRegex=dt,ds.week=_t,ds.firstDayOfYear=Pt,ds.firstDayOfWeek=xt,ds.weekdays=Nt,ds.weekdaysMin=Vt,ds.weekdaysShort=Bt,ds.weekdaysParse=zt,ds.weekdaysRegex=Zt,ds.weekdaysShortRegex=Wt,ds.weekdaysMinRegex=Kt,ds.isPM=er,ds.meridiem=nr,pr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===ce(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=T("moment.lang is deprecated. Use moment.locale instead.",pr),r.langData=T("moment.langData is deprecated. Use moment.localeData instead.",gr);var Ss=Math.abs;function Es(){var e=this._data;return this._milliseconds=Ss(this._milliseconds),this._days=Ss(this._days),this._months=Ss(this._months),e.milliseconds=Ss(e.milliseconds),e.seconds=Ss(e.seconds),e.minutes=Ss(e.minutes),e.hours=Ss(e.hours),e.months=Ss(e.months),e.years=Ss(e.years),this}function Cs(e,t,r,n){var i=wn(t,r);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function _s(e,t){return Cs(this,e,t,1)}function Ts(e,t){return Cs(this,e,t,-1)}function xs(e){return e<0?Math.floor(e):Math.ceil(e)}function Ps(){var e,t,r,n,i,s=this._milliseconds,a=this._days,o=this._months,l=this._data;return s>=0&&a>=0&&o>=0||s<=0&&a<=0&&o<=0||(s+=864e5*xs(Is(o)+a),a=0,o=0),l.milliseconds=s%1e3,e=le(s/1e3),l.seconds=e%60,t=le(e/60),l.minutes=t%60,r=le(t/60),l.hours=r%24,a+=le(r/24),o+=i=le(ws(a)),a-=xs(Is(i)),n=le(o/12),o%=12,l.days=a,l.months=o,l.years=n,this}function ws(e){return 4800*e/146097}function Is(e){return 146097*e/4800}function ks(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,r=this._months+ws(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Is(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function As(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ce(this._months/12):NaN}function Ms(e){return function(){return this.as(e)}}var Rs=Ms("ms"),Os=Ms("s"),$s=Ms("m"),Ds=Ms("h"),Ls=Ms("d"),Fs=Ms("w"),Ns=Ms("M"),Bs=Ms("Q"),Vs=Ms("y");function Us(){return wn(this)}function zs(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function js(e){return function(){return this.isValid()?this._data[e]:NaN}}var Gs=js("milliseconds"),Hs=js("seconds"),Zs=js("minutes"),Ws=js("hours"),Ks=js("days"),Ys=js("months"),qs=js("years");function Qs(){return le(this.days()/7)}var Xs=Math.round,Js={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ea(e,t,r,n,i){return i.relativeTime(t||1,!!r,e,n)}function ta(e,t,r,n){var i=wn(e).abs(),s=Xs(i.as("s")),a=Xs(i.as("m")),o=Xs(i.as("h")),l=Xs(i.as("d")),c=Xs(i.as("M")),h=Xs(i.as("w")),d=Xs(i.as("y")),u=s<=r.ss&&["s",s]||s<r.s&&["ss",s]||a<=1&&["m"]||a<r.m&&["mm",a]||o<=1&&["h"]||o<r.h&&["hh",o]||l<=1&&["d"]||l<r.d&&["dd",l];return null!=r.w&&(u=u||h<=1&&["w"]||h<r.w&&["ww",h]),(u=u||c<=1&&["M"]||c<r.M&&["MM",c]||d<=1&&["y"]||["yy",d])[2]=t,u[3]=+e>0,u[4]=n,ea.apply(null,u)}function ra(e){return void 0===e?Xs:"function"==typeof e&&(Xs=e,!0)}function na(e,t){return void 0!==Js[e]&&(void 0===t?Js[e]:(Js[e]=t,"s"===e&&(Js.ss=t-1),!0))}function ia(e,t){if(!this.isValid())return this.localeData().invalidDate();var r,n,i=!1,s=Js;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(s=Object.assign({},Js,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),n=ta(this,!i,s,r=this.localeData()),i&&(n=r.pastFuture(+this,n)),r.postformat(n)}var sa=Math.abs;function aa(e){return(e>0)-(e<0)||+e}function oa(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r,n,i,s,a,o,l=sa(this._milliseconds)/1e3,c=sa(this._days),h=sa(this._months),d=this.asSeconds();return d?(e=le(l/60),t=le(e/60),l%=60,e%=60,r=le(h/12),h%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",s=aa(this._months)!==aa(d)?"-":"",a=aa(this._days)!==aa(d)?"-":"",o=aa(this._milliseconds)!==aa(d)?"-":"",i+"P"+(r?s+r+"Y":"")+(h?s+h+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(l?o+n+"S":"")):"P0D"}var la=sn.prototype;return la.isValid=rn,la.abs=Es,la.add=_s,la.subtract=Ts,la.as=ks,la.asMilliseconds=Rs,la.asSeconds=Os,la.asMinutes=$s,la.asHours=Ds,la.asDays=Ls,la.asWeeks=Fs,la.asMonths=Ns,la.asQuarters=Bs,la.asYears=Vs,la.valueOf=As,la._bubble=Ps,la.clone=Us,la.get=zs,la.milliseconds=Gs,la.seconds=Hs,la.minutes=Zs,la.hours=Ws,la.days=Ks,la.weeks=Qs,la.months=Ys,la.years=qs,la.humanize=ia,la.toISOString=oa,la.toString=oa,la.toJSON=oa,la.locale=si,la.localeData=oi,la.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",oa),la.lang=ai,B("X",0,0,"unix"),B("x",0,0,"valueOf"),Oe("x",Ie),Oe("X",Me),Ne("X",(function(e,t,r){r._d=new Date(1e3*parseFloat(e))})),Ne("x",(function(e,t,r){r._d=new Date(ce(e))})),
|
|
2
2
|
//! moment.js
|
|
3
|
-
r.version="2.29.4",n(Wr),r.fn=os,r.min=Qr,r.max=Xr,r.now=Jr,r.utc=p,r.unix=ls,r.months=ms,r.isDate=h,r.locale=pr,r.invalid=y,r.duration=wn,r.isMoment=C,r.weekdays=ys,r.parseZone=cs,r.localeData=gr,r.isDuration=an,r.monthsShort=gs,r.weekdaysMin=bs,r.defineLocale=fr,r.updateLocale=mr,r.locales=yr,r.weekdaysShort=vs,r.normalizeUnits=re,r.relativeTimeRounding=ra,r.relativeTimeThreshold=na,r.calendarFormat=Vn,r.prototype=os,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}();var moment=moment$1.exports;const ZSession=z.object({id:z.string().min(1),created:z.date().or(z.string()).transform((e=>moment(e).toDate())),expire:z.boolean().default(!1).optional()}).strict(),ZOptions=z.object({localStorageKey:z.string().min(3).default("pxss"),keepSession:z.number().int().min(3).default(10)});class Session{get current(){return this._current}get noSession(){return new URLSearchParams(window.location.search).has("noSession")}get id(){if(this.noSession)return null;const e=window.localStorage.getItem(this.localStorageKey);if(null===e)return null;const t=ZSession.safeParse(JSON.parse(e));if(!t.success)return this.unset(),null;const r=t.data;return moment(r.created).add(this.options.keepSession,"seconds").isBefore(moment())?(this.unset(),null):r.id}get localStorageKey(){return this.options.localStorageKey}constructor(e){this.options=ZOptions.parse(e||{})}set(e){ZSession.shape.id.parse(e),this._current=e;const t={id:e,created:moment().toDate(),expire:!1};window.localStorage.setItem(this.localStorageKey,JSON.stringify(t))}unset(){window.localStorage.removeItem(this.localStorageKey)}}const ZErrorMessage=z.object({type:z.literal("error"),code:z.number().int(),reason:z.string(),verbosity:z.number()}),ZLoveLetter=z.object({type:z.literal("letter"),reason:z.string().startsWith("LL: "),code:z.number(),verbosity:z.number()}),ZSessionId=z.object({type:z.literal("sessionId"),sessionId:z.string()}),WebSdkSettings=z.object({conf:z.object({fullscreenButton:z.boolean().default(!0).describe(["Full-Screen Button|","Override Enable/Disable Enable/Disable the full-screen button.","Info: Please be aware that iOS (iPhone devices) does not support full-screen mode, and as a result, the button will not be displayed on these devices."].join("\n")).optional(),stopButton:z.boolean().default(!0).describe(["Stop Button|","Override Enable/Disable the stop overlay-button.","Info: Manually stops the connection."].join("\n")).optional(),audioButton:z.boolean().default(!1).describe(["Audio Button|","Override Enable/Disable the audio overlay-button.","Info: Displays the audio button if your Unreal Engine application includes audio."].join("\n")).optional(),infoButton:z.boolean().default(!1).describe(["Info Button|","Override Enable/Disable the info overlay-button."].join("\n")).optional(),micButton:z.boolean().default(!1).describe(["Mic Button|","Override Enable/Disable the microphone overlay-button.","Info: Enables users to interact with the Unreal Engine application using a microphone, which must be manually enabled by the user."].join("\n")).optional(),settingsButton:z.boolean().default(!1).describe(["Settings Button|","Override Enable/Disable the settings overlay-button."].join("\n")).optional(),connectionStrengthIcon:z.boolean().default(!1).describe(["Connection Strength|","Override Enable/Disable the connection strength overlay-icon."].join("\n")).optional()}).optional(),init:z.object({KeyboardInput:z.boolean().default(!0).describe(["Keyboard Input|","Override 'KeyboardInput' property of the WebSDK integration.","Info: Allows keyboard input events."].join("\n")).optional(),MouseInput:z.boolean().default(!0).describe(["Mouse Input|","Override 'MouseInput' property of the WebSDK integration.","Info: Allows mouse input events."].join("\n")).optional(),GamepadInput:z.boolean().describe(["Game pad Input|","Override 'GamepadInput' property of the WebSDK integration.","Info: Allows input events from gamepad controllers."].join("\n")).optional(),TouchInput:z.boolean().describe(["Touch Input|","Override 'TouchInput' property of the WebSDK integration.","Info: Allows touch events on mobile devices and tablets."].join("\n")).optional(),XRControllerInput:z.boolean().describe(["XR Controller Input|","Override 'XRControllerInput' property of the WebSDK integration.","Info: Allows input events from XR controllers for use with AR and VR setups."].join("\n")).optional(),FakeMouseWithTouches:z.boolean().describe(["Fake mouse with touches (Only for Admins)|","Override 'FakeMouseWithTouches' property of the WebSDK integration. When enabled this setting will convert single-finger touch input to mouse input.","Info: When this option is enabled, and the user is viewing the stream on a device with a touch screen such as a smartphone or tablet, this setting causes single-finger touch events to be interpreted by the Unreal Engine application as mouse clicks and drag events. Enabling this setting can provide users on mobile devices with the ability to partially control your Unreal Engine application, even when the application's input controller does not specifically handle touch input events."].join("\n")).optional(),ForceMonoAudio:z.boolean().describe(["Force mono audio|","Override 'ForceMonoAudio' of the WebSDK integration."].join("\n")).optional(),HoveringMouse:z.boolean().describe(["Hovering mouse|","Override 'HoveringMouse' property of the WebSDK integration."].join("\n")).optional()}).optional()}).strict(),ZStreamInfo=z.object({type:z.literal("streamInfo"),streamInfo:z.object({guid:z.string(),autoPlay:z.boolean().optional(),touchCapable:z.boolean().optional(),resolution:z.object({width:z.number().int().nonnegative(),height:z.number().int().nonnegative(),dynamic:z.boolean().optional(),fixed:z.boolean().optional()}).optional(),meta:z.object({friendlyName:z.string().optional(),isTrial:z.boolean().optional(),mouseLock:z.boolean().optional(),poweredBy:z.boolean().optional(),ueVersion:z.string().optional(),version:z.string().optional()}).optional(),webSdkSettings:WebSdkSettings.optional(),afk:z.object({enabled:z.boolean().describe("Enables / Disables AFK functionality."),warn:z.number().int().nonnegative().describe("Time in seconds, after last interaction, when the first warning will be triggered."),error:z.number().int().nonnegative().describe("Time in seconds, after warn trigger, when a more pushy warning will be triggered."),action:z.number().int().nonnegative().describe("Time in seconds, after error trigger, the actual disconnection action will take place.")},{description:"AFK stands for 'away from keyboard' and describes a timeout based on activity of the actual project. All execution of these settings are prone to frontend and therefore no full security measure for abuse! These settings can be overwritten by shareId, but would overwrite the settings given through frontend configuration."}).optional()})}),ZStats=z.object({type:z.literal("stats"),stats:z.object({codecs:z.custom(),candidatePair:z.custom(),localCandidates:z.custom(),remoteCandidates:z.custom(),DataChannelStats:z.custom(),bytesReceived:z.number(),packetsLost:z.number(),frameWidth:z.number(),frameHeight:z.number(),framesDecoded:z.number(),framesPerSecond:z.number(),framesDropped:z.number(),videoCodec:z.string(),audioCodec:z.string(),browserInfo:z.object({userAgent:z.string(),platform:z.string().nullable(),language:z.string()}).passthrough().partial(),currentRTT:z.number(),sessionRunTime:z.string(),controlsStreamInput:z.string().refine((e=>"true"===e||"false"===e)),videoEncoderAvgQP:z.number(),videoBitrate:z.number(),audioBitrate:z.number()}).passthrough().partial()}),ZPing=z.object({type:z.literal("ping"),message:z.string()}),ZQueue=z.object({type:z.literal("queue"),queue:z.object({index:z.number().int().optional(),queueLength:z.number().int().optional(),waited:z.number().optional(),estimatedWaitTime:z.number().optional(),averageWaitTime:z.number().optional(),valueType:z.enum(["milliseconds","seconds","minutes","hours","days"])})}),ZVersion=z.object({type:z.literal("version"),version:z.string().optional()}),Send={stats:ZStats},ArcwareSettingsSchema=z.object({session:z.string().optional(),token:z.string().optional(),bypass:z.boolean().optional(),errorHandler:z.function().args(ZErrorMessage).returns(z.void()).optional(),queueHandler:z.function().args(ZQueue).returns(z.void()).optional(),sessionIdHandler:z.function().args(z.string()).returns(z.void()).optional(),loveLetterHandler:z.function().args(ZLoveLetter).returns(z.void()).optional(),fullscreenButton:z.boolean().optional(),settingsButton:z.boolean().optional(),infoButton:z.boolean().optional(),audioButton:z.boolean().optional(),micButton:z.boolean().optional(),stopButton:z.boolean().optional(),connectionStrengthIcon:z.boolean().optional(),shareId:z.string().startsWith("share-").optional(),projectId:z.string().optional(),loveLetterLogging:z.boolean().optional(),connectionIdentifierLoggingDisabled:z.boolean().optional()}),DefaultUrl="wss://signalling-client.ragnarok.arcware.cloud";Vt.Log=(e,t,r)=>{},Vt.Info=(e,t,r)=>{},Vt.Warning=(e,t,r)=>{console.warn(t,e)},Vt.Error=(e,t,r)=>{(null==t?void 0:t.startsWith("unhandled Stat Type"))||console.error(t,e)};class ArcwareConfig extends Pt{static PickIdsOfUrl(){const{pathname:e}=new URL(window.location.href),t=e.split("/");return{projectId:t.find((e=>z.string().uuid().safeParse(e).success)),shareId:t.find((e=>z.string().startsWith("share-").safeParse(e).success))}}constructor(e){var t,r;if(!new URL(window.location.href).search.slice(1).split("&").find((e=>e.startsWith("df-")))&&!e.settings.shareId&&!e.settings.projectId)throw new Error("ShareId or ProjectId must be specified.");const n=ArcwareSettingsSchema.parse(e.settings);e.initialSettings||(e.initialSettings={}),(null===(t=e.initialSettings)||void 0===t?void 0:t.hasOwnProperty("AutoConnect"))||(e.initialSettings.AutoConnect=!1),(null===(r=e.initialSettings)||void 0===r?void 0:r.hasOwnProperty("AFKTimeout"))||(e.initialSettings.AFKTimeout=600),e.initialSettings.ss||(e.initialSettings.ss=DefaultUrl),super(e),this.VERSION="0.1.11",this.settings=n,this.session=new Session,this._initialSettings=e.initialSettings,this.setFlagEnabled(Ot.AFKDetection,!0),this.setFlagEnabled(Ot.BrowserSendOffer,!0)}get urlFlags(){var e;let t="";if(this.settings.shareId&&(t+=`&sh=${this.settings.shareId}`),this.settings.projectId&&(t+=`&p=${this.settings.projectId}`),"string"==typeof this.settings.session)t+=`&s=${this.settings.session}`;else{const e=this.session.id;e&&(t+=`&s=${e}`,t+="&r=true")}this.settings.bypass&&(t+="&b=true"),this.settings.token&&(t+=`&t=${this.settings.token}`);const r=null!==(e=new URLSearchParams(window.location.search).get("rId"))&&void 0!==e?e:void 0;r&&(t+=`&rId=${r}`);const n=new URL(window.location.href).search.slice(1).split("&").find((e=>e.startsWith("df-")));return n&&(t+=`&${n}`),t}get initialSettings(){return this._initialSettings}modifyInitialSettings(e){this.setFlagEnabled(Ot.HoveringMouseMode,e)}}var call=functionCall,hasOwn=hasOwnProperty_1,isPrototypeOf=objectIsPrototypeOf,regExpFlags=regexpFlags$1,RegExpPrototype$1=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$1||hasOwn(e,"flags")||!isPrototypeOf(RegExpPrototype$1,e)?t:call(regExpFlags,e)},PROPER_FUNCTION_NAME=functionName.PROPER,defineBuiltIn=defineBuiltIn$8,anObject=anObject$e,$toString=toString$8,fails=fails$l,getRegExpFlags=regexpGetFlags,TO_STRING="toString",RegExpPrototype=RegExp.prototype,nativeToString=RegExpPrototype[TO_STRING],NOT_GENERIC=fails((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=PROPER_FUNCTION_NAME&&nativeToString.name!=TO_STRING;function UrlBuilder(e,t){const r=new URL(decodeURIComponent(e())),n=r.searchParams;let i=t;return i&&(i.startsWith("?")&&(i=i.substring(1)),i.split("&").forEach((e=>{const[t,r]=e.split("=");n.append(t,r)}))),r.toString()}function ApplyUrlHack(){const e=jt.prototype.setWebRtcPlayerController;jt.prototype.setWebRtcPlayerController=function(t){const r=t.signallingUrlBuilder;t.signallingUrlBuilder=()=>UrlBuilder(r,this.config.urlFlags),e.call(this,t)}}(NOT_GENERIC||INCORRECT_NAME)&&defineBuiltIn(RegExp.prototype,TO_STRING,(function(){var e=anObject(this);return"/"+$toString(e.source)+"/"+$toString(getRegExpFlags(e))}),{unsafe:!0});class EventHandler{add(e){return this.callbacks.find((t=>t===e))?null:(this.callbacks.push(e),e)}remove(e){const t=this.callbacks.find((t=>t===e));return t&&this.callbacks.splice(this.callbacks.indexOf(t),1),!!t}constructor(){this.callbacks=new Array}static Emit(e,t){e.callbacks.forEach((e=>e(t)))}}function Stats(e){return ZStats.shape.stats.parse({codecs:e.codecs,candidatePair:e.candidatePair,localCandidates:e.localCandidates,remoteCandidates:e.remoteCandidates,DataChannelStats:e.DataChannelStats,bytesReceived:e.inboundVideoStats.bytesReceived,packetsLost:e.inboundVideoStats.packetsLost,frameWidth:e.inboundVideoStats.frameWidth,frameHeight:e.inboundVideoStats.frameHeight,framesDecoded:e.inboundVideoStats.framesDecoded,framesPerSecond:e.inboundVideoStats.framesPerSecond,framesDropped:e.inboundVideoStats.framesDropped,videoCodec:e.inboundVideoStats.codecId,audioCodec:e.inboundAudioStats.codecId,browserInfo:{userAgent:navigator.userAgent,platform:navigator.oscpu||navigator.platform||null,language:navigator.language},currentRTT:e.candidatePair.currentRoundTripTime,sessionRunTime:e.sessionStats.runTime,controlsStreamInput:e.sessionStats.controlsStreamInput,videoEncoderAvgQP:e.sessionStats.videoEncoderAvgQP,videoBitrate:e.inboundVideoStats.bitrate,audioBitrate:e.inboundAudioStats.bitrate})}var lodash={exports:{}};
|
|
3
|
+
r.version="2.29.4",n(Wr),r.fn=os,r.min=Qr,r.max=Xr,r.now=Jr,r.utc=p,r.unix=ls,r.months=ms,r.isDate=h,r.locale=pr,r.invalid=y,r.duration=wn,r.isMoment=C,r.weekdays=ys,r.parseZone=cs,r.localeData=gr,r.isDuration=an,r.monthsShort=gs,r.weekdaysMin=bs,r.defineLocale=fr,r.updateLocale=mr,r.locales=yr,r.weekdaysShort=vs,r.normalizeUnits=re,r.relativeTimeRounding=ra,r.relativeTimeThreshold=na,r.calendarFormat=Vn,r.prototype=os,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}();var moment=moment$1.exports;const ZSession=z.object({id:z.string().min(1),created:z.date().or(z.string()).transform((e=>moment(e).toDate())),expire:z.boolean().default(!1).optional()}).strict(),ZOptions=z.object({localStorageKey:z.string().min(3).default("pxss"),keepSession:z.number().int().min(3).default(10)});class Session{get current(){return this._current}get noSession(){return new URLSearchParams(window.location.search).has("noSession")}get id(){if(this.noSession)return null;const e=window.localStorage.getItem(this.localStorageKey);if(null===e)return null;const t=ZSession.safeParse(JSON.parse(e));if(!t.success)return this.unset(),null;const r=t.data;return moment(r.created).add(this.options.keepSession,"seconds").isBefore(moment())?(this.unset(),null):r.id}get localStorageKey(){return this.options.localStorageKey}constructor(e){this.options=ZOptions.parse(e||{})}set(e){ZSession.shape.id.parse(e),this._current=e;const t={id:e,created:moment().toDate(),expire:!1};window.localStorage.setItem(this.localStorageKey,JSON.stringify(t))}unset(){window.localStorage.removeItem(this.localStorageKey)}}const ZErrorMessage=z.object({type:z.literal("error"),code:z.number().int(),reason:z.string(),verbosity:z.number()}),ZLoveLetter=z.object({type:z.literal("letter"),reason:z.string().startsWith("LL: "),code:z.number(),verbosity:z.number()}),ZSessionId=z.object({type:z.literal("sessionId"),sessionId:z.string()}),WebSdkSettings=z.object({conf:z.object({fullscreenButton:z.boolean().default(!0).describe(["Full-Screen Button|","Override Enable/Disable Enable/Disable the full-screen button.","Info: Please be aware that iOS (iPhone devices) does not support full-screen mode, and as a result, the button will not be displayed on these devices."].join("\n")).optional(),stopButton:z.boolean().default(!0).describe(["Stop Button|","Override Enable/Disable the stop overlay-button.","Info: Manually stops the connection."].join("\n")).optional(),audioButton:z.boolean().default(!1).describe(["Audio Button|","Override Enable/Disable the audio overlay-button.","Info: Displays the audio button if your Unreal Engine application includes audio."].join("\n")).optional(),infoButton:z.boolean().default(!1).describe(["Info Button|","Override Enable/Disable the info overlay-button."].join("\n")).optional(),micButton:z.boolean().default(!1).describe(["Mic Button|","Override Enable/Disable the microphone overlay-button.","Info: Enables users to interact with the Unreal Engine application using a microphone, which must be manually enabled by the user."].join("\n")).optional(),settingsButton:z.boolean().default(!1).describe(["Settings Button|","Override Enable/Disable the settings overlay-button."].join("\n")).optional(),connectionStrengthIcon:z.boolean().default(!1).describe(["Connection Strength|","Override Enable/Disable the connection strength overlay-icon."].join("\n")).optional()}).optional(),init:z.object({KeyboardInput:z.boolean().default(!0).describe(["Keyboard Input|","Override 'KeyboardInput' property of the WebSDK integration.","Info: Allows keyboard input events."].join("\n")).optional(),MouseInput:z.boolean().default(!0).describe(["Mouse Input|","Override 'MouseInput' property of the WebSDK integration.","Info: Allows mouse input events."].join("\n")).optional(),GamepadInput:z.boolean().describe(["Game pad Input|","Override 'GamepadInput' property of the WebSDK integration.","Info: Allows input events from gamepad controllers."].join("\n")).optional(),TouchInput:z.boolean().describe(["Touch Input|","Override 'TouchInput' property of the WebSDK integration.","Info: Allows touch events on mobile devices and tablets."].join("\n")).optional(),XRControllerInput:z.boolean().describe(["XR Controller Input|","Override 'XRControllerInput' property of the WebSDK integration.","Info: Allows input events from XR controllers for use with AR and VR setups."].join("\n")).optional(),FakeMouseWithTouches:z.boolean().describe(["Fake mouse with touches (Only for Admins)|","Override 'FakeMouseWithTouches' property of the WebSDK integration. When enabled this setting will convert single-finger touch input to mouse input.","Info: When this option is enabled, and the user is viewing the stream on a device with a touch screen such as a smartphone or tablet, this setting causes single-finger touch events to be interpreted by the Unreal Engine application as mouse clicks and drag events. Enabling this setting can provide users on mobile devices with the ability to partially control your Unreal Engine application, even when the application's input controller does not specifically handle touch input events."].join("\n")).optional(),ForceMonoAudio:z.boolean().describe(["Force mono audio|","Override 'ForceMonoAudio' of the WebSDK integration."].join("\n")).optional(),HoveringMouse:z.boolean().describe(["Hovering mouse|","Override 'HoveringMouse' property of the WebSDK integration."].join("\n")).optional()}).optional()}).strict(),ZStreamInfo=z.object({type:z.literal("streamInfo"),streamInfo:z.object({guid:z.string(),autoPlay:z.boolean().optional(),touchCapable:z.boolean().optional(),resolution:z.object({width:z.number().int().nonnegative(),height:z.number().int().nonnegative(),dynamic:z.boolean().optional(),fixed:z.boolean().optional()}).optional(),meta:z.object({friendlyName:z.string().optional(),isTrial:z.boolean().optional(),mouseLock:z.boolean().optional(),poweredBy:z.boolean().optional(),ueVersion:z.string().optional(),version:z.string().optional()}).optional(),webSdkSettings:WebSdkSettings.optional(),afk:z.object({enabled:z.boolean().describe("Enables / Disables AFK functionality."),warn:z.number().int().nonnegative().describe("Time in seconds, after last interaction, when the first warning will be triggered."),error:z.number().int().nonnegative().describe("Time in seconds, after warn trigger, when a more pushy warning will be triggered."),action:z.number().int().nonnegative().describe("Time in seconds, after error trigger, the actual disconnection action will take place.")},{description:"AFK stands for 'away from keyboard' and describes a timeout based on activity of the actual project. All execution of these settings are prone to frontend and therefore no full security measure for abuse! These settings can be overwritten by shareId, but would overwrite the settings given through frontend configuration."}).optional()})}),ZStats=z.object({type:z.literal("stats"),stats:z.object({codecs:z.custom(),candidatePair:z.custom(),localCandidates:z.custom(),remoteCandidates:z.custom(),DataChannelStats:z.custom(),bytesReceived:z.number(),packetsLost:z.number(),frameWidth:z.number(),frameHeight:z.number(),framesDecoded:z.number(),framesPerSecond:z.number(),framesDropped:z.number(),videoCodec:z.string(),audioCodec:z.string(),browserInfo:z.object({userAgent:z.string(),platform:z.string().nullable(),language:z.string()}).passthrough().partial(),currentRTT:z.number(),sessionRunTime:z.string(),controlsStreamInput:z.string().refine((e=>"true"===e||"false"===e)),videoEncoderAvgQP:z.number(),videoBitrate:z.number(),audioBitrate:z.number()}).passthrough().partial()}),ZPing=z.object({type:z.literal("ping"),message:z.string()}),ZQueue=z.object({type:z.literal("queue"),queue:z.object({index:z.number().int().optional(),queueLength:z.number().int().optional(),waited:z.number().optional(),estimatedWaitTime:z.number().optional(),averageWaitTime:z.number().optional(),valueType:z.enum(["milliseconds","seconds","minutes","hours","days"])})}),ZVersion=z.object({type:z.literal("version"),version:z.string().optional()}),Send={stats:ZStats},ArcwareSettingsSchema=z.object({session:z.string().optional(),token:z.string().optional(),bypass:z.boolean().optional(),errorHandler:z.function().args(ZErrorMessage).returns(z.void()).optional(),queueHandler:z.function().args(ZQueue).returns(z.void()).optional(),sessionIdHandler:z.function().args(z.string()).returns(z.void()).optional(),loveLetterHandler:z.function().args(ZLoveLetter).returns(z.void()).optional(),fullscreenButton:z.boolean().optional(),settingsButton:z.boolean().optional(),infoButton:z.boolean().optional(),audioButton:z.boolean().optional(),micButton:z.boolean().optional(),stopButton:z.boolean().optional(),connectionStrengthIcon:z.boolean().optional(),shareId:z.string().startsWith("share-").optional(),projectId:z.string().optional(),loveLetterLogging:z.boolean().optional(),connectionIdentifierLoggingDisabled:z.boolean().optional()}),DefaultUrl="wss://signalling-client.ragnarok.arcware.cloud";Vt.Log=(e,t,r)=>{},Vt.Info=(e,t,r)=>{},Vt.Warning=(e,t,r)=>{console.warn(t,e)},Vt.Error=(e,t,r)=>{(null==t?void 0:t.startsWith("unhandled Stat Type"))||console.error(t,e)};class ArcwareConfig extends Pt{static PickIdsOfUrl(){const{pathname:e}=new URL(window.location.href),t=e.split("/");return{projectId:t.find((e=>z.string().uuid().safeParse(e).success)),shareId:t.find((e=>z.string().startsWith("share-").safeParse(e).success))}}constructor(e){var t,r;if(!new URL(window.location.href).search.slice(1).split("&").find((e=>e.startsWith("df-")))&&!e.settings.shareId&&!e.settings.projectId)throw new Error("ShareId or ProjectId must be specified.");const n=ArcwareSettingsSchema.parse(e.settings);e.initialSettings||(e.initialSettings={}),(null===(t=e.initialSettings)||void 0===t?void 0:t.hasOwnProperty("AutoConnect"))||(e.initialSettings.AutoConnect=!1),(null===(r=e.initialSettings)||void 0===r?void 0:r.hasOwnProperty("AFKTimeout"))||(e.initialSettings.AFKTimeout=600),e.initialSettings.ss||(e.initialSettings.ss=DefaultUrl),super(e),this.VERSION="0.1.12",this.settings=n,this.session=new Session,this._initialSettings=e.initialSettings,this.setFlagEnabled(Ot.AFKDetection,!0),this.setFlagEnabled(Ot.BrowserSendOffer,!0)}get urlFlags(){var e;let t="";if(this.settings.shareId&&(t+=`&sh=${this.settings.shareId}`),this.settings.projectId&&(t+=`&p=${this.settings.projectId}`),"string"==typeof this.settings.session)t+=`&s=${this.settings.session}`;else{const e=this.session.id;e&&(t+=`&s=${e}`,t+="&r=true")}this.settings.bypass&&(t+="&b=true"),this.settings.token&&(t+=`&t=${this.settings.token}`);const r=null!==(e=new URLSearchParams(window.location.search).get("rId"))&&void 0!==e?e:void 0;r&&(t+=`&rId=${r}`);const n=new URL(window.location.href).search.slice(1).split("&").find((e=>e.startsWith("df-")));return n&&(t+=`&${n}`),t}get initialSettings(){return this._initialSettings}modifyInitialSettings(e){this.setFlagEnabled(Ot.HoveringMouseMode,e)}}var call=functionCall,hasOwn=hasOwnProperty_1,isPrototypeOf=objectIsPrototypeOf,regExpFlags=regexpFlags$1,RegExpPrototype$1=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$1||hasOwn(e,"flags")||!isPrototypeOf(RegExpPrototype$1,e)?t:call(regExpFlags,e)},PROPER_FUNCTION_NAME=functionName.PROPER,defineBuiltIn=defineBuiltIn$8,anObject=anObject$e,$toString=toString$8,fails=fails$l,getRegExpFlags=regexpGetFlags,TO_STRING="toString",RegExpPrototype=RegExp.prototype,nativeToString=RegExpPrototype[TO_STRING],NOT_GENERIC=fails((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=PROPER_FUNCTION_NAME&&nativeToString.name!=TO_STRING;function UrlBuilder(e,t){const r=new URL(decodeURIComponent(e())),n=r.searchParams;let i=t;return i&&(i.startsWith("?")&&(i=i.substring(1)),i.split("&").forEach((e=>{const[t,r]=e.split("=");n.append(t,r)}))),r.toString()}function ApplyUrlHack(){const e=jt.prototype.setWebRtcPlayerController;jt.prototype.setWebRtcPlayerController=function(t){const r=t.signallingUrlBuilder;t.signallingUrlBuilder=()=>UrlBuilder(r,this.config.urlFlags),e.call(this,t)}}(NOT_GENERIC||INCORRECT_NAME)&&defineBuiltIn(RegExp.prototype,TO_STRING,(function(){var e=anObject(this);return"/"+$toString(e.source)+"/"+$toString(getRegExpFlags(e))}),{unsafe:!0});class EventHandler{add(e){return this.callbacks.find((t=>t===e))?null:(this.callbacks.push(e),e)}remove(e){const t=this.callbacks.find((t=>t===e));return t&&this.callbacks.splice(this.callbacks.indexOf(t),1),!!t}constructor(){this.callbacks=new Array}static Emit(e,t){e.callbacks.forEach((e=>e(t)))}}function Stats(e){return ZStats.shape.stats.parse({codecs:e.codecs,candidatePair:e.candidatePair,localCandidates:e.localCandidates,remoteCandidates:e.remoteCandidates,DataChannelStats:e.DataChannelStats,bytesReceived:e.inboundVideoStats.bytesReceived,packetsLost:e.inboundVideoStats.packetsLost,frameWidth:e.inboundVideoStats.frameWidth,frameHeight:e.inboundVideoStats.frameHeight,framesDecoded:e.inboundVideoStats.framesDecoded,framesPerSecond:e.inboundVideoStats.framesPerSecond,framesDropped:e.inboundVideoStats.framesDropped,videoCodec:e.inboundVideoStats.codecId,audioCodec:e.inboundAudioStats.codecId,browserInfo:{userAgent:navigator.userAgent,platform:navigator.oscpu||navigator.platform||null,language:navigator.language},currentRTT:e.candidatePair.currentRoundTripTime,sessionRunTime:e.sessionStats.runTime,controlsStreamInput:e.sessionStats.controlsStreamInput,videoEncoderAvgQP:e.sessionStats.videoEncoderAvgQP,videoBitrate:e.inboundVideoStats.bitrate,audioBitrate:e.inboundAudioStats.bitrate})}var lodash={exports:{}};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Lodash <https://lodash.com/>
|
|
@@ -8,4 +8,4 @@ r.version="2.29.4",n(Wr),r.fn=os,r.min=Qr,r.max=Xr,r.now=Jr,r.utc=p,r.unix=ls,r.
|
|
|
8
8
|
* Released under MIT license <https://lodash.com/license>
|
|
9
9
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
10
10
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
11
|
-
*/!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",a=16,o=32,l=64,c=128,h=256,d=1/0,u=9007199254740991,p=NaN,f=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",o],["partialRight",l],["rearg",h]],g="[object Arguments]",y="[object Array]",v="[object Boolean]",b="[object Date]",S="[object Error]",E="[object Function]",C="[object GeneratorFunction]",_="[object Map]",T="[object Number]",x="[object Object]",P="[object Promise]",w="[object RegExp]",I="[object Set]",k="[object String]",A="[object Symbol]",M="[object WeakMap]",R="[object ArrayBuffer]",O="[object DataView]",$="[object Float32Array]",D="[object Float64Array]",L="[object Int8Array]",F="[object Int16Array]",N="[object Int32Array]",B="[object Uint8Array]",V="[object Uint8ClampedArray]",U="[object Uint16Array]",z="[object Uint32Array]",j=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,K=RegExp(Z.source),Y=RegExp(W.source),q=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(re.source),ie=/^\s+/,se=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,Ce="\\ud800-\\udfff",_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Te="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",we="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="['’]",Ae="["+Ce+"]",Me="["+Ie+"]",Re="["+_e+"]",Oe="\\d+",$e="["+Te+"]",De="["+xe+"]",Le="[^"+Ce+Ie+Oe+Te+xe+Pe+"]",Fe="\\ud83c[\\udffb-\\udfff]",Ne="[^"+Ce+"]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Ve="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Pe+"]",ze="\\u200d",je="(?:"+De+"|"+Le+")",Ge="(?:"+Ue+"|"+Le+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",Ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Re+"|"+Fe+")"+"?",Ke="["+we+"]?",Ye=Ke+We+("(?:"+ze+"(?:"+[Ne,Be,Ve].join("|")+")"+Ke+We+")*"),qe="(?:"+[$e,Be,Ve].join("|")+")"+Ye,Qe="(?:"+[Ne+Re+"?",Re,Be,Ve,Ae].join("|")+")",Xe=RegExp(ke,"g"),Je=RegExp(Re,"g"),et=RegExp(Fe+"(?="+Fe+")|"+Qe+Ye,"g"),tt=RegExp([Ue+"?"+De+"+"+He+"(?="+[Me,Ue,"$"].join("|")+")",Ge+"+"+Ze+"(?="+[Me,Ue+je,"$"].join("|")+")",Ue+"?"+je+"+"+He,Ue+"+"+Ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,qe].join("|"),"g"),rt=RegExp("["+ze+Ce+_e+we+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,at={};at[$]=at[D]=at[L]=at[F]=at[N]=at[B]=at[V]=at[U]=at[z]=!0,at[g]=at[y]=at[R]=at[v]=at[O]=at[b]=at[S]=at[E]=at[_]=at[T]=at[x]=at[w]=at[I]=at[k]=at[M]=!1;var ot={};ot[g]=ot[y]=ot[R]=ot[O]=ot[v]=ot[b]=ot[$]=ot[D]=ot[L]=ot[F]=ot[N]=ot[_]=ot[T]=ot[x]=ot[w]=ot[I]=ot[k]=ot[A]=ot[B]=ot[V]=ot[U]=ot[z]=!0,ot[S]=ot[E]=ot[M]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,ht=parseInt,dt="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ut="object"==typeof self&&self&&self.Object===Object&&self,pt=dt||ut||Function("return this")(),ft=t&&!t.nodeType&&t,mt=ft&&e&&!e.nodeType&&e,gt=mt&&mt.exports===ft,yt=gt&&dt.process,vt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(e){}}(),bt=vt&&vt.isArrayBuffer,St=vt&&vt.isDate,Et=vt&&vt.isMap,Ct=vt&&vt.isRegExp,_t=vt&&vt.isSet,Tt=vt&&vt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Pt(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i<s;){var a=e[i];t(n,a,r(a),e)}return n}function wt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function It(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function At(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}function Mt(e,t){return!!(null==e?0:e.length)&&Ut(e,t,0)>-1}function Rt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Ot(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function $t(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Dt(e,t,r,n){var i=-1,s=null==e?0:e.length;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function Lt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Ft(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Nt=Ht("length");function Bt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Vt(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function Ut(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Vt(e,jt,r)}function zt(e,t,r,n){for(var i=r-1,s=e.length;++i<s;)if(n(e[i],t))return i;return-1}function jt(e){return e!=e}function Gt(e,t){var r=null==e?0:e.length;return r?Kt(e,t)/r:p}function Ht(e){return function(t){return null==t?r:t[e]}}function Zt(e){return function(t){return null==e?r:e[t]}}function Wt(e,t,r,n,i){return i(e,(function(e,i,s){r=n?(n=!1,e):t(r,e,i,s)})),r}function Kt(e,t){for(var n,i=-1,s=e.length;++i<s;){var a=t(e[i]);a!==r&&(n=n===r?a:n+a)}return n}function Yt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function qt(e){return e?e.slice(0,pr(e)+1).replace(ie,""):e}function Qt(e){return function(t){return e(t)}}function Xt(e,t){return Ot(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function er(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function tr(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var rr=Zt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function ir(e){return"\\"+lt[e]}function sr(e){return rt.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function lr(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var o=e[r];o!==t&&o!==s||(e[r]=s,a[i++]=r)}return a}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function hr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function dr(e){return sr(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Nt(e)}function ur(e){return sr(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function pr(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var fr=Zt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var mr=function e(t){var se=(t=null==t?pt:mr.defaults(pt.Object(),t,mr.pick(pt,it))).Array,Ce=t.Date,_e=t.Error,Te=t.Function,xe=t.Math,Pe=t.Object,we=t.RegExp,Ie=t.String,ke=t.TypeError,Ae=se.prototype,Me=Te.prototype,Re=Pe.prototype,Oe=t["__core-js_shared__"],$e=Me.toString,De=Re.hasOwnProperty,Le=0,Fe=function(){var e=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ne=Re.toString,Be=$e.call(Pe),Ve=pt._,Ue=we("^"+$e.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=gt?t.Buffer:r,je=t.Symbol,Ge=t.Uint8Array,He=ze?ze.allocUnsafe:r,Ze=or(Pe.getPrototypeOf,Pe),We=Pe.create,Ke=Re.propertyIsEnumerable,Ye=Ae.splice,qe=je?je.isConcatSpreadable:r,Qe=je?je.iterator:r,et=je?je.toStringTag:r,rt=function(){try{var e=ds(Pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,dt=Ce&&Ce.now!==pt.Date.now&&Ce.now,ut=t.setTimeout!==pt.setTimeout&&t.setTimeout,ft=xe.ceil,mt=xe.floor,yt=Pe.getOwnPropertySymbols,vt=ze?ze.isBuffer:r,Nt=t.isFinite,Zt=Ae.join,gr=or(Pe.keys,Pe),yr=xe.max,vr=xe.min,br=Ce.now,Sr=t.parseInt,Er=xe.random,Cr=Ae.reverse,_r=ds(t,"DataView"),Tr=ds(t,"Map"),xr=ds(t,"Promise"),Pr=ds(t,"Set"),wr=ds(t,"WeakMap"),Ir=ds(Pe,"create"),kr=wr&&new wr,Ar={},Mr=Fs(_r),Rr=Fs(Tr),Or=Fs(xr),$r=Fs(Pr),Dr=Fs(wr),Lr=je?je.prototype:r,Fr=Lr?Lr.valueOf:r,Nr=Lr?Lr.toString:r;function Br(e){if(eo(e)&&!ja(e)&&!(e instanceof jr)){if(e instanceof zr)return e;if(De.call(e,"__wrapped__"))return Ns(e)}return new zr(e)}var Vr=function(){function e(){}return function(t){if(!Ja(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Ur(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function jr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Gr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Zr;++t<r;)this.add(e[t])}function Kr(e){var t=this.__data__=new Hr(e);this.size=t.size}function Yr(e,t){var r=ja(e),n=!r&&za(e),i=!r&&!n&&Wa(e),s=!r&&!n&&!i&&lo(e),a=r||n||i||s,o=a?Yt(e.length,Ie):[],l=o.length;for(var c in e)!t&&!De.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vs(c,l))||o.push(c);return o}function qr(e){var t=e.length;return t?e[Kn(0,t-1)]:r}function Qr(e,t){return $s(ki(e),on(t,0,e.length))}function Xr(e){return $s(ki(e))}function Jr(e,t,n){(n!==r&&!Ba(e[t],n)||n===r&&!(t in e))&&sn(e,t,n)}function en(e,t,n){var i=e[t];De.call(e,t)&&Ba(i,n)&&(n!==r||t in e)||sn(e,t,n)}function tn(e,t){for(var r=e.length;r--;)if(Ba(e[r][0],t))return r;return-1}function rn(e,t,r,n){return un(e,(function(e,i,s){t(n,e,r(e),s)})),n}function nn(e,t){return e&&Ai(t,Mo(t),e)}function sn(e,t,r){"__proto__"==t&&rt?rt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function an(e,t){for(var n=-1,i=t.length,s=se(i),a=null==e;++n<i;)s[n]=a?r:Po(e,t[n]);return s}function on(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function ln(e,t,n,i,s,a){var o,l=1&t,c=2&t,h=4&t;if(n&&(o=s?n(e,i,s,a):n(e)),o!==r)return o;if(!Ja(e))return e;var d=ja(e);if(d){if(o=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return ki(e,o)}else{var u=fs(e),p=u==E||u==C;if(Wa(e))return _i(e,l);if(u==x||u==g||p&&!s){if(o=c||p?{}:gs(e),!l)return c?function(e,t){return Ai(e,ps(e),t)}(e,function(e,t){return e&&Ai(t,Ro(t),e)}(o,e)):function(e,t){return Ai(e,us(e),t)}(e,nn(o,e))}else{if(!ot[u])return s?e:{};o=function(e,t,r){var n=e.constructor;switch(t){case R:return Ti(e);case v:case b:return new n(+e);case O:return function(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case $:case D:case L:case F:case N:case B:case V:case U:case z:return xi(e,r);case _:return new n;case T:case k:return new n(e);case w:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new n;case A:return i=e,Fr?Pe(Fr.call(i)):{}}var i}(e,u,l)}}a||(a=new Kr);var f=a.get(e);if(f)return f;a.set(e,o),so(e)?e.forEach((function(r){o.add(ln(r,t,n,r,e,a))})):to(e)&&e.forEach((function(r,i){o.set(i,ln(r,t,n,i,e,a))}));var m=d?r:(h?c?is:ns:c?Ro:Mo)(e);return wt(m||e,(function(r,i){m&&(r=e[i=r]),en(o,i,ln(r,t,n,i,e,a))})),o}function cn(e,t,n){var i=n.length;if(null==e)return!i;for(e=Pe(e);i--;){var s=n[i],a=t[s],o=e[s];if(o===r&&!(s in e)||!a(o))return!1}return!0}function hn(e,t,i){if("function"!=typeof e)throw new ke(n);return As((function(){e.apply(r,i)}),t)}function dn(e,t,r,n){var i=-1,s=Mt,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;r&&(t=Ot(t,Qt(r))),n?(s=Rt,a=!1):t.length>=200&&(s=Jt,a=!1,t=new Wr(t));e:for(;++i<o;){var h=e[i],d=null==r?h:r(h);if(h=n||0!==h?h:0,a&&d==d){for(var u=c;u--;)if(t[u]===d)continue e;l.push(h)}else s(t,d,n)||l.push(h)}return l}Br.templateSettings={escape:q,evaluate:Q,interpolate:X,variable:"",imports:{_:Br}},Br.prototype=Ur.prototype,Br.prototype.constructor=Br,zr.prototype=Vr(Ur.prototype),zr.prototype.constructor=zr,jr.prototype=Vr(Ur.prototype),jr.prototype.constructor=jr,Gr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Gr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Gr.prototype.get=function(e){var t=this.__data__;if(Ir){var n=t[e];return n===i?r:n}return De.call(t,e)?t[e]:r},Gr.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==r:De.call(t,e)},Gr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ir&&t===r?i:t,this},Hr.prototype.clear=function(){this.__data__=[],this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=tn(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},Hr.prototype.get=function(e){var t=this.__data__,n=tn(t,e);return n<0?r:t[n][1]},Hr.prototype.has=function(e){return tn(this.__data__,e)>-1},Hr.prototype.set=function(e,t){var r=this.__data__,n=tn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Gr,map:new(Tr||Hr),string:new Gr}},Zr.prototype.delete=function(e){var t=cs(this,e).delete(e);return this.size-=t?1:0,t},Zr.prototype.get=function(e){return cs(this,e).get(e)},Zr.prototype.has=function(e){return cs(this,e).has(e)},Zr.prototype.set=function(e,t){var r=cs(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Wr.prototype.add=Wr.prototype.push=function(e){return this.__data__.set(e,i),this},Wr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.clear=function(){this.__data__=new Hr,this.size=0},Kr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Kr.prototype.get=function(e){return this.__data__.get(e)},Kr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Hr){var n=r.__data__;if(!Tr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Zr(n)}return r.set(e,t),this.size=r.size,this};var un=Oi(Sn),pn=Oi(En,!0);function fn(e,t){var r=!0;return un(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function mn(e,t,n){for(var i=-1,s=e.length;++i<s;){var a=e[i],o=t(a);if(null!=o&&(l===r?o==o&&!oo(o):n(o,l)))var l=o,c=a}return c}function gn(e,t){var r=[];return un(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function yn(e,t,r,n,i){var s=-1,a=e.length;for(r||(r=ys),i||(i=[]);++s<a;){var o=e[s];t>0&&r(o)?t>1?yn(o,t-1,r,n,i):$t(i,o):n||(i[i.length]=o)}return i}var vn=$i(),bn=$i(!0);function Sn(e,t){return e&&vn(e,t,Mo)}function En(e,t){return e&&bn(e,t,Mo)}function Cn(e,t){return At(t,(function(t){return qa(e[t])}))}function _n(e,t){for(var n=0,i=(t=bi(t,e)).length;null!=e&&n<i;)e=e[Ls(t[n++])];return n&&n==i?e:r}function Tn(e,t,r){var n=t(e);return ja(e)?n:$t(n,r(e))}function xn(e){return null==e?e===r?"[object Undefined]":"[object Null]":et&&et in Pe(e)?function(e){var t=De.call(e,et),n=e[et];try{e[et]=r;var i=!0}catch(e){}var s=Ne.call(e);i&&(t?e[et]=n:delete e[et]);return s}(e):function(e){return Ne.call(e)}(e)}function Pn(e,t){return e>t}function wn(e,t){return null!=e&&De.call(e,t)}function In(e,t){return null!=e&&t in Pe(e)}function kn(e,t,n){for(var i=n?Rt:Mt,s=e[0].length,a=e.length,o=a,l=se(a),c=1/0,h=[];o--;){var d=e[o];o&&t&&(d=Ot(d,Qt(t))),c=vr(d.length,c),l[o]=!n&&(t||s>=120&&d.length>=120)?new Wr(o&&d):r}d=e[0];var u=-1,p=l[0];e:for(;++u<s&&h.length<c;){var f=d[u],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?Jt(p,m):i(h,m,n))){for(o=a;--o;){var g=l[o];if(!(g?Jt(g,m):i(e[o],m,n)))continue e}p&&p.push(m),h.push(f)}}return h}function An(e,t,n){var i=null==(e=ws(e,t=bi(t,e)))?e:e[Ls(Ys(t))];return null==i?r:xt(i,e,n)}function Mn(e){return eo(e)&&xn(e)==g}function Rn(e,t,n,i,s){return e===t||(null==e||null==t||!eo(e)&&!eo(t)?e!=e&&t!=t:function(e,t,n,i,s,a){var o=ja(e),l=ja(t),c=o?y:fs(e),h=l?y:fs(t),d=(c=c==g?x:c)==x,u=(h=h==g?x:h)==x,p=c==h;if(p&&Wa(e)){if(!Wa(t))return!1;o=!0,d=!1}if(p&&!d)return a||(a=new Kr),o||lo(e)?ts(e,t,n,i,s,a):function(e,t,r,n,i,s,a){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!s(new Ge(e),new Ge(t)));case v:case b:case T:return Ba(+e,+t);case S:return e.name==t.name&&e.message==t.message;case w:case k:return e==t+"";case _:var o=ar;case I:var l=1&n;if(o||(o=cr),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var h=ts(o(e),o(t),n,i,s,a);return a.delete(e),h;case A:if(Fr)return Fr.call(e)==Fr.call(t)}return!1}(e,t,c,n,i,s,a);if(!(1&n)){var f=d&&De.call(e,"__wrapped__"),m=u&&De.call(t,"__wrapped__");if(f||m){var E=f?e.value():e,C=m?t.value():t;return a||(a=new Kr),s(E,C,n,i,a)}}if(!p)return!1;return a||(a=new Kr),function(e,t,n,i,s,a){var o=1&n,l=ns(e),c=l.length,h=ns(t),d=h.length;if(c!=d&&!o)return!1;var u=c;for(;u--;){var p=l[u];if(!(o?p in t:De.call(t,p)))return!1}var f=a.get(e),m=a.get(t);if(f&&m)return f==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);var y=o;for(;++u<c;){var v=e[p=l[u]],b=t[p];if(i)var S=o?i(b,v,p,t,e,a):i(v,b,p,e,t,a);if(!(S===r?v===b||s(v,b,n,i,a):S)){g=!1;break}y||(y="constructor"==p)}if(g&&!y){var E=e.constructor,C=t.constructor;E==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof C&&C instanceof C||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,n,i,s,a)}(e,t,n,i,Rn,s))}function On(e,t,n,i){var s=n.length,a=s,o=!i;if(null==e)return!a;for(e=Pe(e);s--;){var l=n[s];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<a;){var c=(l=n[s])[0],h=e[c],d=l[1];if(o&&l[2]){if(h===r&&!(c in e))return!1}else{var u=new Kr;if(i)var p=i(h,d,c,e,t,u);if(!(p===r?Rn(d,h,3,i,u):p))return!1}}return!0}function $n(e){return!(!Ja(e)||(t=e,Fe&&Fe in t))&&(qa(e)?Ue:ge).test(Fs(e));var t}function Dn(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?ja(e)?Un(e[0],e[1]):Vn(e):ul(e)}function Ln(e){if(!_s(e))return gr(e);var t=[];for(var r in Pe(e))De.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Fn(e){if(!Ja(e))return function(e){var t=[];if(null!=e)for(var r in Pe(e))t.push(r);return t}(e);var t=_s(e),r=[];for(var n in e)("constructor"!=n||!t&&De.call(e,n))&&r.push(n);return r}function Nn(e,t){return e<t}function Bn(e,t){var r=-1,n=Ha(e)?se(e.length):[];return un(e,(function(e,i,s){n[++r]=t(e,i,s)})),n}function Vn(e){var t=hs(e);return 1==t.length&&t[0][2]?xs(t[0][0],t[0][1]):function(r){return r===e||On(r,e,t)}}function Un(e,t){return Ss(e)&&Ts(t)?xs(Ls(e),t):function(n){var i=Po(n,e);return i===r&&i===t?wo(n,e):Rn(t,i,3)}}function zn(e,t,n,i,s){e!==t&&vn(t,(function(a,o){if(s||(s=new Kr),Ja(a))!function(e,t,n,i,s,a,o){var l=Is(e,n),c=Is(t,n),h=o.get(c);if(h)return void Jr(e,n,h);var d=a?a(l,c,n+"",e,t,o):r,u=d===r;if(u){var p=ja(c),f=!p&&Wa(c),m=!p&&!f&&lo(c);d=c,p||f||m?ja(l)?d=l:Za(l)?d=ki(l):f?(u=!1,d=_i(c,!0)):m?(u=!1,d=xi(c,!0)):d=[]:no(c)||za(c)?(d=l,za(l)?d=yo(l):Ja(l)&&!qa(l)||(d=gs(c))):u=!1}u&&(o.set(c,d),s(d,c,i,a,o),o.delete(c));Jr(e,n,d)}(e,t,o,n,zn,i,s);else{var l=i?i(Is(e,o),a,o+"",e,t,s):r;l===r&&(l=a),Jr(e,o,l)}}),Ro)}function jn(e,t){var n=e.length;if(n)return vs(t+=t<0?n:0,n)?e[t]:r}function Gn(e,t,r){t=t.length?Ot(t,(function(e){return ja(e)?function(t){return _n(t,1===e.length?e[0]:e)}:e})):[nl];var n=-1;t=Ot(t,Qt(ls()));var i=Bn(e,(function(e,r,i){var s=Ot(t,(function(t){return t(e)}));return{criteria:s,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,s=t.criteria,a=i.length,o=r.length;for(;++n<a;){var l=Pi(i[n],s[n]);if(l)return n>=o?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Hn(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var a=t[n],o=_n(e,a);r(o,a)&&Jn(s,bi(a,e),o)}return s}function Zn(e,t,r,n){var i=n?zt:Ut,s=-1,a=t.length,o=e;for(e===t&&(t=ki(t)),r&&(o=Ot(e,Qt(r)));++s<a;)for(var l=0,c=t[s],h=r?r(c):c;(l=i(o,h,l,n))>-1;)o!==e&&Ye.call(o,l,1),Ye.call(e,l,1);return e}function Wn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;vs(i)?Ye.call(e,i,1):di(e,i)}}return e}function Kn(e,t){return e+mt(Er()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=mt(t/2))&&(e+=e)}while(t);return r}function qn(e,t){return Ms(Ps(e,t,nl),e+"")}function Qn(e){return qr(Vo(e))}function Xn(e,t){var r=Vo(e);return $s(r,on(t,0,r.length))}function Jn(e,t,n,i){if(!Ja(e))return e;for(var s=-1,a=(t=bi(t,e)).length,o=a-1,l=e;null!=l&&++s<a;){var c=Ls(t[s]),h=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(s!=o){var d=l[c];(h=i?i(d,c,l):r)===r&&(h=Ja(d)?d:vs(t[s+1])?[]:{})}en(l,c,h),l=l[c]}return e}var ei=kr?function(e,t){return kr.set(e,t),e}:nl,ti=rt?function(e,t){return rt(e,"toString",{configurable:!0,enumerable:!1,value:el(t),writable:!0})}:nl;function ri(e){return $s(Vo(e))}function ni(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=se(i);++n<i;)s[n]=e[n+t];return s}function ii(e,t){var r;return un(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function si(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var s=n+i>>>1,a=e[s];null!==a&&!oo(a)&&(r?a<=t:a<t)?n=s+1:i=s}return i}return ai(e,t,nl,r)}function ai(e,t,n,i){var s=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(t=n(t))!=t,l=null===t,c=oo(t),h=t===r;s<a;){var d=mt((s+a)/2),u=n(e[d]),p=u!==r,f=null===u,m=u==u,g=oo(u);if(o)var y=i||m;else y=h?m&&(i||p):l?m&&p&&(i||!f):c?m&&p&&!f&&(i||!g):!f&&!g&&(i?u<=t:u<t);y?s=d+1:a=d}return vr(a,4294967294)}function oi(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var a=e[r],o=t?t(a):a;if(!r||!Ba(o,l)){var l=o;s[i++]=0===a?0:a}}return s}function li(e){return"number"==typeof e?e:oo(e)?p:+e}function ci(e){if("string"==typeof e)return e;if(ja(e))return Ot(e,ci)+"";if(oo(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,r){var n=-1,i=Mt,s=e.length,a=!0,o=[],l=o;if(r)a=!1,i=Rt;else if(s>=200){var c=t?null:Yi(e);if(c)return cr(c);a=!1,i=Jt,l=new Wr}else l=t?[]:o;e:for(;++n<s;){var h=e[n],d=t?t(h):h;if(h=r||0!==h?h:0,a&&d==d){for(var u=l.length;u--;)if(l[u]===d)continue e;t&&l.push(d),o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}function di(e,t){return null==(e=ws(e,t=bi(t,e)))||delete e[Ls(Ys(t))]}function ui(e,t,r,n){return Jn(e,t,r(_n(e,t)),n)}function pi(e,t,r,n){for(var i=e.length,s=n?i:-1;(n?s--:++s<i)&&t(e[s],s,e););return r?ni(e,n?0:s,n?s+1:i):ni(e,n?s+1:0,n?i:s)}function fi(e,t){var r=e;return r instanceof jr&&(r=r.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,$t([e],t.args))}),r)}function mi(e,t,r){var n=e.length;if(n<2)return n?hi(e[0]):[];for(var i=-1,s=se(n);++i<n;)for(var a=e[i],o=-1;++o<n;)o!=i&&(s[i]=dn(s[i]||a,e[o],t,r));return hi(yn(s,1),t,r)}function gi(e,t,n){for(var i=-1,s=e.length,a=t.length,o={};++i<s;){var l=i<a?t[i]:r;n(o,e[i],l)}return o}function yi(e){return Za(e)?e:[]}function vi(e){return"function"==typeof e?e:nl}function bi(e,t){return ja(e)?e:Ss(e,t)?[e]:Ds(vo(e))}var Si=qn;function Ei(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ni(e,t,n)}var Ci=lt||function(e){return pt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=He?He(r):new e.constructor(r);return e.copy(n),n}function Ti(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function xi(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Pi(e,t){if(e!==t){var n=e!==r,i=null===e,s=e==e,a=oo(e),o=t!==r,l=null===t,c=t==t,h=oo(t);if(!l&&!h&&!a&&e>t||a&&o&&c&&!l&&!h||i&&o&&c||!n&&c||!s)return 1;if(!i&&!a&&!h&&e<t||h&&n&&s&&!i&&!a||l&&n&&s||!o&&s||!c)return-1}return 0}function wi(e,t,r,n){for(var i=-1,s=e.length,a=r.length,o=-1,l=t.length,c=yr(s-a,0),h=se(l+c),d=!n;++o<l;)h[o]=t[o];for(;++i<a;)(d||i<s)&&(h[r[i]]=e[i]);for(;c--;)h[o++]=e[i++];return h}function Ii(e,t,r,n){for(var i=-1,s=e.length,a=-1,o=r.length,l=-1,c=t.length,h=yr(s-o,0),d=se(h+c),u=!n;++i<h;)d[i]=e[i];for(var p=i;++l<c;)d[p+l]=t[l];for(;++a<o;)(u||i<s)&&(d[p+r[a]]=e[i++]);return d}function ki(e,t){var r=-1,n=e.length;for(t||(t=se(n));++r<n;)t[r]=e[r];return t}function Ai(e,t,n,i){var s=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var l=t[a],c=i?i(n[l],e[l],l,n,e):r;c===r&&(c=e[l]),s?sn(n,l,c):en(n,l,c)}return n}function Mi(e,t){return function(r,n){var i=ja(r)?Pt:rn,s=t?t():{};return i(r,e,ls(n,2),s)}}function Ri(e){return qn((function(t,n){var i=-1,s=n.length,a=s>1?n[s-1]:r,o=s>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(s--,a):r,o&&bs(n[0],n[1],o)&&(a=s<3?r:a,s=1),t=Pe(t);++i<s;){var l=n[i];l&&e(t,l,i,a)}return t}))}function Oi(e,t){return function(r,n){if(null==r)return r;if(!Ha(r))return e(r,n);for(var i=r.length,s=t?i:-1,a=Pe(r);(t?s--:++s<i)&&!1!==n(a[s],s,a););return r}}function $i(e){return function(t,r,n){for(var i=-1,s=Pe(t),a=n(t),o=a.length;o--;){var l=a[e?o:++i];if(!1===r(s[l],l,s))break}return t}}function Di(e){return function(t){var n=sr(t=vo(t))?ur(t):r,i=n?n[0]:t.charAt(0),s=n?Ei(n,1).join(""):t.slice(1);return i[e]()+s}}function Li(e){return function(t){return Dt(Qo(jo(t).replace(Xe,"")),e,"")}}function Fi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Vr(e.prototype),n=e.apply(r,t);return Ja(n)?n:r}}function Ni(e){return function(t,n,i){var s=Pe(t);if(!Ha(t)){var a=ls(n,3);t=Mo(t),n=function(e){return a(s[e],e,s)}}var o=e(t,n,i);return o>-1?s[a?t[o]:o]:r}}function Bi(e){return rs((function(t){var i=t.length,s=i,a=zr.prototype.thru;for(e&&t.reverse();s--;){var o=t[s];if("function"!=typeof o)throw new ke(n);if(a&&!l&&"wrapper"==as(o))var l=new zr([],!0)}for(s=l?s:i;++s<i;){var c=as(o=t[s]),h="wrapper"==c?ss(o):r;l=h&&Es(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?l[as(h[0])].apply(l,h[3]):1==o.length&&Es(o)?l[c]():l.thru(o)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&ja(r))return l.plant(r).value();for(var n=0,s=i?t[n].apply(this,e):r;++n<i;)s=t[n].call(this,s);return s}}))}function Vi(e,t,n,i,s,a,o,l,h,d){var u=t&c,p=1&t,f=2&t,m=24&t,g=512&t,y=f?r:Fi(e);return function c(){for(var v=arguments.length,b=se(v),S=v;S--;)b[S]=arguments[S];if(m)var E=os(c),C=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,E);if(i&&(b=wi(b,i,s,m)),a&&(b=Ii(b,a,o,m)),v-=C,m&&v<d){var _=lr(b,E);return Wi(e,t,Vi,c.placeholder,n,b,_,l,h,d-v)}var T=p?n:this,x=f?T[e]:e;return v=b.length,l?b=function(e,t){var n=e.length,i=vr(t.length,n),s=ki(e);for(;i--;){var a=t[i];e[i]=vs(a,n)?s[a]:r}return e}(b,l):g&&v>1&&b.reverse(),u&&h<v&&(b.length=h),this&&this!==pt&&this instanceof c&&(x=y||Fi(x)),x.apply(T,b)}}function Ui(e,t){return function(r,n){return function(e,t,r,n){return Sn(e,(function(e,i,s){t(n,r(e),i,s)})),n}(r,e,t(n),{})}}function zi(e,t){return function(n,i){var s;if(n===r&&i===r)return t;if(n!==r&&(s=n),i!==r){if(s===r)return i;"string"==typeof n||"string"==typeof i?(n=ci(n),i=ci(i)):(n=li(n),i=li(i)),s=e(n,i)}return s}}function ji(e){return rs((function(t){return t=Ot(t,Qt(ls())),qn((function(r){var n=this;return e(t,(function(e){return xt(e,n,r)}))}))}))}function Gi(e,t){var n=(t=t===r?" ":ci(t)).length;if(n<2)return n?Yn(t,e):t;var i=Yn(t,ft(e/dr(t)));return sr(t)?Ei(ur(i),0,e).join(""):i.slice(0,e)}function Hi(e){return function(t,n,i){return i&&"number"!=typeof i&&bs(t,n,i)&&(n=i=r),t=po(t),n===r?(n=t,t=0):n=po(n),function(e,t,r,n){for(var i=-1,s=yr(ft((t-e)/(r||1)),0),a=se(s);s--;)a[n?s:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:po(i),e)}}function Zi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=go(t),r=go(r)),e(t,r)}}function Wi(e,t,n,i,s,a,c,h,d,u){var p=8&t;t|=p?o:l,4&(t&=~(p?l:o))||(t&=-4);var f=[e,t,s,p?a:r,p?c:r,p?r:a,p?r:c,h,d,u],m=n.apply(r,f);return Es(e)&&ks(m,f),m.placeholder=i,Rs(m,e,t)}function Ki(e){var t=xe[e];return function(e,r){if(e=go(e),(r=null==r?0:vr(fo(r),292))&&Nt(e)){var n=(vo(e)+"e").split("e");return+((n=(vo(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=Pr&&1/cr(new Pr([,-0]))[1]==d?function(e){return new Pr(e)}:ll;function qi(e){return function(t){var r=fs(t);return r==_?ar(t):r==I?hr(t):function(e,t){return Ot(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Qi(e,t,i,d,u,p,f,m){var g=2&t;if(!g&&"function"!=typeof e)throw new ke(n);var y=d?d.length:0;if(y||(t&=-97,d=u=r),f=f===r?f:yr(fo(f),0),m=m===r?m:fo(m),y-=u?u.length:0,t&l){var v=d,b=u;d=u=r}var S=g?r:ss(e),E=[e,t,i,d,u,v,b,p,f,m];if(S&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,o=n==c&&8==r||n==c&&r==h&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!o)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var l=t[3];if(l){var d=e[3];e[3]=d?wi(d,l,t[4]):l,e[4]=d?lr(e[3],s):t[4]}(l=t[5])&&(d=e[5],e[5]=d?Ii(d,l,t[6]):l,e[6]=d?lr(e[5],s):t[6]);(l=t[7])&&(e[7]=l);n&c&&(e[8]=null==e[8]?t[8]:vr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(E,S),e=E[0],t=E[1],i=E[2],d=E[3],u=E[4],!(m=E[9]=E[9]===r?g?0:e.length:yr(E[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)C=8==t||t==a?function(e,t,n){var i=Fi(e);return function s(){for(var a=arguments.length,o=se(a),l=a,c=os(s);l--;)o[l]=arguments[l];var h=a<3&&o[0]!==c&&o[a-1]!==c?[]:lr(o,c);return(a-=h.length)<n?Wi(e,t,Vi,s.placeholder,r,o,h,r,r,n-a):xt(this&&this!==pt&&this instanceof s?i:e,this,o)}}(e,t,m):t!=o&&33!=t||u.length?Vi.apply(r,E):function(e,t,r,n){var i=1&t,s=Fi(e);return function t(){for(var a=-1,o=arguments.length,l=-1,c=n.length,h=se(c+o),d=this&&this!==pt&&this instanceof t?s:e;++l<c;)h[l]=n[l];for(;o--;)h[l++]=arguments[++a];return xt(d,i?r:this,h)}}(e,t,i,d);else var C=function(e,t,r){var n=1&t,i=Fi(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Rs((S?ei:ks)(C,E),e,t)}function Xi(e,t,n,i){return e===r||Ba(e,Re[n])&&!De.call(i,n)?t:e}function Ji(e,t,n,i,s,a){return Ja(e)&&Ja(t)&&(a.set(t,e),zn(e,t,r,Ji,a),a.delete(t)),e}function es(e){return no(e)?r:e}function ts(e,t,n,i,s,a){var o=1&n,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var u=-1,p=!0,f=2&n?new Wr:r;for(a.set(e,t),a.set(t,e);++u<l;){var m=e[u],g=t[u];if(i)var y=o?i(g,m,u,t,e,a):i(m,g,u,e,t,a);if(y!==r){if(y)continue;p=!1;break}if(f){if(!Ft(t,(function(e,t){if(!Jt(f,t)&&(m===e||s(m,e,n,i,a)))return f.push(t)}))){p=!1;break}}else if(m!==g&&!s(m,g,n,i,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function rs(e){return Ms(Ps(e,r,Gs),e+"")}function ns(e){return Tn(e,Mo,us)}function is(e){return Tn(e,Ro,ps)}var ss=kr?function(e){return kr.get(e)}:ll;function as(e){for(var t=e.name+"",r=Ar[t],n=De.call(Ar,t)?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==e)return i.name}return t}function os(e){return(De.call(Br,"placeholder")?Br:e).placeholder}function ls(){var e=Br.iteratee||il;return e=e===il?Dn:e,arguments.length?e(arguments[0],arguments[1]):e}function cs(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function hs(e){for(var t=Mo(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ts(i)]}return t}function ds(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return $n(n)?n:r}var us=yt?function(e){return null==e?[]:(e=Pe(e),At(yt(e),(function(t){return Ke.call(e,t)})))}:ml,ps=yt?function(e){for(var t=[];e;)$t(t,us(e)),e=Ze(e);return t}:ml,fs=xn;function ms(e,t,r){for(var n=-1,i=(t=bi(t,e)).length,s=!1;++n<i;){var a=Ls(t[n]);if(!(s=null!=e&&r(e,a)))break;e=e[a]}return s||++n!=i?s:!!(i=null==e?0:e.length)&&Xa(i)&&vs(a,i)&&(ja(e)||za(e))}function gs(e){return"function"!=typeof e.constructor||_s(e)?{}:Vr(Ze(e))}function ys(e){return ja(e)||za(e)||!!(qe&&e&&e[qe])}function vs(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&ve.test(e))&&e>-1&&e%1==0&&e<t}function bs(e,t,r){if(!Ja(r))return!1;var n=typeof t;return!!("number"==n?Ha(r)&&vs(t,r.length):"string"==n&&t in r)&&Ba(r[t],e)}function Ss(e,t){if(ja(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!oo(e))||(ee.test(e)||!J.test(e)||null!=t&&e in Pe(t))}function Es(e){var t=as(e),r=Br[t];if("function"!=typeof r||!(t in jr.prototype))return!1;if(e===r)return!0;var n=ss(r);return!!n&&e===n[0]}(_r&&fs(new _r(new ArrayBuffer(1)))!=O||Tr&&fs(new Tr)!=_||xr&&fs(xr.resolve())!=P||Pr&&fs(new Pr)!=I||wr&&fs(new wr)!=M)&&(fs=function(e){var t=xn(e),n=t==x?e.constructor:r,i=n?Fs(n):"";if(i)switch(i){case Mr:return O;case Rr:return _;case Or:return P;case $r:return I;case Dr:return M}return t});var Cs=Oe?qa:gl;function _s(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Re)}function Ts(e){return e==e&&!Ja(e)}function xs(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Pe(n)))}}function Ps(e,t,n){return t=yr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=yr(r.length-t,0),a=se(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=se(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),xt(e,this,o)}}function ws(e,t){return t.length<2?e:_n(e,ni(t,0,-1))}function Is(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ks=Os(ei),As=ut||function(e,t){return pt.setTimeout(e,t)},Ms=Os(ti);function Rs(e,t,r){var n=t+"";return Ms(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return wt(m,(function(r){var n="_."+r[0];t&r[1]&&!Mt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(le):[]}(n),r)))}function Os(e){var t=0,n=0;return function(){var i=br(),s=16-(i-n);if(n=i,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function $s(e,t){var n=-1,i=e.length,s=i-1;for(t=t===r?i:t;++n<t;){var a=Kn(n,s),o=e[a];e[a]=e[n],e[n]=o}return e.length=t,e}var Ds=function(e){var t=Oa(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,(function(e,r,n,i){t.push(n?i.replace(de,"$1"):r||e)})),t}));function Ls(e){if("string"==typeof e||oo(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fs(e){if(null!=e){try{return $e.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ns(e){if(e instanceof jr)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=ki(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Bs=qn((function(e,t){return Za(e)?dn(e,yn(t,1,Za,!0)):[]})),Vs=qn((function(e,t){var n=Ys(t);return Za(n)&&(n=r),Za(e)?dn(e,yn(t,1,Za,!0),ls(n,2)):[]})),Us=qn((function(e,t){var n=Ys(t);return Za(n)&&(n=r),Za(e)?dn(e,yn(t,1,Za,!0),r,n):[]}));function zs(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fo(r);return i<0&&(i=yr(n+i,0)),Vt(e,ls(t,3),i)}function js(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return n!==r&&(s=fo(n),s=n<0?yr(i+s,0):vr(s,i-1)),Vt(e,ls(t,3),s,!0)}function Gs(e){return(null==e?0:e.length)?yn(e,1):[]}function Hs(e){return e&&e.length?e[0]:r}var Zs=qn((function(e){var t=Ot(e,yi);return t.length&&t[0]===e[0]?kn(t):[]})),Ws=qn((function(e){var t=Ys(e),n=Ot(e,yi);return t===Ys(n)?t=r:n.pop(),n.length&&n[0]===e[0]?kn(n,ls(t,2)):[]})),Ks=qn((function(e){var t=Ys(e),n=Ot(e,yi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?kn(n,r,t):[]}));function Ys(e){var t=null==e?0:e.length;return t?e[t-1]:r}var qs=qn(Qs);function Qs(e,t){return e&&e.length&&t&&t.length?Zn(e,t):e}var Xs=rs((function(e,t){var r=null==e?0:e.length,n=an(e,t);return Wn(e,Ot(t,(function(e){return vs(e,r)?+e:e})).sort(Pi)),n}));function Js(e){return null==e?e:Cr.call(e)}var ea=qn((function(e){return hi(yn(e,1,Za,!0))})),ta=qn((function(e){var t=Ys(e);return Za(t)&&(t=r),hi(yn(e,1,Za,!0),ls(t,2))})),ra=qn((function(e){var t=Ys(e);return t="function"==typeof t?t:r,hi(yn(e,1,Za,!0),r,t)}));function na(e){if(!e||!e.length)return[];var t=0;return e=At(e,(function(e){if(Za(e))return t=yr(e.length,t),!0})),Yt(t,(function(t){return Ot(e,Ht(t))}))}function ia(e,t){if(!e||!e.length)return[];var n=na(e);return null==t?n:Ot(n,(function(e){return xt(t,r,e)}))}var sa=qn((function(e,t){return Za(e)?dn(e,t):[]})),aa=qn((function(e){return mi(At(e,Za))})),oa=qn((function(e){var t=Ys(e);return Za(t)&&(t=r),mi(At(e,Za),ls(t,2))})),la=qn((function(e){var t=Ys(e);return t="function"==typeof t?t:r,mi(At(e,Za),r,t)})),ca=qn(na);var ha=qn((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ia(e,n)}));function da(e){var t=Br(e);return t.__chain__=!0,t}function ua(e,t){return t(e)}var pa=rs((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,s=function(t){return an(t,e)};return!(t>1||this.__actions__.length)&&i instanceof jr&&vs(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ua,args:[s],thisArg:r}),new zr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(s)}));var fa=Mi((function(e,t,r){De.call(e,r)?++e[r]:sn(e,r,1)}));var ma=Ni(zs),ga=Ni(js);function ya(e,t){return(ja(e)?wt:un)(e,ls(t,3))}function va(e,t){return(ja(e)?It:pn)(e,ls(t,3))}var ba=Mi((function(e,t,r){De.call(e,r)?e[r].push(t):sn(e,r,[t])}));var Sa=qn((function(e,t,r){var n=-1,i="function"==typeof t,s=Ha(e)?se(e.length):[];return un(e,(function(e){s[++n]=i?xt(t,e,r):An(e,t,r)})),s})),Ea=Mi((function(e,t,r){sn(e,r,t)}));function Ca(e,t){return(ja(e)?Ot:Bn)(e,ls(t,3))}var _a=Mi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ta=qn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&bs(e,t[0],t[1])?t=[]:r>2&&bs(t[0],t[1],t[2])&&(t=[t[0]]),Gn(e,yn(t,1),[])})),xa=dt||function(){return pt.Date.now()};function Pa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Qi(e,c,r,r,r,r,t)}function wa(e,t){var i;if("function"!=typeof t)throw new ke(n);return e=fo(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=qn((function(e,t,r){var n=1;if(r.length){var i=lr(r,os(Ia));n|=o}return Qi(e,n,t,r,i)})),ka=qn((function(e,t,r){var n=3;if(r.length){var i=lr(r,os(ka));n|=o}return Qi(t,n,e,r,i)}));function Aa(e,t,i){var s,a,o,l,c,h,d=0,u=!1,p=!1,f=!0;if("function"!=typeof e)throw new ke(n);function m(t){var n=s,i=a;return s=a=r,d=t,l=e.apply(i,n)}function g(e){var n=e-h;return h===r||n>=t||n<0||p&&e-d>=o}function y(){var e=xa();if(g(e))return v(e);c=As(y,function(e){var r=t-(e-h);return p?vr(r,o-(e-d)):r}(e))}function v(e){return c=r,f&&s?m(e):(s=a=r,l)}function b(){var e=xa(),n=g(e);if(s=arguments,a=this,h=e,n){if(c===r)return function(e){return d=e,c=As(y,t),u?m(e):l}(h);if(p)return Ci(c),c=As(y,t),m(h)}return c===r&&(c=As(y,t)),l}return t=go(t)||0,Ja(i)&&(u=!!i.leading,o=(p="maxWait"in i)?yr(go(i.maxWait)||0,t):o,f="trailing"in i?!!i.trailing:f),b.cancel=function(){c!==r&&Ci(c),d=0,s=h=a=c=r},b.flush=function(){return c===r?l:v(xa())},b}var Ma=qn((function(e,t){return hn(e,1,t)})),Ra=qn((function(e,t,r){return hn(e,go(t)||0,r)}));function Oa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ke(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(Oa.Cache||Zr),r}function $a(e){if("function"!=typeof e)throw new ke(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Oa.Cache=Zr;var Da=Si((function(e,t){var r=(t=1==t.length&&ja(t[0])?Ot(t[0],Qt(ls())):Ot(yn(t,1),Qt(ls()))).length;return qn((function(n){for(var i=-1,s=vr(n.length,r);++i<s;)n[i]=t[i].call(this,n[i]);return xt(e,this,n)}))})),La=qn((function(e,t){var n=lr(t,os(La));return Qi(e,o,r,t,n)})),Fa=qn((function(e,t){var n=lr(t,os(Fa));return Qi(e,l,r,t,n)})),Na=rs((function(e,t){return Qi(e,h,r,r,r,t)}));function Ba(e,t){return e===t||e!=e&&t!=t}var Va=Zi(Pn),Ua=Zi((function(e,t){return e>=t})),za=Mn(function(){return arguments}())?Mn:function(e){return eo(e)&&De.call(e,"callee")&&!Ke.call(e,"callee")},ja=se.isArray,Ga=bt?Qt(bt):function(e){return eo(e)&&xn(e)==R};function Ha(e){return null!=e&&Xa(e.length)&&!qa(e)}function Za(e){return eo(e)&&Ha(e)}var Wa=vt||gl,Ka=St?Qt(St):function(e){return eo(e)&&xn(e)==b};function Ya(e){if(!eo(e))return!1;var t=xn(e);return t==S||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!no(e)}function qa(e){if(!Ja(e))return!1;var t=xn(e);return t==E||t==C||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==fo(e)}function Xa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Ja(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eo(e){return null!=e&&"object"==typeof e}var to=Et?Qt(Et):function(e){return eo(e)&&fs(e)==_};function ro(e){return"number"==typeof e||eo(e)&&xn(e)==T}function no(e){if(!eo(e)||xn(e)!=x)return!1;var t=Ze(e);if(null===t)return!0;var r=De.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&$e.call(r)==Be}var io=Ct?Qt(Ct):function(e){return eo(e)&&xn(e)==w};var so=_t?Qt(_t):function(e){return eo(e)&&fs(e)==I};function ao(e){return"string"==typeof e||!ja(e)&&eo(e)&&xn(e)==k}function oo(e){return"symbol"==typeof e||eo(e)&&xn(e)==A}var lo=Tt?Qt(Tt):function(e){return eo(e)&&Xa(e.length)&&!!at[xn(e)]};var co=Zi(Nn),ho=Zi((function(e,t){return e<=t}));function uo(e){if(!e)return[];if(Ha(e))return ao(e)?ur(e):ki(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=fs(e);return(t==_?ar:t==I?cr:Vo)(e)}function po(e){return e?(e=go(e))===d||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fo(e){var t=po(e),r=t%1;return t==t?r?t-r:t:0}function mo(e){return e?on(fo(e),0,f):0}function go(e){if("number"==typeof e)return e;if(oo(e))return p;if(Ja(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ja(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var r=me.test(e);return r||ye.test(e)?ht(e.slice(2),r?2:8):fe.test(e)?p:+e}function yo(e){return Ai(e,Ro(e))}function vo(e){return null==e?"":ci(e)}var bo=Ri((function(e,t){if(_s(t)||Ha(t))Ai(t,Mo(t),e);else for(var r in t)De.call(t,r)&&en(e,r,t[r])})),So=Ri((function(e,t){Ai(t,Ro(t),e)})),Eo=Ri((function(e,t,r,n){Ai(t,Ro(t),e,n)})),Co=Ri((function(e,t,r,n){Ai(t,Mo(t),e,n)})),_o=rs(an);var To=qn((function(e,t){e=Pe(e);var n=-1,i=t.length,s=i>2?t[2]:r;for(s&&bs(t[0],t[1],s)&&(i=1);++n<i;)for(var a=t[n],o=Ro(a),l=-1,c=o.length;++l<c;){var h=o[l],d=e[h];(d===r||Ba(d,Re[h])&&!De.call(e,h))&&(e[h]=a[h])}return e})),xo=qn((function(e){return e.push(r,Ji),xt($o,r,e)}));function Po(e,t,n){var i=null==e?r:_n(e,t);return i===r?n:i}function wo(e,t){return null!=e&&ms(e,t,In)}var Io=Ui((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=r}),el(nl)),ko=Ui((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),De.call(e,t)?e[t].push(r):e[t]=[r]}),ls),Ao=qn(An);function Mo(e){return Ha(e)?Yr(e):Ln(e)}function Ro(e){return Ha(e)?Yr(e,!0):Fn(e)}var Oo=Ri((function(e,t,r){zn(e,t,r)})),$o=Ri((function(e,t,r,n){zn(e,t,r,n)})),Do=rs((function(e,t){var r={};if(null==e)return r;var n=!1;t=Ot(t,(function(t){return t=bi(t,e),n||(n=t.length>1),t})),Ai(e,is(e),r),n&&(r=ln(r,7,es));for(var i=t.length;i--;)di(r,t[i]);return r}));var Lo=rs((function(e,t){return null==e?{}:function(e,t){return Hn(e,t,(function(t,r){return wo(e,r)}))}(e,t)}));function Fo(e,t){if(null==e)return{};var r=Ot(is(e),(function(e){return[e]}));return t=ls(t),Hn(e,r,(function(e,r){return t(e,r[0])}))}var No=qi(Mo),Bo=qi(Ro);function Vo(e){return null==e?[]:Xt(e,Mo(e))}var Uo=Li((function(e,t,r){return t=t.toLowerCase(),e+(r?zo(t):t)}));function zo(e){return qo(vo(e).toLowerCase())}function jo(e){return(e=vo(e))&&e.replace(be,rr).replace(Je,"")}var Go=Li((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ho=Li((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Zo=Di("toLowerCase");var Wo=Li((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Ko=Li((function(e,t,r){return e+(r?" ":"")+qo(t)}));var Yo=Li((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),qo=Di("toUpperCase");function Qo(e,t,n){return e=vo(e),(t=n?r:t)===r?function(e){return nt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Xo=qn((function(e,t){try{return xt(e,r,t)}catch(e){return Ya(e)?e:new _e(e)}})),Jo=rs((function(e,t){return wt(t,(function(t){t=Ls(t),sn(e,t,Ia(e[t],e))})),e}));function el(e){return function(){return e}}var tl=Bi(),rl=Bi(!0);function nl(e){return e}function il(e){return Dn("function"==typeof e?e:ln(e,1))}var sl=qn((function(e,t){return function(r){return An(r,e,t)}})),al=qn((function(e,t){return function(r){return An(e,r,t)}}));function ol(e,t,r){var n=Mo(t),i=Cn(t,n);null!=r||Ja(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Cn(t,Mo(t)));var s=!(Ja(r)&&"chain"in r&&!r.chain),a=qa(e);return wt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=ki(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,$t([this.value()],arguments))})})),e}function ll(){}var cl=ji(Ot),hl=ji(kt),dl=ji(Ft);function ul(e){return Ss(e)?Ht(Ls(e)):function(e){return function(t){return _n(t,e)}}(e)}var pl=Hi(),fl=Hi(!0);function ml(){return[]}function gl(){return!1}var yl=zi((function(e,t){return e+t}),0),vl=Ki("ceil"),bl=zi((function(e,t){return e/t}),1),Sl=Ki("floor");var El,Cl=zi((function(e,t){return e*t}),1),_l=Ki("round"),Tl=zi((function(e,t){return e-t}),0);return Br.after=function(e,t){if("function"!=typeof t)throw new ke(n);return e=fo(e),function(){if(--e<1)return t.apply(this,arguments)}},Br.ary=Pa,Br.assign=bo,Br.assignIn=So,Br.assignInWith=Eo,Br.assignWith=Co,Br.at=_o,Br.before=wa,Br.bind=Ia,Br.bindAll=Jo,Br.bindKey=ka,Br.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return ja(e)?e:[e]},Br.chain=da,Br.chunk=function(e,t,n){t=(n?bs(e,t,n):t===r)?1:yr(fo(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,a=0,o=se(ft(i/t));s<i;)o[a++]=ni(e,s,s+=t);return o},Br.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var s=e[t];s&&(i[n++]=s)}return i},Br.concat=function(){var e=arguments.length;if(!e)return[];for(var t=se(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return $t(ja(r)?ki(r):[r],yn(t,1))},Br.cond=function(e){var t=null==e?0:e.length,r=ls();return e=t?Ot(e,(function(e){if("function"!=typeof e[1])throw new ke(n);return[r(e[0]),e[1]]})):[],qn((function(r){for(var n=-1;++n<t;){var i=e[n];if(xt(i[0],this,r))return xt(i[1],this,r)}}))},Br.conforms=function(e){return function(e){var t=Mo(e);return function(r){return cn(r,e,t)}}(ln(e,1))},Br.constant=el,Br.countBy=fa,Br.create=function(e,t){var r=Vr(e);return null==t?r:nn(r,t)},Br.curry=function e(t,n,i){var s=Qi(t,8,r,r,r,r,r,n=i?r:n);return s.placeholder=e.placeholder,s},Br.curryRight=function e(t,n,i){var s=Qi(t,a,r,r,r,r,r,n=i?r:n);return s.placeholder=e.placeholder,s},Br.debounce=Aa,Br.defaults=To,Br.defaultsDeep=xo,Br.defer=Ma,Br.delay=Ra,Br.difference=Bs,Br.differenceBy=Vs,Br.differenceWith=Us,Br.drop=function(e,t,n){var i=null==e?0:e.length;return i?ni(e,(t=n||t===r?1:fo(t))<0?0:t,i):[]},Br.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ni(e,0,(t=i-(t=n||t===r?1:fo(t)))<0?0:t):[]},Br.dropRightWhile=function(e,t){return e&&e.length?pi(e,ls(t,3),!0,!0):[]},Br.dropWhile=function(e,t){return e&&e.length?pi(e,ls(t,3),!0):[]},Br.fill=function(e,t,n,i){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&bs(e,t,n)&&(n=0,i=s),function(e,t,n,i){var s=e.length;for((n=fo(n))<0&&(n=-n>s?0:s+n),(i=i===r||i>s?s:fo(i))<0&&(i+=s),i=n>i?0:mo(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Br.filter=function(e,t){return(ja(e)?At:gn)(e,ls(t,3))},Br.flatMap=function(e,t){return yn(Ca(e,t),1)},Br.flatMapDeep=function(e,t){return yn(Ca(e,t),d)},Br.flatMapDepth=function(e,t,n){return n=n===r?1:fo(n),yn(Ca(e,t),n)},Br.flatten=Gs,Br.flattenDeep=function(e){return(null==e?0:e.length)?yn(e,d):[]},Br.flattenDepth=function(e,t){return(null==e?0:e.length)?yn(e,t=t===r?1:fo(t)):[]},Br.flip=function(e){return Qi(e,512)},Br.flow=tl,Br.flowRight=rl,Br.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Br.functions=function(e){return null==e?[]:Cn(e,Mo(e))},Br.functionsIn=function(e){return null==e?[]:Cn(e,Ro(e))},Br.groupBy=ba,Br.initial=function(e){return(null==e?0:e.length)?ni(e,0,-1):[]},Br.intersection=Zs,Br.intersectionBy=Ws,Br.intersectionWith=Ks,Br.invert=Io,Br.invertBy=ko,Br.invokeMap=Sa,Br.iteratee=il,Br.keyBy=Ea,Br.keys=Mo,Br.keysIn=Ro,Br.map=Ca,Br.mapKeys=function(e,t){var r={};return t=ls(t,3),Sn(e,(function(e,n,i){sn(r,t(e,n,i),e)})),r},Br.mapValues=function(e,t){var r={};return t=ls(t,3),Sn(e,(function(e,n,i){sn(r,n,t(e,n,i))})),r},Br.matches=function(e){return Vn(ln(e,1))},Br.matchesProperty=function(e,t){return Un(e,ln(t,1))},Br.memoize=Oa,Br.merge=Oo,Br.mergeWith=$o,Br.method=sl,Br.methodOf=al,Br.mixin=ol,Br.negate=$a,Br.nthArg=function(e){return e=fo(e),qn((function(t){return jn(t,e)}))},Br.omit=Do,Br.omitBy=function(e,t){return Fo(e,$a(ls(t)))},Br.once=function(e){return wa(2,e)},Br.orderBy=function(e,t,n,i){return null==e?[]:(ja(t)||(t=null==t?[]:[t]),ja(n=i?r:n)||(n=null==n?[]:[n]),Gn(e,t,n))},Br.over=cl,Br.overArgs=Da,Br.overEvery=hl,Br.overSome=dl,Br.partial=La,Br.partialRight=Fa,Br.partition=_a,Br.pick=Lo,Br.pickBy=Fo,Br.property=ul,Br.propertyOf=function(e){return function(t){return null==e?r:_n(e,t)}},Br.pull=qs,Br.pullAll=Qs,Br.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Zn(e,t,ls(r,2)):e},Br.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Zn(e,t,r,n):e},Br.pullAt=Xs,Br.range=pl,Br.rangeRight=fl,Br.rearg=Na,Br.reject=function(e,t){return(ja(e)?At:gn)(e,$a(ls(t,3)))},Br.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],s=e.length;for(t=ls(t,3);++n<s;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Wn(e,i),r},Br.rest=function(e,t){if("function"!=typeof e)throw new ke(n);return qn(e,t=t===r?t:fo(t))},Br.reverse=Js,Br.sampleSize=function(e,t,n){return t=(n?bs(e,t,n):t===r)?1:fo(t),(ja(e)?Qr:Xn)(e,t)},Br.set=function(e,t,r){return null==e?e:Jn(e,t,r)},Br.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Jn(e,t,n,i)},Br.shuffle=function(e){return(ja(e)?Xr:ri)(e)},Br.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bs(e,t,n)?(t=0,n=i):(t=null==t?0:fo(t),n=n===r?i:fo(n)),ni(e,t,n)):[]},Br.sortBy=Ta,Br.sortedUniq=function(e){return e&&e.length?oi(e):[]},Br.sortedUniqBy=function(e,t){return e&&e.length?oi(e,ls(t,2)):[]},Br.split=function(e,t,n){return n&&"number"!=typeof n&&bs(e,t,n)&&(t=n=r),(n=n===r?f:n>>>0)?(e=vo(e))&&("string"==typeof t||null!=t&&!io(t))&&!(t=ci(t))&&sr(e)?Ei(ur(e),0,n):e.split(t,n):[]},Br.spread=function(e,t){if("function"!=typeof e)throw new ke(n);return t=null==t?0:yr(fo(t),0),qn((function(r){var n=r[t],i=Ei(r,0,t);return n&&$t(i,n),xt(e,this,i)}))},Br.tail=function(e){var t=null==e?0:e.length;return t?ni(e,1,t):[]},Br.take=function(e,t,n){return e&&e.length?ni(e,0,(t=n||t===r?1:fo(t))<0?0:t):[]},Br.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ni(e,(t=i-(t=n||t===r?1:fo(t)))<0?0:t,i):[]},Br.takeRightWhile=function(e,t){return e&&e.length?pi(e,ls(t,3),!1,!0):[]},Br.takeWhile=function(e,t){return e&&e.length?pi(e,ls(t,3)):[]},Br.tap=function(e,t){return t(e),e},Br.throttle=function(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new ke(n);return Ja(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),Aa(e,t,{leading:i,maxWait:t,trailing:s})},Br.thru=ua,Br.toArray=uo,Br.toPairs=No,Br.toPairsIn=Bo,Br.toPath=function(e){return ja(e)?Ot(e,Ls):oo(e)?[e]:ki(Ds(vo(e)))},Br.toPlainObject=yo,Br.transform=function(e,t,r){var n=ja(e),i=n||Wa(e)||lo(e);if(t=ls(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:Ja(e)&&qa(s)?Vr(Ze(e)):{}}return(i?wt:Sn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Br.unary=function(e){return Pa(e,1)},Br.union=ea,Br.unionBy=ta,Br.unionWith=ra,Br.uniq=function(e){return e&&e.length?hi(e):[]},Br.uniqBy=function(e,t){return e&&e.length?hi(e,ls(t,2)):[]},Br.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?hi(e,r,t):[]},Br.unset=function(e,t){return null==e||di(e,t)},Br.unzip=na,Br.unzipWith=ia,Br.update=function(e,t,r){return null==e?e:ui(e,t,vi(r))},Br.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ui(e,t,vi(n),i)},Br.values=Vo,Br.valuesIn=function(e){return null==e?[]:Xt(e,Ro(e))},Br.without=sa,Br.words=Qo,Br.wrap=function(e,t){return La(vi(t),e)},Br.xor=aa,Br.xorBy=oa,Br.xorWith=la,Br.zip=ca,Br.zipObject=function(e,t){return gi(e||[],t||[],en)},Br.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jn)},Br.zipWith=ha,Br.entries=No,Br.entriesIn=Bo,Br.extend=So,Br.extendWith=Eo,ol(Br,Br),Br.add=yl,Br.attempt=Xo,Br.camelCase=Uo,Br.capitalize=zo,Br.ceil=vl,Br.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=go(n))==n?n:0),t!==r&&(t=(t=go(t))==t?t:0),on(go(e),t,n)},Br.clone=function(e){return ln(e,4)},Br.cloneDeep=function(e){return ln(e,5)},Br.cloneDeepWith=function(e,t){return ln(e,5,t="function"==typeof t?t:r)},Br.cloneWith=function(e,t){return ln(e,4,t="function"==typeof t?t:r)},Br.conformsTo=function(e,t){return null==t||cn(e,t,Mo(t))},Br.deburr=jo,Br.defaultTo=function(e,t){return null==e||e!=e?t:e},Br.divide=bl,Br.endsWith=function(e,t,n){e=vo(e),t=ci(t);var i=e.length,s=n=n===r?i:on(fo(n),0,i);return(n-=t.length)>=0&&e.slice(n,s)==t},Br.eq=Ba,Br.escape=function(e){return(e=vo(e))&&Y.test(e)?e.replace(W,nr):e},Br.escapeRegExp=function(e){return(e=vo(e))&&ne.test(e)?e.replace(re,"\\$&"):e},Br.every=function(e,t,n){var i=ja(e)?kt:fn;return n&&bs(e,t,n)&&(t=r),i(e,ls(t,3))},Br.find=ma,Br.findIndex=zs,Br.findKey=function(e,t){return Bt(e,ls(t,3),Sn)},Br.findLast=ga,Br.findLastIndex=js,Br.findLastKey=function(e,t){return Bt(e,ls(t,3),En)},Br.floor=Sl,Br.forEach=ya,Br.forEachRight=va,Br.forIn=function(e,t){return null==e?e:vn(e,ls(t,3),Ro)},Br.forInRight=function(e,t){return null==e?e:bn(e,ls(t,3),Ro)},Br.forOwn=function(e,t){return e&&Sn(e,ls(t,3))},Br.forOwnRight=function(e,t){return e&&En(e,ls(t,3))},Br.get=Po,Br.gt=Va,Br.gte=Ua,Br.has=function(e,t){return null!=e&&ms(e,t,wn)},Br.hasIn=wo,Br.head=Hs,Br.identity=nl,Br.includes=function(e,t,r,n){e=Ha(e)?e:Vo(e),r=r&&!n?fo(r):0;var i=e.length;return r<0&&(r=yr(i+r,0)),ao(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Br.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fo(r);return i<0&&(i=yr(n+i,0)),Ut(e,t,i)},Br.inRange=function(e,t,n){return t=po(t),n===r?(n=t,t=0):n=po(n),function(e,t,r){return e>=vr(t,r)&&e<yr(t,r)}(e=go(e),t,n)},Br.invoke=Ao,Br.isArguments=za,Br.isArray=ja,Br.isArrayBuffer=Ga,Br.isArrayLike=Ha,Br.isArrayLikeObject=Za,Br.isBoolean=function(e){return!0===e||!1===e||eo(e)&&xn(e)==v},Br.isBuffer=Wa,Br.isDate=Ka,Br.isElement=function(e){return eo(e)&&1===e.nodeType&&!no(e)},Br.isEmpty=function(e){if(null==e)return!0;if(Ha(e)&&(ja(e)||"string"==typeof e||"function"==typeof e.splice||Wa(e)||lo(e)||za(e)))return!e.length;var t=fs(e);if(t==_||t==I)return!e.size;if(_s(e))return!Ln(e).length;for(var r in e)if(De.call(e,r))return!1;return!0},Br.isEqual=function(e,t){return Rn(e,t)},Br.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Rn(e,t,r,n):!!i},Br.isError=Ya,Br.isFinite=function(e){return"number"==typeof e&&Nt(e)},Br.isFunction=qa,Br.isInteger=Qa,Br.isLength=Xa,Br.isMap=to,Br.isMatch=function(e,t){return e===t||On(e,t,hs(t))},Br.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,On(e,t,hs(t),n)},Br.isNaN=function(e){return ro(e)&&e!=+e},Br.isNative=function(e){if(Cs(e))throw new _e("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return $n(e)},Br.isNil=function(e){return null==e},Br.isNull=function(e){return null===e},Br.isNumber=ro,Br.isObject=Ja,Br.isObjectLike=eo,Br.isPlainObject=no,Br.isRegExp=io,Br.isSafeInteger=function(e){return Qa(e)&&e>=-9007199254740991&&e<=u},Br.isSet=so,Br.isString=ao,Br.isSymbol=oo,Br.isTypedArray=lo,Br.isUndefined=function(e){return e===r},Br.isWeakMap=function(e){return eo(e)&&fs(e)==M},Br.isWeakSet=function(e){return eo(e)&&"[object WeakSet]"==xn(e)},Br.join=function(e,t){return null==e?"":Zt.call(e,t)},Br.kebabCase=Go,Br.last=Ys,Br.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=fo(n))<0?yr(i+s,0):vr(s,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,s):Vt(e,jt,s,!0)},Br.lowerCase=Ho,Br.lowerFirst=Zo,Br.lt=co,Br.lte=ho,Br.max=function(e){return e&&e.length?mn(e,nl,Pn):r},Br.maxBy=function(e,t){return e&&e.length?mn(e,ls(t,2),Pn):r},Br.mean=function(e){return Gt(e,nl)},Br.meanBy=function(e,t){return Gt(e,ls(t,2))},Br.min=function(e){return e&&e.length?mn(e,nl,Nn):r},Br.minBy=function(e,t){return e&&e.length?mn(e,ls(t,2),Nn):r},Br.stubArray=ml,Br.stubFalse=gl,Br.stubObject=function(){return{}},Br.stubString=function(){return""},Br.stubTrue=function(){return!0},Br.multiply=Cl,Br.nth=function(e,t){return e&&e.length?jn(e,fo(t)):r},Br.noConflict=function(){return pt._===this&&(pt._=Ve),this},Br.noop=ll,Br.now=xa,Br.pad=function(e,t,r){e=vo(e);var n=(t=fo(t))?dr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Gi(mt(i),r)+e+Gi(ft(i),r)},Br.padEnd=function(e,t,r){e=vo(e);var n=(t=fo(t))?dr(e):0;return t&&n<t?e+Gi(t-n,r):e},Br.padStart=function(e,t,r){e=vo(e);var n=(t=fo(t))?dr(e):0;return t&&n<t?Gi(t-n,r)+e:e},Br.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),Sr(vo(e).replace(ie,""),t||0)},Br.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bs(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=po(e),t===r?(t=e,e=0):t=po(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var s=Er();return vr(e+s*(t-e+ct("1e-"+((s+"").length-1))),t)}return Kn(e,t)},Br.reduce=function(e,t,r){var n=ja(e)?Dt:Wt,i=arguments.length<3;return n(e,ls(t,4),r,i,un)},Br.reduceRight=function(e,t,r){var n=ja(e)?Lt:Wt,i=arguments.length<3;return n(e,ls(t,4),r,i,pn)},Br.repeat=function(e,t,n){return t=(n?bs(e,t,n):t===r)?1:fo(t),Yn(vo(e),t)},Br.replace=function(){var e=arguments,t=vo(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Br.result=function(e,t,n){var i=-1,s=(t=bi(t,e)).length;for(s||(s=1,e=r);++i<s;){var a=null==e?r:e[Ls(t[i])];a===r&&(i=s,a=n),e=qa(a)?a.call(e):a}return e},Br.round=_l,Br.runInContext=e,Br.sample=function(e){return(ja(e)?qr:Qn)(e)},Br.size=function(e){if(null==e)return 0;if(Ha(e))return ao(e)?dr(e):e.length;var t=fs(e);return t==_||t==I?e.size:Ln(e).length},Br.snakeCase=Wo,Br.some=function(e,t,n){var i=ja(e)?Ft:ii;return n&&bs(e,t,n)&&(t=r),i(e,ls(t,3))},Br.sortedIndex=function(e,t){return si(e,t)},Br.sortedIndexBy=function(e,t,r){return ai(e,t,ls(r,2))},Br.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=si(e,t);if(n<r&&Ba(e[n],t))return n}return-1},Br.sortedLastIndex=function(e,t){return si(e,t,!0)},Br.sortedLastIndexBy=function(e,t,r){return ai(e,t,ls(r,2),!0)},Br.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=si(e,t,!0)-1;if(Ba(e[r],t))return r}return-1},Br.startCase=Ko,Br.startsWith=function(e,t,r){return e=vo(e),r=null==r?0:on(fo(r),0,e.length),t=ci(t),e.slice(r,r+t.length)==t},Br.subtract=Tl,Br.sum=function(e){return e&&e.length?Kt(e,nl):0},Br.sumBy=function(e,t){return e&&e.length?Kt(e,ls(t,2)):0},Br.template=function(e,t,n){var i=Br.templateSettings;n&&bs(e,t,n)&&(t=r),e=vo(e),t=Eo({},t,i,Xi);var s,a,o=Eo({},t.imports,i.imports,Xi),l=Mo(o),c=Xt(o,l),h=0,d=t.interpolate||Se,u="__p += '",p=we((t.escape||Se).source+"|"+d.source+"|"+(d===X?ue:Se).source+"|"+(t.evaluate||Se).source+"|$","g"),f="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++st+"]")+"\n";e.replace(p,(function(t,r,n,i,o,l){return n||(n=i),u+=e.slice(h,l).replace(Ee,ir),r&&(s=!0,u+="' +\n__e("+r+") +\n'"),o&&(a=!0,u+="';\n"+o+";\n__p += '"),n&&(u+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=l+t.length,t})),u+="';\n";var m=De.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new _e("Invalid `variable` option passed into `_.template`")}else u="with (obj) {\n"+u+"\n}\n";u=(a?u.replace(j,""):u).replace(G,"$1").replace(H,"$1;"),u="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}";var g=Xo((function(){return Te(l,f+"return "+u).apply(r,c)}));if(g.source=u,Ya(g))throw g;return g},Br.times=function(e,t){if((e=fo(e))<1||e>u)return[];var r=f,n=vr(e,f);t=ls(t),e-=f;for(var i=Yt(n,t);++r<e;)t(r);return i},Br.toFinite=po,Br.toInteger=fo,Br.toLength=mo,Br.toLower=function(e){return vo(e).toLowerCase()},Br.toNumber=go,Br.toSafeInteger=function(e){return e?on(fo(e),-9007199254740991,u):0===e?e:0},Br.toString=vo,Br.toUpper=function(e){return vo(e).toUpperCase()},Br.trim=function(e,t,n){if((e=vo(e))&&(n||t===r))return qt(e);if(!e||!(t=ci(t)))return e;var i=ur(e),s=ur(t);return Ei(i,er(i,s),tr(i,s)+1).join("")},Br.trimEnd=function(e,t,n){if((e=vo(e))&&(n||t===r))return e.slice(0,pr(e)+1);if(!e||!(t=ci(t)))return e;var i=ur(e);return Ei(i,0,tr(i,ur(t))+1).join("")},Br.trimStart=function(e,t,n){if((e=vo(e))&&(n||t===r))return e.replace(ie,"");if(!e||!(t=ci(t)))return e;var i=ur(e);return Ei(i,er(i,ur(t))).join("")},Br.truncate=function(e,t){var n=30,i="...";if(Ja(t)){var s="separator"in t?t.separator:s;n="length"in t?fo(t.length):n,i="omission"in t?ci(t.omission):i}var a=(e=vo(e)).length;if(sr(e)){var o=ur(e);a=o.length}if(n>=a)return e;var l=n-dr(i);if(l<1)return i;var c=o?Ei(o,0,l).join(""):e.slice(0,l);if(s===r)return c+i;if(o&&(l+=c.length-l),io(s)){if(e.slice(l).search(s)){var h,d=c;for(s.global||(s=we(s.source,vo(pe.exec(s))+"g")),s.lastIndex=0;h=s.exec(d);)var u=h.index;c=c.slice(0,u===r?l:u)}}else if(e.indexOf(ci(s),l)!=l){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Br.unescape=function(e){return(e=vo(e))&&K.test(e)?e.replace(Z,fr):e},Br.uniqueId=function(e){var t=++Le;return vo(e)+t},Br.upperCase=Yo,Br.upperFirst=qo,Br.each=ya,Br.eachRight=va,Br.first=Hs,ol(Br,(El={},Sn(Br,(function(e,t){De.call(Br.prototype,t)||(El[t]=e)})),El),{chain:!1}),Br.VERSION="4.17.21",wt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Br[e].placeholder=Br})),wt(["drop","take"],(function(e,t){jr.prototype[e]=function(n){n=n===r?1:yr(fo(n),0);var i=this.__filtered__&&!t?new jr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,f),type:e+(i.__dir__<0?"Right":"")}),i},jr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),wt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;jr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ls(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),wt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");jr.prototype[e]=function(){return this[r](1).value()[0]}})),wt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");jr.prototype[e]=function(){return this.__filtered__?new jr(this):this[r](1)}})),jr.prototype.compact=function(){return this.filter(nl)},jr.prototype.find=function(e){return this.filter(e).head()},jr.prototype.findLast=function(e){return this.reverse().find(e)},jr.prototype.invokeMap=qn((function(e,t){return"function"==typeof e?new jr(this):this.map((function(r){return An(r,e,t)}))})),jr.prototype.reject=function(e){return this.filter($a(ls(e)))},jr.prototype.slice=function(e,t){e=fo(e);var n=this;return n.__filtered__&&(e>0||t<0)?new jr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fo(t))<0?n.dropRight(-t):n.take(t-e)),n)},jr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},jr.prototype.toArray=function(){return this.take(f)},Sn(jr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=Br[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);s&&(Br.prototype[t]=function(){var t=this.__wrapped__,o=i?[1]:arguments,l=t instanceof jr,c=o[0],h=l||ja(t),d=function(e){var t=s.apply(Br,$t([e],o));return i&&u?t[0]:t};h&&n&&"function"==typeof c&&1!=c.length&&(l=h=!1);var u=this.__chain__,p=!!this.__actions__.length,f=a&&!u,m=l&&!p;if(!a&&h){t=m?t:new jr(this);var g=e.apply(t,o);return g.__actions__.push({func:ua,args:[d],thisArg:r}),new zr(g,u)}return f&&m?e.apply(this,o):(g=this.thru(d),f?i?g.value()[0]:g.value():g)})})),wt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Br.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(ja(i)?i:[],e)}return this[r]((function(r){return t.apply(ja(r)?r:[],e)}))}})),Sn(jr.prototype,(function(e,t){var r=Br[t];if(r){var n=r.name+"";De.call(Ar,n)||(Ar[n]=[]),Ar[n].push({name:t,func:r})}})),Ar[Vi(r,2).name]=[{name:"wrapper",func:r}],jr.prototype.clone=function(){var e=new jr(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},jr.prototype.reverse=function(){if(this.__filtered__){var e=new jr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},jr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=ja(e),n=t<0,i=r?e.length:0,s=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var s=r[n],a=s.size;switch(s.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=vr(t,e+a);break;case"takeRight":e=yr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=s.start,o=s.end,l=o-a,c=n?o:a-1,h=this.__iteratees__,d=h.length,u=0,p=vr(l,this.__takeCount__);if(!r||!n&&i==l&&p==l)return fi(e,this.__actions__);var f=[];e:for(;l--&&u<p;){for(var m=-1,g=e[c+=t];++m<d;){var y=h[m],v=y.iteratee,b=y.type,S=v(g);if(2==b)g=S;else if(!S){if(1==b)continue e;break e}}f[u++]=g}return f},Br.prototype.at=pa,Br.prototype.chain=function(){return da(this)},Br.prototype.commit=function(){return new zr(this.value(),this.__chain__)},Br.prototype.next=function(){this.__values__===r&&(this.__values__=uo(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Br.prototype.plant=function(e){for(var t,n=this;n instanceof Ur;){var i=Ns(n);i.__index__=0,i.__values__=r,t?s.__wrapped__=i:t=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,t},Br.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof jr){var t=e;return this.__actions__.length&&(t=new jr(this)),(t=t.reverse()).__actions__.push({func:ua,args:[Js],thisArg:r}),new zr(t,this.__chain__)}return this.thru(Js)},Br.prototype.toJSON=Br.prototype.valueOf=Br.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Br.prototype.first=Br.prototype.head,Qe&&(Br.prototype[Qe]=function(){return this}),Br}();mt?((mt.exports=mr)._=mr,ft._=mr):pt._=mr}).call(commonjsGlobal)}(lodash,lodash.exports);class LoveLetters{constructor(){this.loveLettersRoot=null}addLetter(e,t){var r;const n=document.querySelector("#letters-wrapper"),i=document.createElement("p");i.textContent=e,null===(r=null==i?void 0:i.classList)||void 0===r||r.add("letter-animation","letter-animation-enter"),n&&(n.appendChild(i),this.updateOpacity(t)),setTimeout((()=>{var e;null===(e=null==i?void 0:i.classList)||void 0===e||e.remove("letter-animation-enter"),null==i||i.addEventListener("transitioned",(()=>{this.updateOpacity(t)}))}),1e3)}updateOpacity(e){const t=document.querySelectorAll("#letters-block p"),r=1.2/t.length;t.forEach(((n,i)=>{var s;const a=n,o=.6-(t.length-1-i)*r*.6;e!==i+1?(a.style.opacity=Math.max(0,o).toString(),null===(s=null==a?void 0:a.classList)||void 0===s||s.add("letter-animation-exit")):a.style.opacity="1"}))}}var lottie$1={exports:{}};(function(module,exports){var factory;"undefined"!=typeof navigator&&(factory=function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var r,n,i=e.length;for(r=0;r<i;r+=1)for(var s in n=e[r].prototype)Object.prototype.hasOwnProperty.call(n,s)&&(t.prototype[s]=n[s])}function getDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)}function createProxyFunction(e){function t(){}return t.prototype=e,t}var audioControllerFactory=function(){function e(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return e.prototype={addAudio:function(e){this.audios.push(e)},pause:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].pause()},resume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].resume()},setRate:function(e){var t,r=this.audios.length;for(t=0;t<r;t+=1)this.audios[t].setRate(e)},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e},setVolume:function(e){this._volume=e,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1))}},function(){return new e}}(),createTypedArray=function(){function e(e,t){var r,n=0,i=[];switch(e){case"int16":case"uint8c":r=1;break;default:r=1.1}for(n=0;n<t;n+=1)i.push(r);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,r){return"float32"===t?new Float32Array(r):"int16"===t?new Int16Array(r):"uint8c"===t?new Uint8ClampedArray(r):e(t,r)}:e}();function createSizedArray(e){return Array.apply(null,{length:e})}function _typeof$6(e){return _typeof$6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(e)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};!function(){var e,t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],r=t.length;for(e=0;e<r;e+=1)BMMath[t[e]]=Math[t[e]]}(),BMMath.random=Math.random,BMMath.abs=function(e){if("object"===_typeof$6(e)&&e.length){var t,r=createSizedArray(e.length),n=e.length;for(t=0;t<n;t+=1)r[t]=Math.abs(e[t]);return r}return Math.abs(e)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(e){e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.display="block",e.style.transformOrigin="0 0",e.style.webkitTransformOrigin="0 0",e.style.backfaceVisibility="visible",e.style.webkitBackfaceVisibility="visible",e.style.transformStyle="preserve-3d",e.style.webkitTransformStyle="preserve-3d",e.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(e,t,r,n){this.type=e,this.currentTime=t,this.totalTime=r,this.direction=n<0?-1:1}function BMCompleteEvent(e,t){this.type=e,this.direction=t<0?-1:1}function BMCompleteLoopEvent(e,t,r,n){this.type=e,this.currentLoop=r,this.totalLoops=t,this.direction=n<0?-1:1}function BMSegmentStartEvent(e,t,r){this.type=e,this.firstFrame=t,this.totalFrames=r}function BMDestroyEvent(e,t){this.type=e,this.target=t}function BMRenderFrameErrorEvent(e,t){this.type="renderFrameError",this.nativeError=e,this.currentTime=t}function BMConfigErrorEvent(e){this.type="configError",this.nativeError=e}var createElementID=(_count=0,function(){return idPrefix$1+"__lottie_element_"+(_count+=1)}),_count;function HSVtoRGB(e,t,r){var n,i,s,a,o,l,c,h;switch(l=r*(1-t),c=r*(1-(o=6*e-(a=Math.floor(6*e)))*t),h=r*(1-(1-o)*t),a%6){case 0:n=r,i=h,s=l;break;case 1:n=c,i=r,s=l;break;case 2:n=l,i=r,s=h;break;case 3:n=l,i=c,s=r;break;case 4:n=h,i=l,s=r;break;case 5:n=r,i=l,s=c}return[n,i,s]}function RGBtoHSV(e,t,r){var n,i=Math.max(e,t,r),s=Math.min(e,t,r),a=i-s,o=0===i?0:a/i,l=i/255;switch(i){case s:n=0;break;case e:n=t-r+a*(t<r?6:0),n/=6*a;break;case t:n=r-e+2*a,n/=6*a;break;case r:n=e-t+4*a,n/=6*a}return[n,o,l]}function addSaturationToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[1]+=t,r[1]>1?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[2]+=t,r[2]>1?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[0]+=t/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var e,t,r=[];for(e=0;e<256;e+=1)t=e.toString(16),r[e]=1===t.length?"0"+t:t;return function(e,t,n){return e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),"#"+r[e]+r[t]+r[n]}}(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(e){return document.createElementNS(svgNS,e)}function _typeof$5(e){return _typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(e)}var dataManager=function(){var e,t,r=1,n=[],i={onmessage:function(){},postMessage:function(t){e({data:t})}},s={postMessage:function(e){i.onmessage({data:e})}};function a(){t||(t=function(t){if(window.Worker&&window.Blob&&getWebWorker()){var r=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),n=URL.createObjectURL(r);return new Worker(n)}return e=t,i}((function(e){if(s.dataManager||(s.dataManager=function(){function e(i,s){var a,o,l,c,h,u,p=i.length;for(o=0;o<p;o+=1)if("ks"in(a=i[o])&&!a.completed){if(a.completed=!0,a.hasMask){var f=a.masksProperties;for(c=f.length,l=0;l<c;l+=1)if(f[l].pt.k.i)n(f[l].pt.k);else for(u=f[l].pt.k.length,h=0;h<u;h+=1)f[l].pt.k[h].s&&n(f[l].pt.k[h].s[0]),f[l].pt.k[h].e&&n(f[l].pt.k[h].e[0])}0===a.ty?(a.layers=t(a.refId,s),e(a.layers,s)):4===a.ty?r(a.shapes):5===a.ty&&d(a)}}function t(e,t){var r=function(e,t){for(var r=0,n=t.length;r<n;){if(t[r].id===e)return t[r];r+=1}return null}(e,t);return r?r.layers.__used?JSON.parse(JSON.stringify(r.layers)):(r.layers.__used=!0,r.layers):null}function r(e){var t,i,s;for(t=e.length-1;t>=0;t-=1)if("sh"===e[t].ty)if(e[t].ks.k.i)n(e[t].ks.k);else for(s=e[t].ks.k.length,i=0;i<s;i+=1)e[t].ks.k[i].s&&n(e[t].ks.k[i].s[0]),e[t].ks.k[i].e&&n(e[t].ks.k[i].e[0]);else"gr"===e[t].ty&&r(e[t].it)}function n(e){var t,r=e.i.length;for(t=0;t<r;t+=1)e.i[t][0]+=e.v[t][0],e.i[t][1]+=e.v[t][1],e.o[t][0]+=e.v[t][0],e.o[t][1]+=e.v[t][1]}function i(e,t){var r=t?t.split("."):[100,100,100];return e[0]>r[0]||!(r[0]>e[0])&&(e[1]>r[1]||!(r[1]>e[1])&&(e[2]>r[2]||!(r[2]>e[2])&&null))}var s,a=function(){var e=[4,4,14];function t(e){var t,r,n,i=e.length;for(t=0;t<i;t+=1)5===e[t].ty&&(n=void 0,n=(r=e[t]).t.d,r.t.d={k:[{s:n,t:0}]})}return function(r){if(i(e,r.v)&&(t(r.layers),r.assets)){var n,s=r.assets.length;for(n=0;n<s;n+=1)r.assets[n].layers&&t(r.assets[n].layers)}}}(),o=(s=[4,7,99],function(e){if(e.chars&&!i(s,e.v)){var t,n=e.chars.length;for(t=0;t<n;t+=1){var a=e.chars[t];a.data&&a.data.shapes&&(r(a.data.shapes),a.data.ip=0,a.data.op=99999,a.data.st=0,a.data.sr=1,a.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},e.chars[t].t||(a.data.shapes.push({ty:"no"}),a.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),l=function(){var e=[5,7,15];function t(e){var t,r,n=e.length;for(t=0;t<n;t+=1)5===e[t].ty&&(r=void 0,"number"==typeof(r=e[t].t.p).a&&(r.a={a:0,k:r.a}),"number"==typeof r.p&&(r.p={a:0,k:r.p}),"number"==typeof r.r&&(r.r={a:0,k:r.r}))}return function(r){if(i(e,r.v)&&(t(r.layers),r.assets)){var n,s=r.assets.length;for(n=0;n<s;n+=1)r.assets[n].layers&&t(r.assets[n].layers)}}}(),c=function(){var e=[4,1,9];function t(e){var r,n,i,s=e.length;for(r=0;r<s;r+=1)if("gr"===e[r].ty)t(e[r].it);else if("fl"===e[r].ty||"st"===e[r].ty)if(e[r].c.k&&e[r].c.k[0].i)for(i=e[r].c.k.length,n=0;n<i;n+=1)e[r].c.k[n].s&&(e[r].c.k[n].s[0]/=255,e[r].c.k[n].s[1]/=255,e[r].c.k[n].s[2]/=255,e[r].c.k[n].s[3]/=255),e[r].c.k[n].e&&(e[r].c.k[n].e[0]/=255,e[r].c.k[n].e[1]/=255,e[r].c.k[n].e[2]/=255,e[r].c.k[n].e[3]/=255);else e[r].c.k[0]/=255,e[r].c.k[1]/=255,e[r].c.k[2]/=255,e[r].c.k[3]/=255}function r(e){var r,n=e.length;for(r=0;r<n;r+=1)4===e[r].ty&&t(e[r].shapes)}return function(t){if(i(e,t.v)&&(r(t.layers),t.assets)){var n,s=t.assets.length;for(n=0;n<s;n+=1)t.assets[n].layers&&r(t.assets[n].layers)}}}(),h=function(){var e=[4,4,18];function t(e){var r,n,i;for(r=e.length-1;r>=0;r-=1)if("sh"===e[r].ty)if(e[r].ks.k.i)e[r].ks.k.c=e[r].closed;else for(i=e[r].ks.k.length,n=0;n<i;n+=1)e[r].ks.k[n].s&&(e[r].ks.k[n].s[0].c=e[r].closed),e[r].ks.k[n].e&&(e[r].ks.k[n].e[0].c=e[r].closed);else"gr"===e[r].ty&&t(e[r].it)}function r(e){var r,n,i,s,a,o,l=e.length;for(n=0;n<l;n+=1){if((r=e[n]).hasMask){var c=r.masksProperties;for(s=c.length,i=0;i<s;i+=1)if(c[i].pt.k.i)c[i].pt.k.c=c[i].cl;else for(o=c[i].pt.k.length,a=0;a<o;a+=1)c[i].pt.k[a].s&&(c[i].pt.k[a].s[0].c=c[i].cl),c[i].pt.k[a].e&&(c[i].pt.k[a].e[0].c=c[i].cl)}4===r.ty&&t(r.shapes)}}return function(t){if(i(e,t.v)&&(r(t.layers),t.assets)){var n,s=t.assets.length;for(n=0;n<s;n+=1)t.assets[n].layers&&r(t.assets[n].layers)}}}();function d(e){0===e.t.a.length&&e.t.p}var u={completeData:function(r){r.__complete||(c(r),a(r),o(r),l(r),h(r),e(r.layers,r.assets),function(r,n){if(r){var i=0,s=r.length;for(i=0;i<s;i+=1)1===r[i].t&&(r[i].data.layers=t(r[i].data.refId,n),e(r[i].data.layers,n))}}(r.chars,r.assets),r.__complete=!0)}};return u.checkColors=c,u.checkChars=o,u.checkPathProperties=l,u.checkShapes=h,u.completeLayers=e,u}()),s.assetLoader||(s.assetLoader=function(){function e(e){var t=e.getResponseHeader("content-type");return t&&"json"===e.responseType&&-1!==t.indexOf("json")||e.response&&"object"===_typeof$5(e.response)?e.response:e.response&&"string"==typeof e.response?JSON.parse(e.response):e.responseText?JSON.parse(e.responseText):null}return{load:function(t,r,n,i){var s,a=new XMLHttpRequest;try{a.responseType="json"}catch(e){}a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)s=e(a),n(s);else try{s=e(a),n(s)}catch(e){i&&i(e)}};try{a.open(["G","E","T"].join(""),t,!0)}catch(e){a.open(["G","E","T"].join(""),r+"/"+t,!0)}a.send()}}}()),"loadAnimation"===e.data.type)s.assetLoader.load(e.data.path,e.data.fullPath,(function(t){s.dataManager.completeData(t),s.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){s.postMessage({id:e.data.id,status:"error"})}));else if("complete"===e.data.type){var t=e.data.animation;s.dataManager.completeData(t),s.postMessage({id:e.data.id,payload:t,status:"success"})}else"loadData"===e.data.type&&s.assetLoader.load(e.data.path,e.data.fullPath,(function(t){s.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){s.postMessage({id:e.data.id,status:"error"})}))})),t.onmessage=function(e){var t=e.data,r=t.id,i=n[r];n[r]=null,"success"===t.status?i.onComplete(t.payload):i.onError&&i.onError()})}function o(e,t){var i="processId_"+(r+=1);return n[i]={onComplete:e,onError:t},i}return{loadAnimation:function(e,r,n){a();var i=o(r,n);t.postMessage({type:"loadAnimation",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},loadData:function(e,r,n){a();var i=o(r,n);t.postMessage({type:"loadData",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},completeAnimation:function(e,r,n){a();var i=o(r,n);t.postMessage({type:"complete",animation:e,id:i})}}}(),ImagePreloader=function(){var e=function(){var e=createTag("canvas");e.width=1,e.height=1;var t=e.getContext("2d");return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),e}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(e,t,r){var n="";if(e.e)n=e.p;else if(t){var i=e.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),n=t+i}else n=r,n+=e.u?e.u:"",n+=e.p;return n}function i(e){var t=0,r=setInterval(function(){(e.getBBox().width||t>500)&&(this._imageLoaded(),clearInterval(r)),t+=1}.bind(this),50)}function s(e){var t={assetData:e},r=n(e,this.assetsPath,this.path);return dataManager.loadData(r,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function a(){this._imageLoaded=t.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=i.bind(this),this.createFootageData=s.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return a.prototype={loadAssets:function(e,t){var r;this.imagesLoadedCb=t;var n=e.length;for(r=0;r<n;r+=1)e[r].layers||(e[r].t&&"seq"!==e[r].t?3===e[r].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(e[r]))):(this.totalImages+=1,this.images.push(this._createImageData(e[r]))))},setAssetsPath:function(e){this.assetsPath=e||""},setPath:function(e){this.path=e||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(e){for(var t=0,r=this.images.length;t<r;){if(this.images[t].assetData===e)return this.images[t].img;t+=1}return null},createImgData:function(t){var r=n(t,this.assetsPath,this.path),i=createTag("img");i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){s.img=e,this._imageLoaded()}.bind(this),!1),i.src=r;var s={img:i,assetData:t};return s},createImageData:function(t){var r=n(t,this.assetsPath,this.path),i=createNS("image");isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){s.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",r),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var s={img:i,assetData:t};return s},imageLoaded:t,footageLoaded:r,setCacheType:function(e,t){"svg"===e?(this._elementHelper=t,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},a}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var r=this._cbs[e],n=0;n<r.length;n+=1)r[n](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),function(){this.removeEventListener(e,t)}.bind(this)},removeEventListener:function(e,t){if(t){if(this._cbs[e]){for(var r=0,n=this._cbs[e].length;r<n;)this._cbs[e][r]===t&&(this._cbs[e].splice(r,1),r-=1,n-=1),r+=1;this._cbs[e].length||(this._cbs[e]=null)}}else this._cbs[e]=null}};var markerParser=function(){function e(e){for(var t,r=e.split("\r\n"),n={},i=0,s=0;s<r.length;s+=1)2===(t=r[s].split(":")).length&&(n[t[0]]=t[1].trim(),i+=1);if(0===i)throw new Error;return n}return function(t){for(var r=[],n=0;n<t.length;n+=1){var i=t[n],s={time:i.tm,duration:i.dr};try{s.payload=JSON.parse(t[n].cm)}catch(r){try{s.payload=e(t[n].cm)}catch(e){s.payload={name:t[n].cm}}}r.push(s)}return r}}(),ProjectInterface=function(){function e(e){this.compositions.push(e)}return function(){function t(e){for(var t=0,r=this.compositions.length;t<r;){if(this.compositions[t].data&&this.compositions[t].data.nm===e)return this.compositions[t].prepareFrame&&this.compositions[t].data.xt&&this.compositions[t].prepareFrame(this.currentFrame),this.compositions[t].compInterface;t+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),renderers={},registerRenderer=function(e,t){renderers[e]=t};function getRenderer(e){return renderers[e]}function _typeof$4(e){return _typeof$4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(e)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0)};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(e){(e.wrapper||e.container)&&(this.wrapper=e.wrapper||e.container);var t="svg";e.animType?t=e.animType:e.renderer&&(t=e.renderer);var r=getRenderer(t);this.renderer=new r(this,e.rendererSettings),this.imagePreloader.setCacheType(t,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=t,""===e.loop||null===e.loop||void 0===e.loop||!0===e.loop?this.loop=!0:!1===e.loop?this.loop=!1:this.loop=parseInt(e.loop,10),this.autoplay=!("autoplay"in e)||e.autoplay,this.name=e.name?e.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(e,"autoloadSegments")||e.autoloadSegments,this.assetsPath=e.assetsPath,this.initialSegment=e.initialSegment,e.audioFactory&&this.audioController.setAudioFactory(e.audioFactory),e.animationData?this.setupAnimation(e.animationData):e.path&&(-1!==e.path.lastIndexOf("\\")?this.path=e.path.substr(0,e.path.lastIndexOf("\\")+1):this.path=e.path.substr(0,e.path.lastIndexOf("/")+1),this.fileName=e.path.substr(e.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(e.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(e){dataManager.completeAnimation(e,this.configAnimation)},AnimationItem.prototype.setData=function(e,t){t&&"object"!==_typeof$4(t)&&(t=JSON.parse(t));var r={wrapper:e,animationData:t},n=e.attributes;r.path=n.getNamedItem("data-animation-path")?n.getNamedItem("data-animation-path").value:n.getNamedItem("data-bm-path")?n.getNamedItem("data-bm-path").value:n.getNamedItem("bm-path")?n.getNamedItem("bm-path").value:"",r.animType=n.getNamedItem("data-anim-type")?n.getNamedItem("data-anim-type").value:n.getNamedItem("data-bm-type")?n.getNamedItem("data-bm-type").value:n.getNamedItem("bm-type")?n.getNamedItem("bm-type").value:n.getNamedItem("data-bm-renderer")?n.getNamedItem("data-bm-renderer").value:n.getNamedItem("bm-renderer")?n.getNamedItem("bm-renderer").value:"canvas";var i=n.getNamedItem("data-anim-loop")?n.getNamedItem("data-anim-loop").value:n.getNamedItem("data-bm-loop")?n.getNamedItem("data-bm-loop").value:n.getNamedItem("bm-loop")?n.getNamedItem("bm-loop").value:"";"false"===i?r.loop=!1:"true"===i?r.loop=!0:""!==i&&(r.loop=parseInt(i,10));var s=n.getNamedItem("data-anim-autoplay")?n.getNamedItem("data-anim-autoplay").value:n.getNamedItem("data-bm-autoplay")?n.getNamedItem("data-bm-autoplay").value:!n.getNamedItem("bm-autoplay")||n.getNamedItem("bm-autoplay").value;r.autoplay="false"!==s,r.name=n.getNamedItem("data-name")?n.getNamedItem("data-name").value:n.getNamedItem("data-bm-name")?n.getNamedItem("data-bm-name").value:n.getNamedItem("bm-name")?n.getNamedItem("bm-name").value:"","false"===(n.getNamedItem("data-anim-prerender")?n.getNamedItem("data-anim-prerender").value:n.getNamedItem("data-bm-prerender")?n.getNamedItem("data-bm-prerender").value:n.getNamedItem("bm-prerender")?n.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(e){e.op>this.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,r,n=this.animationData.layers,i=n.length,s=e.layers,a=s.length;for(r=0;r<a;r+=1)for(t=0;t<i;){if(n[t].id===s[r].id){n[t]=s[r];break}t+=1}if((e.chars||e.fonts)&&(this.renderer.globalData.fontManager.addChars(e.chars),this.renderer.globalData.fontManager.addFonts(e.fonts,this.renderer.globalData.defs)),e.assets)for(i=e.assets.length,t=0;t<i;t+=1)this.animationData.assets.push(e.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(e){this.animationData=e;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var e=this.animationData.segments;if(!e||0===e.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var t=e.shift();this.timeCompleted=t.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(e){if(this.renderer)try{this.animationData=e,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(e),e.assets||(e.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(e.assets),this.markers=markerParser(e.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(e,t){var r="number"==typeof e?e:void 0,n="number"==typeof t?t:void 0;this.renderer.updateContainerSize(r,n)},AnimationItem.prototype.setSubframe=function(e){this.isSubframeEnabled=!!e},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_pause"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_play"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,r=0;r<this.markers.length;r+=1)if((t=this.markers[r]).payload&&t.payload.name===e)return t;return null},AnimationItem.prototype.goToAndStop=function(e,t,r){if(!r||this.name===r){var n=Number(e);if(isNaN(n)){var i=this.getMarkerData(e);i&&this.goToAndStop(i.time,!0)}else t?this.setCurrentRawFrameValue(e):this.setCurrentRawFrameValue(e*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(e,t,r){if(!r||this.name===r){var n=Number(e);if(isNaN(n)){var i=this.getMarkerData(e);i&&(i.duration?this.playSegments([i.time,i.time+i.duration],!0):this.goToAndStop(i.time,!0))}else this.goToAndStop(n,t,r);this.play()}},AnimationItem.prototype.advanceTime=function(e){if(!0!==this.isPaused&&!1!==this.isLoaded){var t=this.currentRawFrame+e*this.frameModifier,r=!1;t>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(r=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),r&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]<e[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<e?r=e:this.currentRawFrame+this.firstFrame>t&&(r=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"===_typeof$4(e[0])){var r,n=e.length;for(r=0;r<n;r+=1)this.segments.push(e[r])}else this.segments.push(e);this.segments.length&&t&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(e){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),e&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(e){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),e),!0)},AnimationItem.prototype.destroy=function(e){e&&this.name!==e||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(e){this.currentRawFrame=e,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(e){this.playSpeed=e,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(e){this.playDirection=e<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(e){this.loop=e},AnimationItem.prototype.setVolume=function(e,t){t&&this.name!==t||this.audioController.setVolume(e)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(e){e&&this.name!==e||this.audioController.mute()},AnimationItem.prototype.unmute=function(e){e&&this.name!==e||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(e){var t="";if(e.e)t=e.p;else if(this.assetsPath){var r=e.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),t=this.assetsPath+r}else t=this.path,t+=e.u?e.u:"",t+=e.p;return t},AnimationItem.prototype.getAssetData=function(e){for(var t=0,r=this.assets.length;t<r;){if(e===this.assets[t].id)return this.assets[t];t+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(e){return e?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(e,t,r){try{this.renderer.getElementByPath(e).updateDocumentData(t,r)}catch(e){}},AnimationItem.prototype.trigger=function(e){if(this._cbs&&this._cbs[e])switch(e){case"enterFrame":this.triggerEvent(e,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(e,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(e,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(e,new BMCompleteEvent(e,this.frameMult));break;case"segmentStart":this.triggerEvent(e,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(e,new BMDestroyEvent(e,this));break;default:this.triggerEvent(e)}"enterFrame"===e&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===e&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult)),"complete"===e&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(e,this.frameMult)),"segmentStart"===e&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames)),"destroy"===e&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(e,this))},AnimationItem.prototype.triggerRenderFrameError=function(e){var t=new BMRenderFrameErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},AnimationItem.prototype.triggerConfigError=function(e){var t=new BMConfigErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)};var animationManager=function(){var e={},t=[],r=0,n=0,i=0,s=!0,a=!1;function o(e){for(var r=0,i=e.target;r<n;)t[r].animation===i&&(t.splice(r,1),r-=1,n-=1,i.isPaused||h()),r+=1}function l(e,r){if(!e)return null;for(var i=0;i<n;){if(t[i].elem===e&&null!==t[i].elem)return t[i].animation;i+=1}var s=new AnimationItem;return d(s,e),s.setData(e,r),s}function c(){i+=1,f()}function h(){i-=1}function d(e,r){e.addEventListener("destroy",o),e.addEventListener("_active",c),e.addEventListener("_idle",h),t.push({elem:r,animation:e}),n+=1}function u(e){var o,l=e-r;for(o=0;o<n;o+=1)t[o].animation.advanceTime(l);r=e,i&&!a?window.requestAnimationFrame(u):s=!0}function p(e){r=e,window.requestAnimationFrame(u)}function f(){!a&&i&&s&&(window.requestAnimationFrame(p),s=!1)}return e.registerAnimation=l,e.loadAnimation=function(e){var t=new AnimationItem;return d(t,null),t.setParams(e),t},e.setSpeed=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setSpeed(e,r)},e.setDirection=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setDirection(e,r)},e.play=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.play(e)},e.pause=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.pause(e)},e.stop=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.stop(e)},e.togglePause=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.togglePause(e)},e.searchAnimations=function(e,t,r){var n,i=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),s=i.length;for(n=0;n<s;n+=1)r&&i[n].setAttribute("data-bm-type",r),l(i[n],e);if(t&&0===s){r||(r="svg");var a=document.getElementsByTagName("body")[0];a.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),a.appendChild(o),l(o,e)}},e.resize=function(){var e;for(e=0;e<n;e+=1)t[e].animation.resize()},e.goToAndStop=function(e,r,i){var s;for(s=0;s<n;s+=1)t[s].animation.goToAndStop(e,r,i)},e.destroy=function(e){var r;for(r=n-1;r>=0;r-=1)t[r].animation.destroy(e)},e.freeze=function(){a=!0},e.unfreeze=function(){a=!1,f()},e.setVolume=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setVolume(e,r)},e.mute=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.mute(e)},e.unmute=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.unmute(e)},e.getRegisteredAnimations=function(){var e,r=t.length,n=[];for(e=0;e<r;e+=1)n.push(t[e].animation);return n},e}(),BezierFactory=function(){var e={getBezierEasing:function(e,r,n,i,s){var a=s||("bez_"+e+"_"+r+"_"+n+"_"+i).replace(/\./g,"p");if(t[a])return t[a];var o=new h([e,r,n,i]);return t[a]=o,o}},t={},r=11,n=1/(r-1),i="function"==typeof Float32Array;function s(e,t){return 1-3*t+3*e}function a(e,t){return 3*t-6*e}function o(e){return 3*e}function l(e,t,r){return((s(t,r)*e+a(t,r))*e+o(t))*e}function c(e,t,r){return 3*s(t,r)*e*e+2*a(t,r)*e+o(t)}function h(e){this._p=e,this._mSampleValues=i?new Float32Array(r):new Array(r),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(e){var t=this._p[0],r=this._p[1],n=this._p[2],i=this._p[3];return this._precomputed||this._precompute(),t===r&&n===i?e:0===e?0:1===e?1:l(this._getTForX(e),r,i)},_precompute:function(){var e=this._p[0],t=this._p[1],r=this._p[2],n=this._p[3];this._precomputed=!0,e===t&&r===n||this._calcSampleValues()},_calcSampleValues:function(){for(var e=this._p[0],t=this._p[2],i=0;i<r;++i)this._mSampleValues[i]=l(i*n,e,t)},_getTForX:function(e){for(var t=this._p[0],i=this._p[2],s=this._mSampleValues,a=0,o=1,h=r-1;o!==h&&s[o]<=e;++o)a+=n;var d=a+(e-s[--o])/(s[o+1]-s[o])*n,u=c(d,t,i);return u>=.001?function(e,t,r,n){for(var i=0;i<4;++i){var s=c(t,r,n);if(0===s)return t;t-=(l(t,r,n)-e)/s}return t}(e,d,t,i):0===u?d:function(e,t,r,n,i){var s,a,o=0;do{(s=l(a=t+(r-t)/2,n,i)-e)>0?r=a:t=a}while(Math.abs(s)>1e-7&&++o<10);return a}(e,a,a+n,t,i)}},e}(),pooling={double:function(e){return e.concat(createSizedArray(e.length))}},poolFactory=function(e,t,r){var n=0,i=e,s=createSizedArray(i);return{newElement:function(){return n?s[n-=1]:t()},release:function(e){n===i&&(s=pooling.double(s),i*=2),r&&r(e),s[n]=e,n+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(e){var t,r=e.lengths.length;for(t=0;t<r;t+=1)bezierLengthPool.release(e.lengths[t]);e.lengths.length=0}));function bezFunction(){var e=Math;function t(e,t,r,n,i,s){var a=e*n+t*i+r*s-i*n-s*e-r*t;return a>-.001&&a<.001}var r=function(e,t,r,n){var i,s,a,o,l,c,h=getDefaultCurveSegments(),d=0,u=[],p=[],f=bezierLengthPool.newElement();for(a=r.length,i=0;i<h;i+=1){for(l=i/(h-1),c=0,s=0;s<a;s+=1)o=bmPow(1-l,3)*e[s]+3*bmPow(1-l,2)*l*r[s]+3*(1-l)*bmPow(l,2)*n[s]+bmPow(l,3)*t[s],u[s]=o,null!==p[s]&&(c+=bmPow(u[s]-p[s],2)),p[s]=u[s];c&&(d+=c=bmSqrt(c)),f.percents[i]=l,f.lengths[i]=d}return f.addedLength=d,f};function n(e){this.segmentLength=0,this.points=new Array(e)}function i(e,t){this.partialLength=e,this.point=t}var s,a=(s={},function(e,r,a,o){var l=(e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+a[0]+"_"+a[1]+"_"+o[0]+"_"+o[1]).replace(/\./g,"p");if(!s[l]){var c,h,d,u,p,f,m,g=getDefaultCurveSegments(),y=0,v=null;2===e.length&&(e[0]!==r[0]||e[1]!==r[1])&&t(e[0],e[1],r[0],r[1],e[0]+a[0],e[1]+a[1])&&t(e[0],e[1],r[0],r[1],r[0]+o[0],r[1]+o[1])&&(g=2);var b=new n(g);for(d=a.length,c=0;c<g;c+=1){for(m=createSizedArray(d),p=c/(g-1),f=0,h=0;h<d;h+=1)u=bmPow(1-p,3)*e[h]+3*bmPow(1-p,2)*p*(e[h]+a[h])+3*(1-p)*bmPow(p,2)*(r[h]+o[h])+bmPow(p,3)*r[h],m[h]=u,null!==v&&(f+=bmPow(m[h]-v[h],2));y+=f=bmSqrt(f),b.points[c]=new i(f,m),v=m}b.segmentLength=y,s[l]=b}return s[l]});function o(e,t){var r=t.percents,n=t.lengths,i=r.length,s=bmFloor((i-1)*e),a=e*t.addedLength,o=0;if(s===i-1||0===s||a===n[s])return r[s];for(var l=n[s]>a?-1:1,c=!0;c;)if(n[s]<=a&&n[s+1]>a?(o=(a-n[s])/(n[s+1]-n[s]),c=!1):s+=l,s<0||s>=i-1){if(s===i-1)return r[s];c=!1}return r[s]+(r[s+1]-r[s])*o}var l=createTypedArray("float32",8);return{getSegmentsLength:function(e){var t,n=segmentsLengthPool.newElement(),i=e.c,s=e.v,a=e.o,o=e.i,l=e._length,c=n.lengths,h=0;for(t=0;t<l-1;t+=1)c[t]=r(s[t],s[t+1],a[t],o[t+1]),h+=c[t].addedLength;return i&&l&&(c[t]=r(s[t],s[0],a[t],o[0]),h+=c[t].addedLength),n.totalLength=h,n},getNewSegment:function(t,r,n,i,s,a,c){s<0?s=0:s>1&&(s=1);var h,d=o(s,c),u=o(a=a>1?1:a,c),p=t.length,f=1-d,m=1-u,g=f*f*f,y=d*f*f*3,v=d*d*f*3,b=d*d*d,S=f*f*m,E=d*f*m+f*d*m+f*f*u,C=d*d*m+f*d*u+d*f*u,_=d*d*u,T=f*m*m,x=d*m*m+f*u*m+f*m*u,P=d*u*m+f*u*u+d*m*u,w=d*u*u,I=m*m*m,k=u*m*m+m*u*m+m*m*u,A=u*u*m+m*u*u+u*m*u,M=u*u*u;for(h=0;h<p;h+=1)l[4*h]=e.round(1e3*(g*t[h]+y*n[h]+v*i[h]+b*r[h]))/1e3,l[4*h+1]=e.round(1e3*(S*t[h]+E*n[h]+C*i[h]+_*r[h]))/1e3,l[4*h+2]=e.round(1e3*(T*t[h]+x*n[h]+P*i[h]+w*r[h]))/1e3,l[4*h+3]=e.round(1e3*(I*t[h]+k*n[h]+A*i[h]+M*r[h]))/1e3;return l},getPointInSegment:function(t,r,n,i,s,a){var l=o(s,a),c=1-l;return[e.round(1e3*(c*c*c*t[0]+(l*c*c+c*l*c+c*c*l)*n[0]+(l*l*c+c*l*l+l*c*l)*i[0]+l*l*l*r[0]))/1e3,e.round(1e3*(c*c*c*t[1]+(l*c*c+c*l*c+c*c*l)*n[1]+(l*l*c+c*l*l+l*c*l)*i[1]+l*l*l*r[1]))/1e3]},buildBezierData:a,pointOnLine2D:t,pointOnLine3D:function(r,n,i,s,a,o,l,c,h){if(0===i&&0===o&&0===h)return t(r,n,s,a,l,c);var d,u=e.sqrt(e.pow(s-r,2)+e.pow(a-n,2)+e.pow(o-i,2)),p=e.sqrt(e.pow(l-r,2)+e.pow(c-n,2)+e.pow(h-i,2)),f=e.sqrt(e.pow(l-s,2)+e.pow(c-a,2)+e.pow(h-o,2));return(d=u>p?u>f?u-p-f:f-p-u:f>p?f-p-u:p-u-f)>-1e-4&&d<1e-4}}}var bez=bezFunction(),PropertyFactory=function(){var e=initialDefaultFrame,t=Math.abs;function r(e,t){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,o,l,c,h,d,u,p,f=t.lastIndex,m=f,g=this.keyframes.length-1,y=!0;y;){if(s=this.keyframes[m],a=this.keyframes[m+1],m===g-1&&e>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>e){f=m;break}m<g-1?m+=1:(f=0,y=!1)}o=this.keyframesMetadata[m]||{};var v,b,S,E,C,_,T,x,P,w,I=a.t-i,k=s.t-i;if(s.to){o.bezierData||(o.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var A=o.bezierData;if(e>=I||e<k){var M=e>=I?A.points.length-1:0;for(c=A.points[M].point.length,l=0;l<c;l+=1)r[l]=A.points[M].point[l]}else{o.__fnct?p=o.__fnct:(p=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,o.__fnct=p),h=p((e-k)/(I-k));var R,O=A.segmentLength*h,$=t.lastFrame<e&&t._lastKeyframeIndex===m?t._lastAddedLength:0;for(u=t.lastFrame<e&&t._lastKeyframeIndex===m?t._lastPoint:0,y=!0,d=A.points.length;y;){if($+=A.points[u].partialLength,0===O||0===h||u===A.points.length-1){for(c=A.points[u].point.length,l=0;l<c;l+=1)r[l]=A.points[u].point[l];break}if(O>=$&&O<$+A.points[u+1].partialLength){for(R=(O-$)/A.points[u+1].partialLength,c=A.points[u].point.length,l=0;l<c;l+=1)r[l]=A.points[u].point[l]+(A.points[u+1].point[l]-A.points[u].point[l])*R;break}u<d-1?u+=1:y=!1}t._lastPoint=u,t._lastAddedLength=$-A.points[u].partialLength,t._lastKeyframeIndex=m}}else{var D,L,F,N,B;if(g=s.s.length,v=a.s||s.e,this.sh&&1!==s.h)if(e>=I)r[0]=v[0],r[1]=v[1],r[2]=v[2];else if(e<=k)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var V=n(s.s),U=n(v);b=r,S=function(e,t,r){var n,i,s,a,o,l=[],c=e[0],h=e[1],d=e[2],u=e[3],p=t[0],f=t[1],m=t[2],g=t[3];return(i=c*p+h*f+d*m+u*g)<0&&(i=-i,p=-p,f=-f,m=-m,g=-g),1-i>1e-6?(n=Math.acos(i),s=Math.sin(n),a=Math.sin((1-r)*n)/s,o=Math.sin(r*n)/s):(a=1-r,o=r),l[0]=a*c+o*p,l[1]=a*h+o*f,l[2]=a*d+o*m,l[3]=a*u+o*g,l}(V,U,(e-k)/(I-k)),E=S[0],C=S[1],_=S[2],T=S[3],x=Math.atan2(2*C*T-2*E*_,1-2*C*C-2*_*_),P=Math.asin(2*E*C+2*_*T),w=Math.atan2(2*E*T-2*C*_,1-2*E*E-2*_*_),b[0]=x/degToRads,b[1]=P/degToRads,b[2]=w/degToRads}else for(m=0;m<g;m+=1)1!==s.h&&(e>=I?h=1:e<k?h=0:(s.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[m]?p=o.__fnct[m]:(D=void 0===s.o.x[m]?s.o.x[0]:s.o.x[m],L=void 0===s.o.y[m]?s.o.y[0]:s.o.y[m],F=void 0===s.i.x[m]?s.i.x[0]:s.i.x[m],N=void 0===s.i.y[m]?s.i.y[0]:s.i.y[m],p=BezierFactory.getBezierEasing(D,L,F,N).get,o.__fnct[m]=p)):o.__fnct?p=o.__fnct:(D=s.o.x,L=s.o.y,F=s.i.x,N=s.i.y,p=BezierFactory.getBezierEasing(D,L,F,N).get,s.keyframeMetadata=p),h=p((e-k)/(I-k)))),v=a.s||s.e,B=1===s.h?s.s[m]:s.s[m]+(v[m]-s.s[m])*h,"multidimensional"===this.propType?r[m]=B:r=B}return t.lastIndex=f,r}function n(e){var t=e[0]*degToRads,r=e[1]*degToRads,n=e[2]*degToRads,i=Math.cos(t/2),s=Math.cos(r/2),a=Math.cos(n/2),o=Math.sin(t/2),l=Math.sin(r/2),c=Math.sin(n/2);return[o*l*a+i*s*c,o*s*a+i*l*c,i*l*a-o*s*c,i*s*a-o*l*c]}function i(){var t=this.comp.renderedFrame-this.offsetTime,r=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==e&&(this._caching.lastFrame>=n&&t>=n||this._caching.lastFrame<r&&t<r))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function s(e){var r;if("unidimensional"===this.propType)r=e*this.mult,t(this.v-r)>1e-5&&(this.v=r,this._mdf=!0);else for(var n=0,i=this.v.length;n<i;)r=e[n]*this.mult,t(this.v[n]-r)>1e-5&&(this.v[n]=r,this._mdf=!0),n+=1}function a(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e;this.lock=!0,this._mdf=this._isFirstFrame;var t=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(e=0;e<t;e+=1)r=this.effectsSequence[e](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function o(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(e,t,r,n){this.propType="unidimensional",this.mult=r||1,this.data=t,this.v=r?t.k*r:t.k,this.pv=t.k,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=a,this.setVValue=s,this.addEffect=o}function c(e,t,r,n){var i;this.propType="multidimensional",this.mult=r||1,this.data=t,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.frameId=-1;var l=t.k.length;for(this.v=createTypedArray("float32",l),this.pv=createTypedArray("float32",l),this.vel=createTypedArray("float32",l),i=0;i<l;i+=1)this.v[i]=t.k[i]*this.mult,this.pv[i]=t.k[i];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=a,this.setVValue=s,this.addEffect=o}function h(t,n,l,c){this.propType="unidimensional",this.keyframes=n.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:e,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=n,this.mult=l||1,this.elem=t,this.container=c,this.comp=t.comp,this.v=e,this.pv=e,this._isFirstFrame=!0,this.getValue=a,this.setVValue=s,this.interpolateValue=r,this.effectsSequence=[i.bind(this)],this.addEffect=o}function d(t,n,l,c){var h;this.propType="multidimensional";var d,u,p,f,m=n.k.length;for(h=0;h<m-1;h+=1)n.k[h].to&&n.k[h].s&&n.k[h+1]&&n.k[h+1].s&&(d=n.k[h].s,u=n.k[h+1].s,p=n.k[h].to,f=n.k[h].ti,(2===d.length&&(d[0]!==u[0]||d[1]!==u[1])&&bez.pointOnLine2D(d[0],d[1],u[0],u[1],d[0]+p[0],d[1]+p[1])&&bez.pointOnLine2D(d[0],d[1],u[0],u[1],u[0]+f[0],u[1]+f[1])||3===d.length&&(d[0]!==u[0]||d[1]!==u[1]||d[2]!==u[2])&&bez.pointOnLine3D(d[0],d[1],d[2],u[0],u[1],u[2],d[0]+p[0],d[1]+p[1],d[2]+p[2])&&bez.pointOnLine3D(d[0],d[1],d[2],u[0],u[1],u[2],u[0]+f[0],u[1]+f[1],u[2]+f[2]))&&(n.k[h].to=null,n.k[h].ti=null),d[0]===u[0]&&d[1]===u[1]&&0===p[0]&&0===p[1]&&0===f[0]&&0===f[1]&&(2===d.length||d[2]===u[2]&&0===p[2]&&0===f[2])&&(n.k[h].to=null,n.k[h].ti=null));this.effectsSequence=[i.bind(this)],this.data=n,this.keyframes=n.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=l||1,this.elem=t,this.container=c,this.comp=t.comp,this.getValue=a,this.setVValue=s,this.interpolateValue=r,this.frameId=-1;var g=n.k[0].s.length;for(this.v=createTypedArray("float32",g),this.pv=createTypedArray("float32",g),h=0;h<g;h+=1)this.v[h]=e,this.pv[h]=e;this._caching={lastFrame:e,lastIndex:0,value:createTypedArray("float32",g)},this.addEffect=o}var u={getProp:function(e,t,r,n,i){var s;if(t.k.length)if("number"==typeof t.k[0])s=new c(e,t,n,i);else switch(r){case 0:s=new h(e,t,n,i);break;case 1:s=new d(e,t,n,i)}else s=new l(e,t,n,i);return s.effectsSequence.length&&i.addDynamicProperty(s),s}};return u}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var e;this._mdf=!1;var t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=poolFactory(8,(function(){return createTypedArray("float32",2)}));function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(e,t){this.c=e,this.setLength(t);for(var r=0;r<t;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(e){for(;this._maxLength<e;)this.doubleArrayLength();this._length=e},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(e,t,r,n,i){var s;switch(this._length=Math.max(this._length,n+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":s=this.v;break;case"i":s=this.i;break;case"o":s=this.o;break;default:s=[]}(!s[n]||s[n]&&!i)&&(s[n]=pointPool.newElement()),s[n][0]=e,s[n][1]=t},ShapePath.prototype.setTripleAt=function(e,t,r,n,i,s,a,o){this.setXYAt(e,t,"v",a,o),this.setXYAt(r,n,"o",a,o),this.setXYAt(i,s,"i",a,o)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,r=this.o,n=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],n[0][0],n[0][1],r[0][0],r[0][1],0,!1),i=1);var s,a=this._length-1,o=this._length;for(s=i;s<o;s+=1)e.setTripleAt(t[a][0],t[a][1],n[a][0],n[a][1],r[a][0],r[a][1],s,!1),a-=1;return e},ShapePath.prototype.length=function(){return this._length};var shapePool=(factory=poolFactory(4,(function(){return new ShapePath}),(function(e){var t,r=e._length;for(t=0;t<r;t+=1)pointPool.release(e.v[t]),pointPool.release(e.i[t]),pointPool.release(e.o[t]),e.v[t]=null,e.i[t]=null,e.o[t]=null;e._length=0,e.c=!1})),factory.clone=function(e){var t,r=factory.newElement(),n=void 0===e._length?e.v.length:e._length;for(r.setLength(n),r.c=e.c,t=0;t<n;t+=1)r.setTripleAt(e.v[t][0],e.v[t][1],e.o[t][0],e.o[t][1],e.i[t][0],e.i[t][1],t);return r},factory),factory;function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(e){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=e,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var e;for(e=0;e<this._length;e+=1)shapePool.release(this.shapes[e]);this._length=0};var shapeCollectionPool=(ob={newShapeCollection:function(){return _length?pool[_length-=1]:new ShapeCollection},release:function(e){var t,r=e._length;for(t=0;t<r;t+=1)shapePool.release(e.shapes[t]);e._length=0,_length===_maxLength&&(pool=pooling.double(pool),_maxLength*=2),pool[_length]=e,_length+=1}},_length=0,_maxLength=4,pool=createSizedArray(_maxLength),ob),ob,_length,_maxLength,pool,ShapePropertyFactory=function(){var e=-999999;function t(e,t,r){var n,i,s,a,o,l,c,h,d,u=r.lastIndex,p=this.keyframes;if(e<p[0].t-this.offsetTime)n=p[0].s[0],s=!0,u=0;else if(e>=p[p.length-1].t-this.offsetTime)n=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],s=!0;else{for(var f,m,g,y=u,v=p.length-1,b=!0;b&&(f=p[y],!((m=p[y+1]).t-this.offsetTime>e));)y<v-1?y+=1:b=!1;if(g=this.keyframesMetadata[y]||{},u=y,!(s=1===f.h)){if(e>=m.t-this.offsetTime)h=1;else if(e<f.t-this.offsetTime)h=0;else{var S;g.__fnct?S=g.__fnct:(S=BezierFactory.getBezierEasing(f.o.x,f.o.y,f.i.x,f.i.y).get,g.__fnct=S),h=S((e-(f.t-this.offsetTime))/(m.t-this.offsetTime-(f.t-this.offsetTime)))}i=m.s?m.s[0]:f.e[0]}n=f.s[0]}for(l=t._length,c=n.i[0].length,r.lastIndex=u,a=0;a<l;a+=1)for(o=0;o<c;o+=1)d=s?n.i[a][o]:n.i[a][o]+(i.i[a][o]-n.i[a][o])*h,t.i[a][o]=d,d=s?n.o[a][o]:n.o[a][o]+(i.o[a][o]-n.o[a][o])*h,t.o[a][o]=d,d=s?n.v[a][o]:n.v[a][o]+(i.v[a][o]-n.v[a][o])*h,t.v[a][o]=d}function r(){var t=this.comp.renderedFrame-this.offsetTime,r=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==e&&(i<r&&t<r||i>n&&t>n)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function n(){this.paths=this.localShapeCollection}function i(e){(function(e,t){if(e._length!==t._length||e.c!==t.c)return!1;var r,n=e._length;for(r=0;r<n;r+=1)if(e.v[r][0]!==t.v[r][0]||e.v[r][1]!==t.v[r][1]||e.o[r][0]!==t.o[r][0]||e.o[r][1]!==t.o[r][1]||e.i[r][0]!==t.i[r][0]||e.i[r][1]!==t.i[r][1])return!1;return!0})(this.v,e)||(this.v=shapePool.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e,t;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(t=0;t<r;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function a(e,t,r){this.propType="shape",this.comp=e.comp,this.container=e,this.elem=e,this.data=t,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?t.pt.k:t.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=n,this.effectsSequence=[]}function o(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(t,i,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?i.pt.k:i.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var a=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,a),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=e,this.reset=n,this._caching={lastFrame:e,lastIndex:0},this.effectsSequence=[r.bind(this)]}a.prototype.interpolateShape=t,a.prototype.getValue=s,a.prototype.setVValue=i,a.prototype.addEffect=o,l.prototype.getValue=s,l.prototype.interpolateShape=t,l.prototype.setVValue=i,l.prototype.addEffect=o;var c=function(){var e=roundCorner;function t(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=t.d,this.elem=e,this.comp=e.comp,this.frameId=-1,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],r=this.p.v[1],n=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=r-i,a.v[1][0]=s?t+n:t-n,a.v[1][1]=r,a.v[2][0]=t,a.v[2][1]=r+i,a.v[3][0]=s?t-n:t+n,a.v[3][1]=r,a.i[0][0]=s?t-n*e:t+n*e,a.i[0][1]=r-i,a.i[1][0]=s?t+n:t-n,a.i[1][1]=r-i*e,a.i[2][0]=s?t+n*e:t-n*e,a.i[2][1]=r+i,a.i[3][0]=s?t-n:t+n,a.i[3][1]=r+i*e,a.o[0][0]=s?t+n*e:t-n*e,a.o[0][1]=r-i,a.o[1][0]=s?t+n:t-n,a.o[1][1]=r+i*e,a.o[2][0]=s?t-n*e:t+n*e,a.o[2][1]=r+i,a.o[3][0]=s?t-n:t+n,a.o[3][1]=r-i*e}},extendPrototype([DynamicPropertyContainer],t),t}(),h=function(){function e(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=e,this.comp=e.comp,this.data=t,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),1===t.sy?(this.ir=PropertyFactory.getProp(e,t.ir,0,0,this),this.is=PropertyFactory.getProp(e,t.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(e,t.pt,0,0,this),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,degToRads,this),this.or=PropertyFactory.getProp(e,t.or,0,0,this),this.os=PropertyFactory.getProp(e,t.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return e.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var e,t,r,n,i=2*Math.floor(this.pt.v),s=2*Math.PI/i,a=!0,o=this.or.v,l=this.ir.v,c=this.os.v,h=this.is.v,d=2*Math.PI*o/(2*i),u=2*Math.PI*l/(2*i),p=-Math.PI/2;p+=this.r.v;var f=3===this.data.d?-1:1;for(this.v._length=0,e=0;e<i;e+=1){r=a?c:h,n=a?d:u;var m=(t=a?o:l)*Math.cos(p),g=t*Math.sin(p),y=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),v=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-y*n*r*f,g-v*n*r*f,m+y*n*r*f,g+v*n*r*f,e,!0),a=!a,p+=s*f}},convertPolygonToPath:function(){var e,t=Math.floor(this.pt.v),r=2*Math.PI/t,n=this.or.v,i=this.os.v,s=2*Math.PI*n/(4*t),a=.5*-Math.PI,o=3===this.data.d?-1:1;for(a+=this.r.v,this.v._length=0,e=0;e<t;e+=1){var l=n*Math.cos(a),c=n*Math.sin(a),h=0===l&&0===c?0:c/Math.sqrt(l*l+c*c),d=0===l&&0===c?0:-l/Math.sqrt(l*l+c*c);l+=+this.p.v[0],c+=+this.p.v[1],this.v.setTripleAt(l,c,l-h*s*i*o,c-d*s*i*o,l+h*s*i*o,c+d*s*i*o,e,!0),a+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],e),e}(),d=function(){function e(e,t){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=e,this.comp=e.comp,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return e.prototype={convertRectToPath:function(){var e=this.p.v[0],t=this.p.v[1],r=this.s.v[0]/2,n=this.s.v[1]/2,i=bmMin(r,n,this.r.v),s=i*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(e+r,t-n+i,e+r,t-n+i,e+r,t-n+s,0,!0),this.v.setTripleAt(e+r,t+n-i,e+r,t+n-s,e+r,t+n-i,1,!0),0!==i?(this.v.setTripleAt(e+r-i,t+n,e+r-i,t+n,e+r-s,t+n,2,!0),this.v.setTripleAt(e-r+i,t+n,e-r+s,t+n,e-r+i,t+n,3,!0),this.v.setTripleAt(e-r,t+n-i,e-r,t+n-i,e-r,t+n-s,4,!0),this.v.setTripleAt(e-r,t-n+i,e-r,t-n+s,e-r,t-n+i,5,!0),this.v.setTripleAt(e-r+i,t-n,e-r+i,t-n,e-r+s,t-n,6,!0),this.v.setTripleAt(e+r-i,t-n,e+r-s,t-n,e+r-i,t-n,7,!0)):(this.v.setTripleAt(e-r,t+n,e-r+s,t+n,e-r,t+n,2),this.v.setTripleAt(e-r,t-n,e-r,t-n+s,e-r,t-n,3))):(this.v.setTripleAt(e+r,t-n+i,e+r,t-n+s,e+r,t-n+i,0,!0),0!==i?(this.v.setTripleAt(e+r-i,t-n,e+r-i,t-n,e+r-s,t-n,1,!0),this.v.setTripleAt(e-r+i,t-n,e-r+s,t-n,e-r+i,t-n,2,!0),this.v.setTripleAt(e-r,t-n+i,e-r,t-n+i,e-r,t-n+s,3,!0),this.v.setTripleAt(e-r,t+n-i,e-r,t+n-s,e-r,t+n-i,4,!0),this.v.setTripleAt(e-r+i,t+n,e-r+i,t+n,e-r+s,t+n,5,!0),this.v.setTripleAt(e+r-i,t+n,e+r-s,t+n,e+r-i,t+n,6,!0),this.v.setTripleAt(e+r,t+n-i,e+r,t+n-i,e+r,t+n-s,7,!0)):(this.v.setTripleAt(e-r,t-n,e-r+s,t-n,e-r,t-n,1,!0),this.v.setTripleAt(e-r,t+n,e-r,t+n-s,e-r,t+n,2,!0),this.v.setTripleAt(e+r,t+n,e+r-s,t+n,e+r,t+n,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:n},extendPrototype([DynamicPropertyContainer],e),e}(),u={getShapeProp:function(e,t,r){var n;return 3===r||4===r?n=(3===r?t.pt:t.ks).k.length?new l(e,t,r):new a(e,t,r):5===r?n=new d(e,t):6===r?n=new c(e,t):7===r&&(n=new h(e,t)),n.k&&e.addDynamicProperty(n),n},getConstructorFunction:function(){return a},getKeyframedConstructorFunction:function(){return l}};return u}(),Matrix=function(){var e=Math.cos,t=Math.sin,r=Math.tan,n=Math.round;function i(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function s(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1)}function a(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1)}function o(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1)}function l(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1)}function c(e,t){return this._t(1,t,e,1,0,0)}function h(e,t){return this.shear(r(e),r(t))}function d(n,i){var s=e(i),a=t(i);return this._t(s,a,0,0,-a,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,r(n),1,0,0,0,0,1,0,0,0,0,1)._t(s,-a,0,0,a,s,0,0,0,0,1,0,0,0,0,1)}function u(e,t,r){return r||0===r||(r=1),1===e&&1===t&&1===r?this:this._t(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1)}function p(e,t,r,n,i,s,a,o,l,c,h,d,u,p,f,m){return this.props[0]=e,this.props[1]=t,this.props[2]=r,this.props[3]=n,this.props[4]=i,this.props[5]=s,this.props[6]=a,this.props[7]=o,this.props[8]=l,this.props[9]=c,this.props[10]=h,this.props[11]=d,this.props[12]=u,this.props[13]=p,this.props[14]=f,this.props[15]=m,this}function f(e,t,r){return r=r||0,0!==e||0!==t||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,e,t,r,1):this}function m(e,t,r,n,i,s,a,o,l,c,h,d,u,p,f,m){var g=this.props;if(1===e&&0===t&&0===r&&0===n&&0===i&&1===s&&0===a&&0===o&&0===l&&0===c&&1===h&&0===d)return g[12]=g[12]*e+g[15]*u,g[13]=g[13]*s+g[15]*p,g[14]=g[14]*h+g[15]*f,g[15]*=m,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],S=g[3],E=g[4],C=g[5],_=g[6],T=g[7],x=g[8],P=g[9],w=g[10],I=g[11],k=g[12],A=g[13],M=g[14],R=g[15];return g[0]=y*e+v*i+b*l+S*u,g[1]=y*t+v*s+b*c+S*p,g[2]=y*r+v*a+b*h+S*f,g[3]=y*n+v*o+b*d+S*m,g[4]=E*e+C*i+_*l+T*u,g[5]=E*t+C*s+_*c+T*p,g[6]=E*r+C*a+_*h+T*f,g[7]=E*n+C*o+_*d+T*m,g[8]=x*e+P*i+w*l+I*u,g[9]=x*t+P*s+w*c+I*p,g[10]=x*r+P*a+w*h+I*f,g[11]=x*n+P*o+w*d+I*m,g[12]=k*e+A*i+M*l+R*u,g[13]=k*t+A*s+M*c+R*p,g[14]=k*r+A*a+M*h+R*f,g[15]=k*n+A*o+M*d+R*m,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(e){for(var t=0;t<16;){if(e.props[t]!==this.props[t])return!1;t+=1}return!0}function v(e){var t;for(t=0;t<16;t+=1)e.props[t]=this.props[t];return e}function b(e){var t;for(t=0;t<16;t+=1)this.props[t]=e[t]}function S(e,t,r){return{x:e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12],y:e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13],z:e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]}}function E(e,t,r){return e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12]}function C(e,t,r){return e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13]}function _(e,t,r){return e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]}function T(){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],t=this.props[5]/e,r=-this.props[1]/e,n=-this.props[4]/e,i=this.props[0]/e,s=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,a=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e,o=new Matrix;return o.props[0]=t,o.props[1]=r,o.props[4]=n,o.props[5]=i,o.props[12]=s,o.props[13]=a,o}function x(e){return this.getInverseMatrix().applyToPointArray(e[0],e[1],e[2]||0)}function P(e){var t,r=e.length,n=[];for(t=0;t<r;t+=1)n[t]=x(e[t]);return n}function w(e,t,r){var n=createTypedArray("float32",6);if(this.isIdentity())n[0]=e[0],n[1]=e[1],n[2]=t[0],n[3]=t[1],n[4]=r[0],n[5]=r[1];else{var i=this.props[0],s=this.props[1],a=this.props[4],o=this.props[5],l=this.props[12],c=this.props[13];n[0]=e[0]*i+e[1]*a+l,n[1]=e[0]*s+e[1]*o+c,n[2]=t[0]*i+t[1]*a+l,n[3]=t[0]*s+t[1]*o+c,n[4]=r[0]*i+r[1]*a+l,n[5]=r[0]*s+r[1]*o+c}return n}function I(e,t,r){return this.isIdentity()?[e,t,r]:[e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12],e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13],e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]]}function k(e,t){if(this.isIdentity())return e+","+t;var r=this.props;return Math.round(100*(e*r[0]+t*r[4]+r[12]))/100+","+Math.round(100*(e*r[1]+t*r[5]+r[13]))/100}function A(){for(var e=0,t=this.props,r="matrix3d(";e<16;)r+=n(1e4*t[e])/1e4,r+=15===e?")":",",e+=1;return r}function M(e){return e<1e-6&&e>0||e>-1e-6&&e<0?n(1e4*e)/1e4:e}function R(){var e=this.props;return"matrix("+M(e[0])+","+M(e[1])+","+M(e[4])+","+M(e[5])+","+M(e[12])+","+M(e[13])+")"}return function(){this.reset=i,this.rotate=s,this.rotateX=a,this.rotateY=o,this.rotateZ=l,this.skew=h,this.skewFromAxis=d,this.shear=c,this.scale=u,this.setTransform=p,this.translate=f,this.transform=m,this.applyToPoint=S,this.applyToX=E,this.applyToY=C,this.applyToZ=_,this.applyToPointArray=I,this.applyToTriplePoints=w,this.applyToPointStringified=k,this.toCSS=A,this.to2dCSS=R,this.clone=v,this.cloneFromProps=b,this.equals=y,this.inversePoints=P,this.inversePoint=x,this.getInverseMatrix=T,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(e){return _typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(e)}var lottie={};function setLocation(e){setLocationHref(e)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return animationManager.loadAnimation(e)}function setQuality(e){if("string"==typeof e)switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(e,t){"expressions"===e&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),r=0;r<t.length;r+=1){var n=t[r].split("=");if(decodeURIComponent(n[0])==e)return decodeURIComponent(n[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.10.2";var queryString="",scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer");var readyStateCheckInterval=setInterval(checkReady,100);try{"object"!==_typeof$3(exports)&&(window.bodymovin=lottie)}catch(e){}var ShapeModifiers=function(){var e={},t={};return e.registerModifier=function(e,r){t[e]||(t[e]=r)},e.getModifier=function(e,r,n){return new t[e](r,n)},e}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(e){if(!this.closed){e.sh.container.addDynamicProperty(e.sh);var t={shape:e.sh,data:e,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(t),this.addShapeToModifier(t),this._isAnimated&&e.setAsAnimated()}},ShapeModifier.prototype.init=function(e,t){this.shapes=[],this.elem=e,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(e,t){this.s=PropertyFactory.getProp(e,t.s,0,.01,this),this.e=PropertyFactory.getProp(e,t.e,0,.01,this),this.o=PropertyFactory.getProp(e,t.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=t.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(e){e.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(e,t,r,n,i){var s=[];t<=1?s.push({s:e,e:t}):e>=1?s.push({s:e-1,e:t-1}):(s.push({s:e,e:1}),s.push({s:0,e:t-1}));var a,o,l=[],c=s.length;for(a=0;a<c;a+=1){var h,d;(o=s[a]).e*i<n||o.s*i>n+r||(h=o.s*i<=n?0:(o.s*i-n)/r,d=o.e*i>=n+r?1:(o.e*i-n)/r,l.push([h,d]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,r=e.length;for(t=0;t<r;t+=1)segmentsLengthPool.release(e[t]);return e.length=0,e},TrimModifier.prototype.processShapes=function(e){var t,r,n,i;if(this._mdf||e){var s=this.o.v%360/360;if(s<0&&(s+=1),(t=this.s.v>1?1+s:this.s.v<0?0+s:this.s.v+s)>(r=this.e.v>1?1+s:this.e.v<0?0+s:this.e.v+s)){var a=t;t=r,r=a}t=1e-4*Math.round(1e4*t),r=1e-4*Math.round(1e4*r),this.sValue=t,this.eValue=r}else t=this.sValue,r=this.eValue;var o,l,c,h,d,u=this.shapes.length,p=0;if(r===t)for(i=0;i<u;i+=1)this.shapes[i].localShapeCollection.releaseShapes(),this.shapes[i].shape._mdf=!0,this.shapes[i].shape.paths=this.shapes[i].localShapeCollection,this._mdf&&(this.shapes[i].pathsData.length=0);else if(1===r&&0===t||0===r&&1===t){if(this._mdf)for(i=0;i<u;i+=1)this.shapes[i].pathsData.length=0,this.shapes[i].shape._mdf=!0}else{var f,m,g=[];for(i=0;i<u;i+=1)if((f=this.shapes[i]).shape._mdf||this._mdf||e||2===this.m){if(l=(n=f.shape.paths)._length,d=0,!f.shape._mdf&&f.pathsData.length)d=f.totalShapeLength;else{for(c=this.releasePathsData(f.pathsData),o=0;o<l;o+=1)h=bez.getSegmentsLength(n.shapes[o]),c.push(h),d+=h.totalLength;f.totalShapeLength=d,f.pathsData=c}p+=d,f.shape._mdf=!0}else f.shape.paths=f.localShapeCollection;var y,v=t,b=r,S=0;for(i=u-1;i>=0;i-=1)if((f=this.shapes[i]).shape._mdf){for((m=f.localShapeCollection).releaseShapes(),2===this.m&&u>1?(y=this.calculateShapeEdges(t,r,f.totalShapeLength,S,p),S+=f.totalShapeLength):y=[[v,b]],l=y.length,o=0;o<l;o+=1){v=y[o][0],b=y[o][1],g.length=0,b<=1?g.push({s:f.totalShapeLength*v,e:f.totalShapeLength*b}):v>=1?g.push({s:f.totalShapeLength*(v-1),e:f.totalShapeLength*(b-1)}):(g.push({s:f.totalShapeLength*v,e:f.totalShapeLength}),g.push({s:0,e:f.totalShapeLength*(b-1)}));var E=this.addShapes(f,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(f.shape.paths.shapes[f.shape.paths._length-1].c){var C=E.pop();this.addPaths(E,m),E=this.addShapes(f,g[1],C)}else this.addPaths(E,m),E=this.addShapes(f,g[1]);this.addPaths(E,m)}}f.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)t.addShape(e[r])},TrimModifier.prototype.addSegment=function(e,t,r,n,i,s,a){i.setXYAt(t[0],t[1],"o",s),i.setXYAt(r[0],r[1],"i",s+1),a&&i.setXYAt(e[0],e[1],"v",s),i.setXYAt(n[0],n[1],"v",s+1)},TrimModifier.prototype.addSegmentFromArray=function(e,t,r,n){t.setXYAt(e[1],e[5],"o",r),t.setXYAt(e[2],e[6],"i",r+1),n&&t.setXYAt(e[0],e[4],"v",r),t.setXYAt(e[3],e[7],"v",r+1)},TrimModifier.prototype.addShapes=function(e,t,r){var n,i,s,a,o,l,c,h,d=e.pathsData,u=e.shape.paths.shapes,p=e.shape.paths._length,f=0,m=[],g=!0;for(r?(o=r._length,h=r._length):(r=shapePool.newElement(),o=0,h=0),m.push(r),n=0;n<p;n+=1){for(l=d[n].lengths,r.c=u[n].c,s=u[n].c?l.length:l.length+1,i=1;i<s;i+=1)if(f+(a=l[i-1]).addedLength<t.s)f+=a.addedLength,r.c=!1;else{if(f>t.e){r.c=!1;break}t.s<=f&&t.e>=f+a.addedLength?(this.addSegment(u[n].v[i-1],u[n].o[i-1],u[n].i[i],u[n].v[i],r,o,g),g=!1):(c=bez.getNewSegment(u[n].v[i-1],u[n].v[i],u[n].o[i-1],u[n].i[i],(t.s-f)/a.addedLength,(t.e-f)/a.addedLength,l[i-1]),this.addSegmentFromArray(c,r,o,g),g=!1,r.c=!1),f+=a.addedLength,o+=1}if(u[n].c&&l.length){if(a=l[i-1],f<=t.e){var y=l[i-1].addedLength;t.s<=f&&t.e>=f+y?(this.addSegment(u[n].v[i-1],u[n].o[i-1],u[n].i[0],u[n].v[0],r,o,g),g=!1):(c=bez.getNewSegment(u[n].v[i-1],u[n].v[0],u[n].o[i-1],u[n].i[0],(t.s-f)/y,(t.e-f)/y,l[i-1]),this.addSegmentFromArray(c,r,o,g),g=!1,r.c=!1)}else r.c=!1;f+=a.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[h][0],r.v[h][1],"i",h),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),f>t.e)break;n<p-1&&(r=shapePool.newElement(),g=!0,m.push(r),o=0)}return m},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(e,t){var r=t/100,n=[0,0],i=e._length,s=0;for(s=0;s<i;s+=1)n[0]+=e.v[s][0],n[1]+=e.v[s][1];n[0]/=i,n[1]/=i;var a,o,l,c,h,d,u=shapePool.newElement();for(u.c=e.c,s=0;s<i;s+=1)a=e.v[s][0]+(n[0]-e.v[s][0])*r,o=e.v[s][1]+(n[1]-e.v[s][1])*r,l=e.o[s][0]+(n[0]-e.o[s][0])*-r,c=e.o[s][1]+(n[1]-e.o[s][1])*-r,h=e.i[s][0]+(n[0]-e.i[s][0])*-r,d=e.i[s][1]+(n[1]-e.i[s][1])*-r,u.setTripleAt(a,o,l,c,h,d,s);return u},PuckerAndBloatModifier.prototype.processShapes=function(e){var t,r,n,i,s,a,o=this.shapes.length,l=this.amount.v;if(0!==l)for(r=0;r<o;r+=1){if(a=(s=this.shapes[r]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,n=0;n<i;n+=1)a.addShape(this.processPath(t[n],l));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var e=[0,0];function t(e,t,r){if(this.elem=e,this.frameId=-1,this.propType="transform",this.data=t,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||e),t.p&&t.p.s?(this.px=PropertyFactory.getProp(e,t.p.x,0,0,this),this.py=PropertyFactory.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=PropertyFactory.getProp(e,t.p.z,0,0,this))):this.p=PropertyFactory.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=PropertyFactory.getProp(e,t.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(e,t.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(e,t.rz,0,degToRads,this),t.or.k[0].ti){var n,i=t.or.k.length;for(n=0;n<i;n+=1)t.or.k[n].to=null,t.or.k[n].ti=null}this.or=PropertyFactory.getProp(e,t.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(e,t.r||{k:0},0,degToRads,this);t.sk&&(this.sk=PropertyFactory.getProp(e,t.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(e,t.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(e,t.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(e,t.s||{k:[100,100,100]},1,.01,this),t.o?this.o=PropertyFactory.getProp(e,t.o,0,.01,e):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return t.prototype={applyToMatrix:function(e){var t=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||t,this.a&&e.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&e.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&e.skewFromAxis(-this.sk.v,this.sa.v),this.r?e.rotate(-this.r.v):e.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?e.translate(this.px.v,this.py.v,-this.pz.v):e.translate(this.px.v,this.py.v,0):e.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var r;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var n,i;if(r=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(n=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/r,0),i=this.p.getValueAtTime(this.p.keyframes[0].t/r,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(n=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/r,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/r,0)):(n=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/r,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){n=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(n[0]=s.getValueAtTime((s.keyframes[0].t+.01)/r,0),n[1]=a.getValueAtTime((a.keyframes[0].t+.01)/r,0),i[0]=s.getValueAtTime(s.keyframes[0].t/r,0),i[1]=a.getValueAtTime(a.keyframes[0].t/r,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(n[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/r,0),n[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/r,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/r,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/r,0)):(n=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/r,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/r,a.offsetTime))}else n=i=e;this.v.rotate(-Math.atan2(n[1]-i[1],n[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,r,n){return new t(e,r,n)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(e,t){return 1e5*Math.abs(e-t)<=Math.min(Math.abs(e),Math.abs(t))}function floatZero(e){return Math.abs(e)<=1e-5}function lerp(e,t,r){return e*(1-r)+t*r}function lerpPoint(e,t,r){return[lerp(e[0],t[0],r),lerp(e[1],t[1],r)]}function quadRoots(e,t,r){if(0===e)return[];var n=t*t-4*e*r;if(n<0)return[];var i=-t/(2*e);if(0===n)return[i];var s=Math.sqrt(n)/(2*e);return[i-s,i+s]}function polynomialCoefficients(e,t,r,n){return[3*t-e-3*r+n,3*e-6*t+3*r,-3*e+3*t,e]}function singlePoint(e){return new PolynomialBezier(e,e,e,e,!1)}function PolynomialBezier(e,t,r,n,i){i&&pointEqual(e,t)&&(t=lerpPoint(e,n,1/3)),i&&pointEqual(r,n)&&(r=lerpPoint(e,n,2/3));var s=polynomialCoefficients(e[0],t[0],r[0],n[0]),a=polynomialCoefficients(e[1],t[1],r[1],n[1]);this.a=[s[0],a[0]],this.b=[s[1],a[1]],this.c=[s[2],a[2]],this.d=[s[3],a[3]],this.points=[e,t,r,n]}function extrema(e,t){var r=e.points[0][t],n=e.points[e.points.length-1][t];if(r>n){var i=n;n=r,r=i}for(var s=quadRoots(3*e.a[t],2*e.b[t],e.c[t]),a=0;a<s.length;a+=1)if(s[a]>0&&s[a]<1){var o=e.point(s[a])[t];o<r?r=o:o>n&&(n=o)}return{min:r,max:n}}function intersectData(e,t,r){var n=e.boundingBox();return{cx:n.cx,cy:n.cy,width:n.width,height:n.height,bez:e,t:(t+r)/2,t1:t,t2:r}}function splitData(e){var t=e.bez.split(.5);return[intersectData(t[0],e.t1,e.t),intersectData(t[1],e.t,e.t2)]}function boxIntersect(e,t){return 2*Math.abs(e.cx-t.cx)<e.width+t.width&&2*Math.abs(e.cy-t.cy)<e.height+t.height}function intersectsImpl(e,t,r,n,i,s){if(boxIntersect(e,t))if(r>=s||e.width<=n&&e.height<=n&&t.width<=n&&t.height<=n)i.push([e.t,t.t]);else{var a=splitData(e),o=splitData(t);intersectsImpl(a[0],o[0],r+1,n,i,s),intersectsImpl(a[0],o[1],r+1,n,i,s),intersectsImpl(a[1],o[0],r+1,n,i,s),intersectsImpl(a[1],o[1],r+1,n,i,s)}}function crossProduct(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function lineIntersection(e,t,r,n){var i=[e[0],e[1],1],s=[t[0],t[1],1],a=[r[0],r[1],1],o=[n[0],n[1],1],l=crossProduct(crossProduct(i,s),crossProduct(a,o));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(e,t,r){return[e[0]+Math.cos(t)*r,e[1]-Math.sin(t)*r]}function pointDistance(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function pointEqual(e,t){return floatEqual(e[0],t[0])&&floatEqual(e[1],t[1])}function ZigZagModifier(){}function setPoint(e,t,r,n,i,s,a){var o=r-Math.PI/2,l=r+Math.PI/2,c=t[0]+Math.cos(r)*n*i,h=t[1]-Math.sin(r)*n*i;e.setTripleAt(c,h,c+Math.cos(o)*s,h-Math.sin(o)*s,c+Math.cos(l)*a,h-Math.sin(l)*a,e.length())}function getPerpendicularVector(e,t){var r=[t[0]-e[0],t[1]-e[1]],n=.5*-Math.PI;return[Math.cos(n)*r[0]-Math.sin(n)*r[1],Math.sin(n)*r[0]+Math.cos(n)*r[1]]}function getProjectingAngle(e,t){var r=0===t?e.length()-1:t-1,n=(t+1)%e.length(),i=getPerpendicularVector(e.v[r],e.v[n]);return Math.atan2(0,1)-Math.atan2(i[1],i[0])}function zigZagCorner(e,t,r,n,i,s,a){var o=getProjectingAngle(t,r),l=t.v[r%t._length],c=t.v[0===r?t._length-1:r-1],h=t.v[(r+1)%t._length],d=2===s?Math.sqrt(Math.pow(l[0]-c[0],2)+Math.pow(l[1]-c[1],2)):0,u=2===s?Math.sqrt(Math.pow(l[0]-h[0],2)+Math.pow(l[1]-h[1],2)):0;setPoint(e,t.v[r%t._length],o,a,n,u/(2*(i+1)),d/(2*(i+1)))}function zigZagSegment(e,t,r,n,i,s){for(var a=0;a<n;a+=1){var o=(a+1)/(n+1),l=2===i?Math.sqrt(Math.pow(t.points[3][0]-t.points[0][0],2)+Math.pow(t.points[3][1]-t.points[0][1],2)):0,c=t.normalAngle(o);setPoint(e,t.point(o),c,s,r,l/(2*(n+1)),l/(2*(n+1))),s=-s}return s}function linearOffset(e,t,r){var n=Math.atan2(t[0]-e[0],t[1]-e[1]);return[polarOffset(e,n,r),polarOffset(t,n,r)]}function offsetSegment(e,t){var r,n,i,s,a,o,l;r=(l=linearOffset(e.points[0],e.points[1],t))[0],n=l[1],i=(l=linearOffset(e.points[1],e.points[2],t))[0],s=l[1],a=(l=linearOffset(e.points[2],e.points[3],t))[0],o=l[1];var c=lineIntersection(r,n,i,s);null===c&&(c=n);var h=lineIntersection(a,o,i,s);return null===h&&(h=a),new PolynomialBezier(r,c,h,o)}function joinLines(e,t,r,n,i){var s=t.points[3],a=r.points[0];if(3===n)return s;if(pointEqual(s,a))return s;if(2===n){var o=-t.tangentAngle(1),l=-r.tangentAngle(0)+Math.PI,c=lineIntersection(s,polarOffset(s,o+Math.PI/2,100),a,polarOffset(a,o+Math.PI/2,100)),h=c?pointDistance(c,s):pointDistance(s,a)/2,d=polarOffset(s,o,2*h*roundCorner);return e.setXYAt(d[0],d[1],"o",e.length()-1),d=polarOffset(a,l,2*h*roundCorner),e.setTripleAt(a[0],a[1],a[0],a[1],d[0],d[1],e.length()),a}var u=lineIntersection(pointEqual(s,t.points[2])?t.points[0]:t.points[2],s,a,pointEqual(a,r.points[1])?r.points[3]:r.points[1]);return u&&pointDistance(u,s)<i?(e.setTripleAt(u[0],u[1],u[0],u[1],u[0],u[1],e.length()),u):s}function getIntersection(e,t){var r=e.intersections(t);return r.length&&floatEqual(r[0][0],1)&&r.shift(),r.length?r[0]:null}function pruneSegmentIntersection(e,t){var r=e.slice(),n=t.slice(),i=getIntersection(e[e.length-1],t[0]);return i&&(r[e.length-1]=e[e.length-1].split(i[0])[0],n[0]=t[0].split(i[1])[1]),e.length>1&&t.length>1&&(i=getIntersection(e[0],t[t.length-1]))?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[r,n]}function pruneIntersections(e){for(var t,r=1;r<e.length;r+=1)t=pruneSegmentIntersection(e[r-1],e[r]),e[r-1]=t[0],e[r]=t[1];return e.length>1&&(t=pruneSegmentIntersection(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function offsetSegmentSplit(e,t){var r,n,i,s,a=e.inflectionPoints();if(0===a.length)return[offsetSegment(e,t)];if(1===a.length||floatEqual(a[1],1))return r=(i=e.split(a[0]))[0],n=i[1],[offsetSegment(r,t),offsetSegment(n,t)];r=(i=e.split(a[0]))[0];var o=(a[1]-a[0])/(1-a[0]);return s=(i=i[1].split(o))[0],n=i[1],[offsetSegment(r,t),offsetSegment(s,t),offsetSegment(n,t)]}function OffsetPathModifier(){}function getFontProperties(e){for(var t=e.fStyle?e.fStyle.split(" "):[],r="normal",n="normal",i=t.length,s=0;s<i;s+=1)switch(t[s].toLowerCase()){case"italic":n="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:n,weight:e.fWeight||r}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(e,t.c,0,null,this),this.o=PropertyFactory.getProp(e,t.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(e,t.tr,this),this.so=PropertyFactory.getProp(e,t.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(e,t.tr.eo,0,.01,this),this.data=t,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(e,t,r,n,i,s){var a=s?-1:1,o=n.s.v[0]+(1-n.s.v[0])*(1-i),l=n.s.v[1]+(1-n.s.v[1])*(1-i);e.translate(n.p.v[0]*a*i,n.p.v[1]*a*i,n.p.v[2]),t.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),t.rotate(-n.r.v*a*i),t.translate(n.a.v[0],n.a.v[1],n.a.v[2]),r.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),r.scale(s?1/o:o,s?1/l:l),r.translate(n.a.v[0],n.a.v[1],n.a.v[2])},RepeaterModifier.prototype.init=function(e,t,r,n){for(this.elem=e,this.arr=t,this.pos=r,this.elemsData=n,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t[r]);r>0;)r-=1,this._elements.unshift(t[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t]._processed=!1,"gr"===e[t].ty&&this.resetElements(e[t].it)},RepeaterModifier.prototype.cloneElements=function(e){var t=JSON.parse(JSON.stringify(e));return this.resetElements(t),t},RepeaterModifier.prototype.changeGroupRender=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)e[r]._render=t,"gr"===e[r].ty&&this.changeGroupRender(e[r].it,t)},RepeaterModifier.prototype.processShapes=function(e){var t,r,n,i,s,a=!1;if(this._mdf||e){var o,l=Math.ceil(this.c.v);if(this._groups.length<l){for(;this._groups.length<l;){var c={it:this.cloneElements(this._elements),ty:"gr"};c.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,c),this._groups.splice(0,0,c),this._currentCopies+=1}this.elem.reloadShapes(),a=!0}for(s=0,n=0;n<=this._groups.length-1;n+=1){if(o=s<l,this._groups[n]._render=o,this.changeGroupRender(this._groups[n].it,o),!o){var h=this.elemsData[n].it,d=h[h.length-1];0!==d.transform.op.v?(d.transform.op._mdf=!0,d.transform.op.v=0):d.transform.op._mdf=!1}s+=1}this._currentCopies=l;var u=this.o.v,p=u%1,f=u>0?Math.floor(u):Math.ceil(u),m=this.pMatrix.props,g=this.rMatrix.props,y=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,S=0;if(u>0){for(;S<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),S+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),S+=p)}else if(u<0){for(;S>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),S-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),S-=p)}for(n=1===this.data.m?0:this._currentCopies-1,i=1===this.data.m?1:-1,s=this._currentCopies;s;){if(b=(r=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(n/(this._currentCopies-1)),0!==S){for((0!==n&&1===i||n!==this._currentCopies-1&&-1===i)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),v=0;v<b;v+=1)r[v]=this.matrix.props[v];this.matrix.reset()}else for(this.matrix.reset(),v=0;v<b;v+=1)r[v]=this.matrix.props[v];S+=1,s-=1,n+=i}}else for(s=this._currentCopies,n=0,i=1;s;)r=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props,t[t.length-1].transform.mProps._mdf=!1,t[t.length-1].transform.op._mdf=!1,s-=1,n+=i;return a},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(e,t.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(e,t){var r,n=shapePool.newElement();n.c=e.c;var i,s,a,o,l,c,h,d,u,p,f,m,g=e._length,y=0;for(r=0;r<g;r+=1)i=e.v[r],a=e.o[r],s=e.i[r],i[0]===a[0]&&i[1]===a[1]&&i[0]===s[0]&&i[1]===s[1]?0!==r&&r!==g-1||e.c?(o=0===r?e.v[g-1]:e.v[r-1],c=(l=Math.sqrt(Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)))?Math.min(l/2,t)/l:0,h=f=i[0]+(o[0]-i[0])*c,d=m=i[1]-(i[1]-o[1])*c,u=h-(h-i[0])*roundCorner,p=d-(d-i[1])*roundCorner,n.setTripleAt(h,d,u,p,f,m,y),y+=1,o=r===g-1?e.v[0]:e.v[r+1],c=(l=Math.sqrt(Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)))?Math.min(l/2,t)/l:0,h=u=i[0]+(o[0]-i[0])*c,d=p=i[1]+(o[1]-i[1])*c,f=h-(h-i[0])*roundCorner,m=d-(d-i[1])*roundCorner,n.setTripleAt(h,d,u,p,f,m,y),y+=1):(n.setTripleAt(i[0],i[1],a[0],a[1],s[0],s[1],y),y+=1):(n.setTripleAt(e.v[r][0],e.v[r][1],e.o[r][0],e.o[r][1],e.i[r][0],e.i[r][1],y),y+=1);return n},RoundCornersModifier.prototype.processShapes=function(e){var t,r,n,i,s,a,o=this.shapes.length,l=this.rd.v;if(0!==l)for(r=0;r<o;r+=1){if(a=(s=this.shapes[r]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,n=0;n<i;n+=1)a.addShape(this.processPath(t[n],l));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},PolynomialBezier.prototype.point=function(e){return[((this.a[0]*e+this.b[0])*e+this.c[0])*e+this.d[0],((this.a[1]*e+this.b[1])*e+this.c[1])*e+this.d[1]]},PolynomialBezier.prototype.derivative=function(e){return[(3*e*this.a[0]+2*this.b[0])*e+this.c[0],(3*e*this.a[1]+2*this.b[1])*e+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(e){var t=this.derivative(e);return Math.atan2(t[1],t[0])},PolynomialBezier.prototype.normalAngle=function(e){var t=this.derivative(e);return Math.atan2(t[0],t[1])},PolynomialBezier.prototype.inflectionPoints=function(){var e=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(e))return[];var t=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/e,r=t*t-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/e;if(r<0)return[];var n=Math.sqrt(r);return floatZero(n)?n>0&&n<1?[t]:[]:[t-n,t+n].filter((function(e){return e>0&&e<1}))},PolynomialBezier.prototype.split=function(e){if(e<=0)return[singlePoint(this.points[0]),this];if(e>=1)return[this,singlePoint(this.points[this.points.length-1])];var t=lerpPoint(this.points[0],this.points[1],e),r=lerpPoint(this.points[1],this.points[2],e),n=lerpPoint(this.points[2],this.points[3],e),i=lerpPoint(t,r,e),s=lerpPoint(r,n,e),a=lerpPoint(i,s,e);return[new PolynomialBezier(this.points[0],t,i,a,!0),new PolynomialBezier(a,s,n,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}},PolynomialBezier.prototype.intersections=function(e,t,r){void 0===t&&(t=2),void 0===r&&(r=7);var n=[];return intersectsImpl(intersectData(this,0,1),intersectData(e,0,1),0,t,n,r),n},PolynomialBezier.shapeSegment=function(e,t){var r=(t+1)%e.length();return new PolynomialBezier(e.v[t],e.o[t],e.i[r],e.v[r],!0)},PolynomialBezier.shapeSegmentInverted=function(e,t){var r=(t+1)%e.length();return new PolynomialBezier(e.v[r],e.i[r],e.o[t],e.v[t],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(e,t.s,0,null,this),this.frequency=PropertyFactory.getProp(e,t.r,0,null,this),this.pointsType=PropertyFactory.getProp(e,t.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(e,t,r,n){var i=e._length,s=shapePool.newElement();if(s.c=e.c,e.c||(i-=1),0===i)return s;var a=-1,o=PolynomialBezier.shapeSegment(e,0);zigZagCorner(s,e,0,t,r,n,a);for(var l=0;l<i;l+=1)a=zigZagSegment(s,o,t,r,n,-a),o=l!==i-1||e.c?PolynomialBezier.shapeSegment(e,(l+1)%i):null,zigZagCorner(s,e,l+1,t,r,n,a);return s},ZigZagModifier.prototype.processShapes=function(e){var t,r,n,i,s,a,o=this.shapes.length,l=this.amplitude.v,c=Math.max(0,Math.round(this.frequency.v)),h=this.pointsType.v;if(0!==l)for(r=0;r<o;r+=1){if(a=(s=this.shapes[r]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,n=0;n<i;n+=1)a.addShape(this.processPath(t[n],l,c,h));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this.miterLimit=PropertyFactory.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=0!==this.amount.effectsSequence.length},OffsetPathModifier.prototype.processPath=function(e,t,r,n){var i=shapePool.newElement();i.c=e.c;var s,a,o,l=e.length();e.c||(l-=1);var c=[];for(s=0;s<l;s+=1)o=PolynomialBezier.shapeSegment(e,s),c.push(offsetSegmentSplit(o,t));if(!e.c)for(s=l-1;s>=0;s-=1)o=PolynomialBezier.shapeSegmentInverted(e,s),c.push(offsetSegmentSplit(o,t));c=pruneIntersections(c);var h=null,d=null;for(s=0;s<c.length;s+=1){var u=c[s];for(d&&(h=joinLines(i,d,u[0],r,n)),d=u[u.length-1],a=0;a<u.length;a+=1)o=u[a],h&&pointEqual(o.points[0],h)?i.setXYAt(o.points[1][0],o.points[1][1],"o",i.length()-1):i.setTripleAt(o.points[0][0],o.points[0][1],o.points[1][0],o.points[1][1],o.points[0][0],o.points[0][1],i.length()),i.setTripleAt(o.points[3][0],o.points[3][1],o.points[3][0],o.points[3][1],o.points[2][0],o.points[2][1],i.length()),h=o.points[3]}return c.length&&joinLines(i,d,c[0][0],r,n),i},OffsetPathModifier.prototype.processShapes=function(e){var t,r,n,i,s,a,o=this.shapes.length,l=this.amount.v,c=this.miterLimit.v,h=this.lineJoin;if(0!==l)for(r=0;r<o;r+=1){if(a=(s=this.shapes[r]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,n=0;n<i;n+=1)a.addShape(this.processPath(t[n],l,h,c));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var FontManager=function(){var e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var r=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"],n=[65039,8205];function i(e,t){var r=createTag("span");r.setAttribute("aria-hidden",!0),r.style.fontFamily=t;var n=createTag("span");n.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(n),document.body.appendChild(r);var i=n.offsetWidth;return n.style.fontFamily=function(e){var t,r=e.split(","),n=r.length,i=[];for(t=0;t<n;t+=1)"sans-serif"!==r[t]&&"monospace"!==r[t]&&i.push(r[t]);return i.join(",")}(e)+", "+t,{node:n,w:i,parent:r}}function s(e,t){var r,n=document.body&&t?"svg":"canvas",i=getFontProperties(e);if("svg"===n){var s=createNS("text");s.style.fontSize="100px",s.setAttribute("font-family",e.fFamily),s.setAttribute("font-style",i.style),s.setAttribute("font-weight",i.weight),s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.setAttribute("class",e.fClass)):s.style.fontFamily=e.fFamily,t.appendChild(s),r=s}else{var a=new OffscreenCanvas(500,500).getContext("2d");a.font=i.style+" "+i.weight+" 100px "+e.fFamily,r=a}return{measureText:function(e){return"svg"===n?(r.textContent=e,r.getComputedTextLength()):r.measureText(e).width}}}var a=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};a.isModifier=function(e,t){var n=e.toString(16)+t.toString(16);return-1!==r.indexOf(n)},a.isZeroWidthJoiner=function(e,t){return t?e===n[0]&&t===n[1]:e===n[1]},a.isCombinedCharacter=function(e){return-1!==t.indexOf(e)};var o={addChars:function(e){if(e){var t;this.chars||(this.chars=[]);var r,n,i=e.length,s=this.chars.length;for(t=0;t<i;t+=1){for(r=0,n=!1;r<s;)this.chars[r].style===e[t].style&&this.chars[r].fFamily===e[t].fFamily&&this.chars[r].ch===e[t].ch&&(n=!0),r+=1;n||(this.chars.push(e[t]),s+=1)}}},addFonts:function(e,t){if(e){if(this.chars)return this.isLoaded=!0,void(this.fonts=e.list);if(!document.body)return this.isLoaded=!0,e.list.forEach((function(e){e.helper=s(e),e.cache={}})),void(this.fonts=e.list);var r,n=e.list,a=n.length,o=a;for(r=0;r<a;r+=1){var l,c,h=!0;if(n[r].loaded=!1,n[r].monoCase=i(n[r].fFamily,"monospace"),n[r].sansCase=i(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){if((l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[r].fFamily+'"], style[f-origin="3"][f-family="'+n[r].fFamily+'"]')).length>0&&(h=!1),h){var d=createTag("style");d.setAttribute("f-forigin",n[r].fOrigin),d.setAttribute("f-origin",n[r].origin),d.setAttribute("f-family",n[r].fFamily),d.type="text/css",d.innerText="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",t.appendChild(d)}}else if("g"===n[r].fOrigin||1===n[r].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),c=0;c<l.length;c+=1)-1!==l[c].href.indexOf(n[r].fPath)&&(h=!1);if(h){var u=createTag("link");u.setAttribute("f-forigin",n[r].fOrigin),u.setAttribute("f-origin",n[r].origin),u.type="text/css",u.rel="stylesheet",u.href=n[r].fPath,document.body.appendChild(u)}}else if("t"===n[r].fOrigin||2===n[r].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),c=0;c<l.length;c+=1)n[r].fPath===l[c].src&&(h=!1);if(h){var p=createTag("link");p.setAttribute("f-forigin",n[r].fOrigin),p.setAttribute("f-origin",n[r].origin),p.setAttribute("rel","stylesheet"),p.setAttribute("href",n[r].fPath),t.appendChild(p)}}}else n[r].loaded=!0,o-=1;n[r].helper=s(n[r],t),n[r].cache={},this.fonts.push(n[r])}0===o?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,r,n){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===r&&this.chars[i].fFamily===n)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,r,n)),e},getFontByName:function(e){for(var t=0,r=this.fonts.length;t<r;){if(this.fonts[t].fName===e)return this.fonts[t];t+=1}return this.fonts[0]},measureText:function(e,t,r){var n=this.getFontByName(t),i=e.charCodeAt(0);if(!n.cache[i+1]){var s=n.helper;if(" "===e){var a=s.measureText("|"+e+"|"),o=s.measureText("||");n.cache[i+1]=(a-o)/100}else n.cache[i+1]=s.measureText(e)/100}return n.cache[i+1]*r},checkLoadedFonts:function(){var e,t,r,n=this.fonts.length,i=n;for(e=0;e<n;e+=1)this.fonts[e].loaded?i-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(t=this.fonts[e].monoCase.node,r=this.fonts[e].monoCase.w,t.offsetWidth!==r?(i-=1,this.fonts[e].loaded=!0):(t=this.fonts[e].sansCase.node,r=this.fonts[e].sansCase.w,t.offsetWidth!==r&&(i-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==i&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}};return a.prototype=o,a}();function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){-1===this.renderableComponents.indexOf(e)&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){-1!==this.renderableComponents.indexOf(e)&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(e){return blendModeEnums[e]||""}),blendModeEnums;function SliderEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function AngleEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function ColorEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,1,0,r)}function PointEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,1,0,r)}function LayerIndexEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function MaskIndexEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function CheckboxEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(e,t){var r,n=e.ef||[];this.effectElements=[];var i,s=n.length;for(r=0;r<s;r+=1)i=new GroupEffect(n[r],t),this.effectElements.push(i)}function GroupEffect(e,t){this.init(e,t)}function BaseElement(){}function FrameElement(){}function FootageElement(e,t,r){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.footageData=t.imageLoader.getAsset(this.assetData),this.initBaseData(e,t,r)}function AudioElement(e,t,r){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.initBaseData(e,t,r),this._isPlaying=!1,this._canPlay=!1;var n=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(n),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,e.au&&e.au.lv?e.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}function TransformElement(){}function MaskElement(e,t,r){this.data=e,this.element=t,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var n,i,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var o,l,c,h,d,u,p=this.masksProperties,f=0,m=[],g=createElementID(),y="clipPath",v="clip-path";for(n=0;n<a;n+=1)if(("a"!==p[n].mode&&"n"!==p[n].mode||p[n].inv||100!==p[n].o.k||p[n].o.x)&&(y="mask",v="mask"),"s"!==p[n].mode&&"i"!==p[n].mode||0!==f?c=null:((c=createNS("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),m.push(c)),i=createNS("path"),"n"===p[n].mode)this.viewData[n]={op:PropertyFactory.getProp(this.element,p[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[n],3),elem:i,lastPath:""},s.appendChild(i);else{var b;if(f+=1,i.setAttribute("fill","s"===p[n].mode?"#000000":"#ffffff"),i.setAttribute("clip-rule","nonzero"),0!==p[n].x.k?(y="mask",v="mask",u=PropertyFactory.getProp(this.element,p[n].x,0,null,this.element),b=createElementID(),(h=createNS("filter")).setAttribute("id",b),(d=createNS("feMorphology")).setAttribute("operator","erode"),d.setAttribute("in","SourceGraphic"),d.setAttribute("radius","0"),h.appendChild(d),s.appendChild(h),i.setAttribute("stroke","s"===p[n].mode?"#000000":"#ffffff")):(d=null,u=null),this.storedData[n]={elem:i,x:u,expan:d,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===p[n].mode){l=m.length;var S=createNS("g");for(o=0;o<l;o+=1)S.appendChild(m[o]);var E=createNS("mask");E.setAttribute("mask-type","alpha"),E.setAttribute("id",g+"_"+f),E.appendChild(i),s.appendChild(E),S.setAttribute("mask","url("+getLocationHref()+"#"+g+"_"+f+")"),m.length=0,m.push(S)}else m.push(i);p[n].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[n]={elem:i,lastPath:"",op:PropertyFactory.getProp(this.element,p[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[n],3),invRect:c},this.viewData[n].prop.k||this.drawPath(p[n],this.viewData[n].prop.v,this.viewData[n])}for(this.maskElement=createNS(y),a=m.length,n=0;n<a;n+=1)this.maskElement.appendChild(m[n]);f>0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+getLocationHref()+"#"+g+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(e,t){var r;this.data=e,this.effectElements=[],this.initDynamicPropertyContainer(t);var n,i=this.data.ef.length,s=this.data.ef;for(r=0;r<i;r+=1){switch(n=null,s[r].ty){case 0:n=new SliderEffect(s[r],t,this);break;case 1:n=new AngleEffect(s[r],t,this);break;case 2:n=new ColorEffect(s[r],t,this);break;case 3:n=new PointEffect(s[r],t,this);break;case 4:case 7:n=new CheckboxEffect(s[r],t,this);break;case 10:n=new LayerIndexEffect(s[r],t,this);break;case 11:n=new MaskIndexEffect(s[r],t,this);break;case 5:n=new EffectsManager(s[r],t);break;default:n=new NoValueEffect(s[r])}n&&this.effectElements.push(n)}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if("n"!==this.data.masksProperties[e].mode&&!1!==this.data.masksProperties[e].cl)return!0;e+=1}return!1},initExpressions:function(){var e=getExpressionInterfaces();if(e){var t=e("layer"),r=e("effects"),n=e("shape"),i=e("text"),s=e("comp");this.layerInterface=t(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var a=r.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(a),0===this.data.ty||this.data.xt?this.compInterface=s(this):4===this.data.ty?(this.layerInterface.shapeInterface=n(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=i(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var e=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=e},initBaseData:function(e,t,r){this.globalData=t,this.comp=r,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var r,n=this.dynamicProperties.length;for(r=0;r<n;r+=1)(t||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&this.dynamicProperties.push(e)}},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var e=getExpressionInterfaces();if(e){var t=e("footage");this.layerInterface=t(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(e){if(this.prepareRenderableFrame(e,!0),this.prepareProperties(e,!0),this.tm._placeholder)this._currentTime=e/this.data.sr;else{var t=this.tm.v;this._currentTime=t}this._volume=this.lv.v[0];var r=this._volume*this._volumeMultiplier;this._previousVolume!==r&&(this._previousVolume=r,this.audio.volume(r))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(e){var t,r,n=this.layers.length;for(this.completeLayers=!0,t=n-1;t>=0;t-=1)this.elements[t]||(r=this.layers[t]).ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:default:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.buildItem(e);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(e){var t;this.completeLayers=!1;var r,n=e.length,i=this.layers.length;for(t=0;t<n;t+=1)for(r=0;r<i;){if(this.layers[r].id===e[t].id){this.layers[r]=e[t];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(e){this.globalData.projectInterface=e},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(e,t,r){for(var n=this.elements,i=this.layers,s=0,a=i.length;s<a;)i[s].ind==t&&(n[s]&&!0!==n[s]?(r.push(n[s]),n[s].setAsParent(),void 0!==i[s].parent?this.buildElementParenting(e,i[s].parent,r):e.setHierarchy(r)):(this.buildItem(s),this.addPendingElement(e))),s+=1},BaseRenderer.prototype.addPendingElement=function(e){this.pendingElements.push(e)},BaseRenderer.prototype.searchExtraCompositions=function(e){var t,r=e.length;for(t=0;t<r;t+=1)if(e[t].xt){var n=this.createComp(e[t]);n.initExpressions(),this.globalData.projectInterface.registerComposition(n)}},BaseRenderer.prototype.getElementById=function(e){var t,r=this.elements.length;for(t=0;t<r;t+=1)if(this.elements[t].data.ind===e)return this.elements[t];return null},BaseRenderer.prototype.getElementByPath=function(e){var t,r=e.shift();if("number"==typeof r)t=this.elements[r];else{var n,i=this.elements.length;for(n=0;n<i;n+=1)if(this.elements[n].data.nm===r){t=this.elements[n];break}}return 0===e.length?t:t.getElementByPath(e)},BaseRenderer.prototype.setupGlobalData=function(e,t){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(e.chars),this.globalData.fontManager.addFonts(e.fonts,t),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=e.fr,this.globalData.nm=e.nm,this.globalData.compSize={w:e.w,h:e.h}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,r=0,n=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<n;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),r=0;r<n;r+=1)e=this.hierarchy[r].finalTransform.mProp.v.props,t.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var r,n=!0,i=this.comp;n;)i.finalTransform?(i.data.hasMask&&t.splice(0,0,i.finalTransform),i=i.comp):n=!1;var s,a=t.length;for(r=0;r<a;r+=1)s=t[r].mat.applyToPointArray(0,0,0),e=[e[0]-s[0],e[1]-s[1],0];return e},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(e){return this.viewData[e].prop},MaskElement.prototype.renderFrame=function(e){var t,r=this.element.finalTransform.mat,n=this.masksProperties.length;for(t=0;t<n;t+=1)if((this.viewData[t].prop._mdf||e)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||e)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),"n"!==this.masksProperties[t].mode&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||e)&&this.viewData[t].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||e))){var i=this.storedData[t].expan;this.storedData[t].x.v<0?("erode"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),i.setAttribute("radius",-this.storedData[t].x.v)):("dilate"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",2*this.storedData[t].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var e="M0,0 ";return e+=" h"+this.globalData.compSize.w,e+=" v"+this.globalData.compSize.h,e+=" h-"+this.globalData.compSize.w,e+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(e,t,r){var n,i,s=" M"+t.v[0][0]+","+t.v[0][1];for(i=t._length,n=1;n<i;n+=1)s+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[n][0]+","+t.i[n][1]+" "+t.v[n][0]+","+t.v[n][1];if(t.c&&i>1&&(s+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),r.lastPath!==s){var a="";r.elem&&(t.c&&(a=e.inv?this.solidPath+s:s),r.elem.setAttribute("d",a)),r.lastPath=s}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var e={createFilter:function(e,t){var r=createNS("filter");return r.setAttribute("id",e),!0!==t&&(r.setAttribute("filterUnits","objectBoundingBox"),r.setAttribute("x","0%"),r.setAttribute("y","0%"),r.setAttribute("width","100%"),r.setAttribute("height","100%")),r},createAlphaToLuminanceFilter:function(){var e=createNS("feColorMatrix");return e.setAttribute("type","matrix"),e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),e}};return e}(),featureSupport=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),registeredEffects={},idPrefix="filter_result_";function SVGEffects(e){var t,r,n="SourceGraphic",i=e.data.ef?e.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s,!0),o=0;for(this.filters=[],t=0;t<i;t+=1){r=null;var l=e.data.ef[t].ty;registeredEffects[l]&&(r=new(0,registeredEffects[l].effect)(a,e.effectsManager.effectElements[t],e,idPrefix+o,n),n=idPrefix+o,registeredEffects[l].countsAsEffect&&(o+=1)),r&&this.filters.push(r)}o&&(e.globalData.defs.appendChild(a),e.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+s+")")),this.filters.length&&e.addRenderableComponent(this)}function registerEffect(e,t,r){registeredEffects[e]={effect:t,countsAsEffect:r}}function SVGBaseElement(){}function HierarchyElement(){}function RenderableDOMElement(){}function IImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(e,t){this.elem=e,this.pos=t}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(e){var t,r=this.filters.length;for(t=0;t<r;t+=1)this.filters[t].renderFrame(e)},SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e=null;if(this.data.td){this.matteMasks={};var t=createNS("g");t.setAttribute("id",this.layerId),t.appendChild(this.layerElement),e=t,this.globalData.defs.appendChild(t)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),e=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var r=createNS("clipPath"),n=createNS("path");n.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var i=createElementID();if(r.setAttribute("id",i),r.appendChild(n),this.globalData.defs.appendChild(r),this.checkMasks()){var s=createNS("g");s.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),s.appendChild(this.layerElement),this.transformedElement=s,e?e.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},getMatte:function(e){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[e]){var t,r,n,i,s=this.layerId+"_"+e;if(1===e||3===e){var a=createNS("mask");a.setAttribute("id",s),a.setAttribute("mask-type",3===e?"luminance":"alpha"),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),a.appendChild(n),this.globalData.defs.appendChild(a),featureSupport.maskType||1!==e||(a.setAttribute("mask-type","luminance"),t=createElementID(),r=filtersFactory.createFilter(t),this.globalData.defs.appendChild(r),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(i=createNS("g")).appendChild(n),a.appendChild(i),i.setAttribute("filter","url("+getLocationHref()+"#"+t+")"))}else if(2===e){var o=createNS("mask");o.setAttribute("id",s),o.setAttribute("mask-type","alpha");var l=createNS("g");o.appendChild(l),t=createElementID(),r=filtersFactory.createFilter(t);var c=createNS("feComponentTransfer");c.setAttribute("in","SourceGraphic"),r.appendChild(c);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),c.appendChild(h),this.globalData.defs.appendChild(r);var d=createNS("rect");d.setAttribute("width",this.comp.data.w),d.setAttribute("height",this.comp.data.h),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("fill","#ffffff"),d.setAttribute("opacity","0"),l.setAttribute("filter","url("+getLocationHref()+"#"+t+")"),l.appendChild(d),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(n),featureSupport.maskType||(o.setAttribute("mask-type","luminance"),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),l.appendChild(d),i.appendChild(this.layerElement),l.appendChild(i)),this.globalData.defs.appendChild(o)}this.matteMasks[e]=s}return this.matteMasks[e]},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initTransform(e,t,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function(e){var t,r=this.shapeModifiers.length;for(t=0;t<r;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=this.shapeModifiers.length;0<t;)if(this.shapeModifiers[0].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();for(e=(t=this.shapeModifiers.length)-1;e>=0&&!this.shapeModifiers[e].processShapes(this._isFirstFrame);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,r=0,n=t.length;r<n;){if(t[r].elem===e)return t[r].pos;r+=1}return 0},addProcessedElement:function(e,t){for(var r=this.processedElements,n=r.length;n;)if(r[n-=1].elem===e)return void(r[n].pos=t);r.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(e,t,r){this.caches=[],this.styles=[],this.transformers=e,this.lStr="",this.sh=r,this.lvl=t,this._isAnimated=!!r.k;for(var n=0,i=e.length;n<i;){if(e[n].mProps.dynamicProperties.length){this._isAnimated=!0;break}n+=1}}function SVGStyleData(e,t){this.data=e,this.type=e.ty,this.d="",this.lvl=t,this._mdf=!1,this.closed=!0===e.hd,this.pElem=createNS("path"),this.msElem=null}function DashProperty(e,t,r,n){var i;this.elem=e,this.frameId=-1,this.dataProps=createSizedArray(t.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",t.length?t.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(n);var s,a=t.length||0;for(i=0;i<a;i+=1)s=PropertyFactory.getProp(e,t[i].v,0,0,this),this.k=s.k||this.k,this.dataProps[i]={n:t[i].n,p:s};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=r}function SVGNoStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.style=r}function GradientProperty(e,t,r){this.data=t,this.c=createTypedArray("uint8c",4*t.p);var n=t.k.k[0].s?t.k.k[0].s.length-4*t.p:t.k.k.length-4*t.p;this.o=createTypedArray("float32",n),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=n,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(e,t.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.initGradientData(e,t,r)}function SVGGradientStrokeStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.initGradientData(e,t,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(e,t,r){this.transform={mProps:e,op:t,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(e){if((this.elem.globalData.frameId!==this.frameId||e)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||e,this._mdf)){var t=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),t=0;t<r;t+=1)"o"!==this.dataProps[t].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[t].p.v:this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(e,t){for(var r=0,n=this.o.length/2;r<n;){if(Math.abs(e[4*r]-e[4*t+2*r])>.01)return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e<t;){if(!this.comparePoints(this.data.k.k[e].s,this.data.p))return!1;e+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(e){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||e){var t,r,n,i=4*this.data.p;for(t=0;t<i;t+=1)r=t%4==0?100:255,n=Math.round(this.prop.v[t]*r),this.c[t]!==n&&(this.c[t]=n,this._cmdf=!e);if(this.o.length)for(i=this.prop.v.length,t=4*this.data.p;t<i;t+=1)r=t%2==0?100:1,n=t%2==0?Math.round(100*this.prop.v[t]):this.prop.v[t],this.o[t-4*this.data.p]!==n&&(this.o[t-4*this.data.p]=n,this._omdf=!e);this._mdf=!e}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(e,t,r){this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.s=PropertyFactory.getProp(e,t.s,1,null,this),this.e=PropertyFactory.getProp(e,t.e,1,null,this),this.h=PropertyFactory.getProp(e,t.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(e,t.a||{k:0},0,degToRads,this),this.g=new GradientProperty(e,t.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,t),this.setGradientOpacity(t,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(e,t){var r=createElementID(),n=createNS(1===t.t?"linearGradient":"radialGradient");n.setAttribute("id",r),n.setAttribute("spreadMethod","pad"),n.setAttribute("gradientUnits","userSpaceOnUse");var i,s,a,o=[];for(a=4*t.g.p,s=0;s<a;s+=4)i=createNS("stop"),n.appendChild(i),o.push(i);e.setAttribute("gf"===t.ty?"fill":"stroke","url("+getLocationHref()+"#"+r+")"),this.gf=n,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(e,t){if(this.g._hasOpacity&&!this.g._collapsable){var r,n,i,s=createNS("mask"),a=createNS("path");s.appendChild(a);var o=createElementID(),l=createElementID();s.setAttribute("id",l);var c=createNS(1===e.t?"linearGradient":"radialGradient");c.setAttribute("id",o),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),i=e.g.k.k[0].s?e.g.k.k[0].s.length:e.g.k.k.length;var h=this.stops;for(n=4*e.g.p;n<i;n+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(r),h.push(r);a.setAttribute("gf"===e.ty?"fill":"stroke","url("+getLocationHref()+"#"+o+")"),"gs"===e.ty&&(a.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),a.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),1===e.lj&&a.setAttribute("stroke-miterlimit",e.ml)),this.of=c,this.ms=s,this.ost=h,this.maskId=l,t.msElem=a}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var buildShapeString=function(e,t,r,n){if(0===t)return"";var i,s=e.o,a=e.i,o=e.v,l=" M"+n.applyToPointStringified(o[0][0],o[0][1]);for(i=1;i<t;i+=1)l+=" C"+n.applyToPointStringified(s[i-1][0],s[i-1][1])+" "+n.applyToPointStringified(a[i][0],a[i][1])+" "+n.applyToPointStringified(o[i][0],o[i][1]);return r&&t&&(l+=" C"+n.applyToPointStringified(s[i-1][0],s[i-1][1])+" "+n.applyToPointStringified(a[0][0],a[0][1])+" "+n.applyToPointStringified(o[0][0],o[0][1]),l+="z"),l},SVGElementsRenderer=function(){var e=new Matrix,t=new Matrix,r={createRenderFunction:function(e){switch(e.ty){case"fl":return a;case"gf":return l;case"gs":return o;case"st":return c;case"sh":case"el":case"rc":case"sr":return s;case"tr":return n;case"no":return i;default:return null}}};function n(e,t,r){(r||t.transform.op._mdf)&&t.transform.container.setAttribute("opacity",t.transform.op.v),(r||t.transform.mProps._mdf)&&t.transform.container.setAttribute("transform",t.transform.mProps.v.to2dCSS())}function i(){}function s(r,n,i){var s,a,o,l,c,h,d,u,p,f,m,g=n.styles.length,y=n.lvl;for(h=0;h<g;h+=1){if(l=n.sh._mdf||i,n.styles[h].lvl<y){for(u=t.reset(),f=y-n.styles[h].lvl,m=n.transformers.length-1;!l&&f>0;)l=n.transformers[m].mProps._mdf||l,f-=1,m-=1;if(l)for(f=y-n.styles[h].lvl,m=n.transformers.length-1;f>0;)p=n.transformers[m].mProps.v.props,u.transform(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]),f-=1,m-=1}else u=e;if(a=(d=n.sh.paths)._length,l){for(o="",s=0;s<a;s+=1)(c=d.shapes[s])&&c._length&&(o+=buildShapeString(c,c._length,c.c,u));n.caches[h]=o}else o=n.caches[h];n.styles[h].d+=!0===r.hd?"":o,n.styles[h]._mdf=l||n.styles[h]._mdf}}function a(e,t,r){var n=t.style;(t.c._mdf||r)&&n.pElem.setAttribute("fill","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r)&&n.pElem.setAttribute("fill-opacity",t.o.v)}function o(e,t,r){l(e,t,r),c(0,t,r)}function l(e,t,r){var n,i,s,a,o,l=t.gf,c=t.g._hasOpacity,h=t.s.v,d=t.e.v;if(t.o._mdf||r){var u="gf"===e.ty?"fill-opacity":"stroke-opacity";t.style.pElem.setAttribute(u,t.o.v)}if(t.s._mdf||r){var p=1===e.t?"x1":"cx",f="x1"===p?"y1":"cy";l.setAttribute(p,h[0]),l.setAttribute(f,h[1]),c&&!t.g._collapsable&&(t.of.setAttribute(p,h[0]),t.of.setAttribute(f,h[1]))}if(t.g._cmdf||r){n=t.cst;var m=t.g.c;for(s=n.length,i=0;i<s;i+=1)(a=n[i]).setAttribute("offset",m[4*i]+"%"),a.setAttribute("stop-color","rgb("+m[4*i+1]+","+m[4*i+2]+","+m[4*i+3]+")")}if(c&&(t.g._omdf||r)){var g=t.g.o;for(s=(n=t.g._collapsable?t.cst:t.ost).length,i=0;i<s;i+=1)a=n[i],t.g._collapsable||a.setAttribute("offset",g[2*i]+"%"),a.setAttribute("stop-opacity",g[2*i+1])}if(1===e.t)(t.e._mdf||r)&&(l.setAttribute("x2",d[0]),l.setAttribute("y2",d[1]),c&&!t.g._collapsable&&(t.of.setAttribute("x2",d[0]),t.of.setAttribute("y2",d[1])));else if((t.s._mdf||t.e._mdf||r)&&(o=Math.sqrt(Math.pow(h[0]-d[0],2)+Math.pow(h[1]-d[1],2)),l.setAttribute("r",o),c&&!t.g._collapsable&&t.of.setAttribute("r",o)),t.e._mdf||t.h._mdf||t.a._mdf||r){o||(o=Math.sqrt(Math.pow(h[0]-d[0],2)+Math.pow(h[1]-d[1],2)));var y=Math.atan2(d[1]-h[1],d[0]-h[0]),v=t.h.v;v>=1?v=.99:v<=-1&&(v=-.99);var b=o*v,S=Math.cos(y+t.a.v)*b+h[0],E=Math.sin(y+t.a.v)*b+h[1];l.setAttribute("fx",S),l.setAttribute("fy",E),c&&!t.g._collapsable&&(t.of.setAttribute("fx",S),t.of.setAttribute("fy",E))}}function c(e,t,r){var n=t.style,i=t.d;i&&(i._mdf||r)&&i.dashStr&&(n.pElem.setAttribute("stroke-dasharray",i.dashStr),n.pElem.setAttribute("stroke-dashoffset",i.dashoffset[0])),t.c&&(t.c._mdf||r)&&n.pElem.setAttribute("stroke","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r)&&n.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||r)&&(n.pElem.setAttribute("stroke-width",t.w.v),n.msElem&&n.msElem.setAttribute("stroke-width",t.w.v))}return r}();function SVGShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,r),this.prevViewData=[]}function LetterProps(e,t,r,n,i,s){this.o=e,this.sw=t,this.sc=r,this.fc=n,this.m=i,this.p=s,this._mdf={o:!0,sw:!!t,sc:!!r,fc:!!n,m:!0,p:!0}}function TextProperty(e,t){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=t,this.elem=e,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t,r,n,i=this.shapes.length,s=this.stylesList.length,a=[],o=!1;for(r=0;r<s;r+=1){for(n=this.stylesList[r],o=!1,a.length=0,e=0;e<i;e+=1)-1!==(t=this.shapes[e]).styles.indexOf(n)&&(a.push(t),o=t._isAnimated||o);a.length>1&&o&&this.setShapesAsAnimated(a)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(e,t){var r,n=new SVGStyleData(e,t),i=n.pElem;return"st"===e.ty?r=new SVGStrokeStyleData(this,e,n):"fl"===e.ty?r=new SVGFillStyleData(this,e,n):"gf"===e.ty||"gs"===e.ty?(r=new("gf"===e.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,e,n),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),i.setAttribute("mask","url("+getLocationHref()+"#"+r.maskId+")"))):"no"===e.ty&&(r=new SVGNoStyleData(this,e,n)),"st"!==e.ty&&"gs"!==e.ty||(i.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),i.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),i.setAttribute("fill-opacity","0"),1===e.lj&&i.setAttribute("stroke-miterlimit",e.ml)),2===e.r&&i.setAttribute("fill-rule","evenodd"),e.ln&&i.setAttribute("id",e.ln),e.cl&&i.setAttribute("class",e.cl),e.bm&&(i.style["mix-blend-mode"]=getBlendMode(e.bm)),this.stylesList.push(n),this.addToAnimatedContents(e,r),r},SVGShapeElement.prototype.createGroupElement=function(e){var t=new ShapeGroupData;return e.ln&&t.gr.setAttribute("id",e.ln),e.cl&&t.gr.setAttribute("class",e.cl),e.bm&&(t.gr.style["mix-blend-mode"]=getBlendMode(e.bm)),t},SVGShapeElement.prototype.createTransformElement=function(e,t){var r=TransformPropertyFactory.getTransformProperty(this,e,this),n=new SVGTransformData(r,r.o,t);return this.addToAnimatedContents(e,n),n},SVGShapeElement.prototype.createShapeElement=function(e,t,r){var n=4;"rc"===e.ty?n=5:"el"===e.ty?n=6:"sr"===e.ty&&(n=7);var i=new SVGShapeData(t,r,ShapePropertyFactory.getShapeProp(this,e,n,this));return this.shapes.push(i),this.addShapeToModifiers(i),this.addToAnimatedContents(e,i),i},SVGShapeElement.prototype.addToAnimatedContents=function(e,t){for(var r=0,n=this.animatedContents.length;r<n;){if(this.animatedContents[r].element===t)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(e),element:t,data:e})},SVGShapeElement.prototype.setElementStyles=function(e){var t,r=e.styles,n=this.stylesList.length;for(t=0;t<n;t+=1)this.stylesList[t].closed||r.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(e,t,r,n,i,s,a){var o,l,c,h,d,u,p=[].concat(s),f=e.length-1,m=[],g=[];for(o=f;o>=0;o-=1){if((u=this.searchProcessedElement(e[o]))?t[o]=r[u-1]:e[o]._render=a,"fl"===e[o].ty||"st"===e[o].ty||"gf"===e[o].ty||"gs"===e[o].ty||"no"===e[o].ty)u?t[o].style.closed=!1:t[o]=this.createStyleElement(e[o],i),e[o]._render&&t[o].style.pElem.parentNode!==n&&n.appendChild(t[o].style.pElem),m.push(t[o].style);else if("gr"===e[o].ty){if(u)for(c=t[o].it.length,l=0;l<c;l+=1)t[o].prevViewData[l]=t[o].it[l];else t[o]=this.createGroupElement(e[o]);this.searchShapes(e[o].it,t[o].it,t[o].prevViewData,t[o].gr,i+1,p,a),e[o]._render&&t[o].gr.parentNode!==n&&n.appendChild(t[o].gr)}else"tr"===e[o].ty?(u||(t[o]=this.createTransformElement(e[o],n)),h=t[o].transform,p.push(h)):"sh"===e[o].ty||"rc"===e[o].ty||"el"===e[o].ty||"sr"===e[o].ty?(u||(t[o]=this.createShapeElement(e[o],p,i)),this.setElementStyles(t[o])):"tm"===e[o].ty||"rd"===e[o].ty||"ms"===e[o].ty||"pb"===e[o].ty||"zz"===e[o].ty||"op"===e[o].ty?(u?(d=t[o]).closed=!1:((d=ShapeModifiers.getModifier(e[o].ty)).init(this,e[o]),t[o]=d,this.shapeModifiers.push(d)),g.push(d)):"rp"===e[o].ty&&(u?(d=t[o]).closed=!0:(d=ShapeModifiers.getModifier(e[o].ty),t[o]=d,d.init(this,e,o,t),this.shapeModifiers.push(d),a=!1),g.push(d));this.addProcessedElement(e[o],o+1)}for(f=m.length,o=0;o<f;o+=1)m[o].closed=!0;for(f=g.length,o=0;o<f;o+=1)g[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var e;this.renderModifiers();var t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].reset();for(this.renderShape(),e=0;e<t;e+=1)(this.stylesList[e]._mdf||this._isFirstFrame)&&(this.stylesList[e].msElem&&(this.stylesList[e].msElem.setAttribute("d",this.stylesList[e].d),this.stylesList[e].d="M0 0"+this.stylesList[e].d),this.stylesList[e].pElem.setAttribute("d",this.stylesList[e].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var e,t,r=this.animatedContents.length;for(e=0;e<r;e+=1)t=this.animatedContents[e],(this._isFirstFrame||t.element._isAnimated)&&!0!==t.data&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(e,t,r,n,i,s){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var a=!1;return this.o!==e&&(this.o=e,this._mdf.o=!0,a=!0),this.sw!==t&&(this.sw=t,this._mdf.sw=!0,a=!0),this.sc!==r&&(this.sc=r,this._mdf.sc=!0,a=!0),this.fc!==n&&(this.fc=n,this._mdf.fc=!0,a=!0),this.m!==i&&(this.m=i,this._mdf.m=!0,a=!0),!s.length||this.p[0]===s[0]&&this.p[1]===s[1]&&this.p[4]===s[4]&&this.p[5]===s[5]&&this.p[12]===s[12]&&this.p[13]===s[13]||(this.p=s,this._mdf.p=!0,a=!0),a},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},TextProperty.prototype.setCurrentData=function(e){e.__complete||this.completeTextData(e),this.currentData=e,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var n;this.lock=!0,this._mdf=!1;var i=this.effectsSequence.length,s=e||this.data.d.k[this.keysIndex].s;for(n=0;n<i;n+=1)s=r!==this.keysIndex?this.effectsSequence[n](s,s.t):this.effectsSequence[n](this.currentData,s.t);t!==s&&this.setCurrentData(s),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var e=this.data.d.k,t=this.elem.comp.renderedFrame,r=0,n=e.length;r<=n-1&&!(r===n-1||e[r+1].t>t);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,r,n=[],i=0,s=e.length,a=!1;i<s;)t=e.charCodeAt(i),FontManager.isCombinedCharacter(t)?n[n.length-1]+=e.charAt(i):t>=55296&&t<=56319?(r=e.charCodeAt(i+1))>=56320&&r<=57343?(a||FontManager.isModifier(t,r)?(n[n.length-1]+=e.substr(i,2),a=!1):n.push(e.substr(i,2)),i+=1):n.push(e.charAt(i)):t>56319?(r=e.charCodeAt(i+1),FontManager.isZeroWidthJoiner(t,r)?(a=!0,n[n.length-1]+=e.substr(i,2),i+=1):n.push(e.charAt(i))):FontManager.isZeroWidthJoiner(t)?(n[n.length-1]+=e.charAt(i),a=!0):n.push(e.charAt(i)),i+=1;return n},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,r,n,i,s,a,o,l=this.elem.globalData.fontManager,c=this.data,h=[],d=0,u=c.m.g,p=0,f=0,m=0,g=[],y=0,v=0,b=l.getFontByName(e.f),S=0,E=getFontProperties(b);e.fWeight=E.weight,e.fStyle=E.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),r=e.finalText.length,e.finalLineHeight=e.lh;var C,_=e.tr/1e3*e.finalSize;if(e.sz)for(var T,x,P=!0,w=e.sz[0],I=e.sz[1];P;){T=0,y=0,r=(x=this.buildFinalText(e.t)).length,_=e.tr/1e3*e.finalSize;var k=-1;for(t=0;t<r;t+=1)C=x[t].charCodeAt(0),n=!1," "===x[t]?k=t:13!==C&&3!==C||(y=0,n=!0,T+=e.finalLineHeight||1.2*e.finalSize),l.chars?(o=l.getCharData(x[t],b.fStyle,b.fFamily),S=n?0:o.w*e.finalSize/100):S=l.measureText(x[t],e.f,e.finalSize),y+S>w&&" "!==x[t]?(-1===k?r+=1:t=k,T+=e.finalLineHeight||1.2*e.finalSize,x.splice(t,k===t?1:0,"\r"),k=-1,y=0):(y+=S,y+=_);T+=b.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&I<T?(e.finalSize-=1,e.finalLineHeight=e.finalSize*e.lh/e.s):(e.finalText=x,r=e.finalText.length,P=!1)}y=-_,S=0;var A,M=0;for(t=0;t<r;t+=1)if(n=!1,13===(C=(A=e.finalText[t]).charCodeAt(0))||3===C?(M=0,g.push(y),v=y>v?y:v,y=-2*_,i="",n=!0,m+=1):i=A,l.chars?(o=l.getCharData(A,b.fStyle,l.getFontByName(e.f).fFamily),S=n?0:o.w*e.finalSize/100):S=l.measureText(i,e.f,e.finalSize)," "===A?M+=S+_:(y+=S+_+M,M=0),h.push({l:S,an:S,add:p,n:n,anIndexes:[],val:i,line:m,animatorJustifyOffset:0}),2==u){if(p+=S,""===i||" "===i||t===r-1){for(""!==i&&" "!==i||(p-=S);f<=t;)h[f].an=p,h[f].ind=d,h[f].extra=S,f+=1;d+=1,p=0}}else if(3==u){if(p+=S,""===i||t===r-1){for(""===i&&(p-=S);f<=t;)h[f].an=p,h[f].ind=d,h[f].extra=S,f+=1;p=0,d+=1}}else h[d].ind=d,h[d].extra=0,d+=1;if(e.l=h,v=y>v?y:v,g.push(y),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=v,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=g;var R,O,$,D,L=c.a;a=L.length;var F=[];for(s=0;s<a;s+=1){for((R=L[s]).a.sc&&(e.strokeColorAnim=!0),R.a.sw&&(e.strokeWidthAnim=!0),(R.a.fc||R.a.fh||R.a.fs||R.a.fb)&&(e.fillColorAnim=!0),D=0,$=R.s.b,t=0;t<r;t+=1)(O=h[t]).anIndexes[s]=D,(1==$&&""!==O.val||2==$&&""!==O.val&&" "!==O.val||3==$&&(O.n||" "==O.val||t==r-1)||4==$&&(O.n||t==r-1))&&(1===R.s.rn&&F.push(D),D+=1);c.a[s].s.totalChars=D;var N,B=-1;if(1===R.s.rn)for(t=0;t<r;t+=1)B!=(O=h[t]).anIndexes[s]&&(B=O.anIndexes[s],N=F.splice(Math.floor(Math.random()*F.length),1)[0]),O.anIndexes[s]=N}e.yOffset=e.finalLineHeight||1.2*e.finalSize,e.ls=e.ls||0,e.ascent=b.ascent*e.finalSize/100},TextProperty.prototype.updateDocumentData=function(e,t){t=void 0===t?this.keysIndex:t;var r=this.copyData({},this.data.d.k[t].s);r=this.copyData(r,e),this.data.d.k[t].s=r,this.recalculate(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(e){var t=this.data.d.k[e].s;t.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(t)},TextProperty.prototype.canResizeFont=function(e){this.canResize=e,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(e){this.minimumFontSize=Math.floor(e)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var e=Math.max,t=Math.min,r=Math.floor;function n(e,t){this._currentTextLength=-1,this.k=!1,this.data=t,this.elem=e,this.comp=e.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(e),this.s=PropertyFactory.getProp(e,t.s||{k:0},0,0,this),this.e="e"in t?PropertyFactory.getProp(e,t.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(e,t.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(e,t.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(e,t.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(e,t.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(e,t.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return n.prototype={getMult:function(n){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var i=0,s=0,a=1,o=1;this.ne.v>0?i=this.ne.v/100:s=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:o=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(i,s,a,o).get,c=0,h=this.finalS,d=this.finalE,u=this.data.sh;if(2===u)c=l(c=d===h?n>=d?1:0:e(0,t(.5/(d-h)+(n-h)/(d-h),1)));else if(3===u)c=l(c=d===h?n>=d?0:1:1-e(0,t(.5/(d-h)+(n-h)/(d-h),1)));else if(4===u)d===h?c=0:(c=e(0,t(.5/(d-h)+(n-h)/(d-h),1)))<.5?c*=2:c=1-2*(c-.5),c=l(c);else if(5===u){if(d===h)c=0;else{var p=d-h,f=-p/2+(n=t(e(0,n+.5-h),d-h)),m=p/2;c=Math.sqrt(1-f*f/(m*m))}c=l(c)}else 6===u?(d===h?c=0:(n=t(e(0,n+.5-h),d-h),c=(1+Math.cos(Math.PI+2*Math.PI*n/(d-h)))/2),c=l(c)):(n>=r(h)&&(c=e(0,t(n-h<0?t(d,1)-(h-n):d-n,1))),c=l(c));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var y=.5-.5*g;c<y?c=0:(c=(c-y)/g)>1&&(c=1)}return c*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/t,n=this.s.v/t+r,i=this.e.v/t+r;if(n>i){var s=n;n=i,i=s}this.finalS=n,this.finalE=i}},extendPrototype([DynamicPropertyContainer],n),{getTextSelectorProp:function(e,t,r){return new n(e,t)}}}();function TextAnimatorDataProperty(e,t,r){var n={propType:!1},i=PropertyFactory.getProp,s=t.a;this.a={r:s.r?i(e,s.r,0,degToRads,r):n,rx:s.rx?i(e,s.rx,0,degToRads,r):n,ry:s.ry?i(e,s.ry,0,degToRads,r):n,sk:s.sk?i(e,s.sk,0,degToRads,r):n,sa:s.sa?i(e,s.sa,0,degToRads,r):n,s:s.s?i(e,s.s,1,.01,r):n,a:s.a?i(e,s.a,1,0,r):n,o:s.o?i(e,s.o,0,.01,r):n,p:s.p?i(e,s.p,1,0,r):n,sw:s.sw?i(e,s.sw,0,0,r):n,sc:s.sc?i(e,s.sc,1,0,r):n,fc:s.fc?i(e,s.fc,1,0,r):n,fh:s.fh?i(e,s.fh,0,0,r):n,fs:s.fs?i(e,s.fs,0,.01,r):n,fb:s.fb?i(e,s.fb,0,.01,r):n,t:s.t?i(e,s.t,0,0,r):n},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,r),this.s.t=t.s.t}function TextAnimatorProperty(e,t,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var e,t,r=this._textData.a.length,n=PropertyFactory.getProp;for(e=0;e<r;e+=1)t=this._textData.a[e],this._animatorsData[e]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:n(this._elem,this._textData.p.a,0,0,this),f:n(this._elem,this._textData.p.f,0,0,this),l:n(this._elem,this._textData.p.l,0,0,this),r:n(this._elem,this._textData.p.r,0,0,this),p:n(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=n(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(e,t){if(this.lettersChangedFlag=t,this._mdf||this._isFirstFrame||t||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,n,i,s,a,o,l,c,h,d,u,p,f,m,g,y,v,b,S,E=this._moreOptions.alignment.v,C=this._animatorsData,_=this._textData,T=this.mHelper,x=this._renderType,P=this.renderedLetters.length,w=e.l;if(this._hasMaskedPath){if(S=this._pathData.m,!this._pathData.n||this._pathData._mdf){var I,k=S.v;for(this._pathData.r.v&&(k=k.reverse()),a={tLength:0,segments:[]},s=k._length-1,y=0,i=0;i<s;i+=1)I=bez.buildBezierData(k.v[i],k.v[i+1],[k.o[i][0]-k.v[i][0],k.o[i][1]-k.v[i][1]],[k.i[i+1][0]-k.v[i+1][0],k.i[i+1][1]-k.v[i+1][1]]),a.tLength+=I.segmentLength,a.segments.push(I),y+=I.segmentLength;i=s,S.v.c&&(I=bez.buildBezierData(k.v[i],k.v[0],[k.o[i][0]-k.v[i][0],k.o[i][1]-k.v[i][1]],[k.i[0][0]-k.v[0][0],k.i[0][1]-k.v[0][1]]),a.tLength+=I.segmentLength,a.segments.push(I),y+=I.segmentLength),this._pathData.pi=a}if(a=this._pathData.pi,o=this._pathData.f.v,u=0,d=1,c=0,h=!0,m=a.segments,o<0&&S.v.c)for(a.tLength<Math.abs(o)&&(o=-Math.abs(o)%a.tLength),d=(f=m[u=m.length-1].points).length-1;o<0;)o+=f[d].partialLength,(d-=1)<0&&(d=(f=m[u-=1].points).length-1);p=(f=m[u].points)[d-1],g=(l=f[d]).partialLength}s=w.length,r=0,n=0;var A,M,R,O,$,D=1.2*e.finalSize*.714,L=!0;R=C.length;var F,N,B,V,U,z,j,G,H,Z,W,K,Y=-1,q=o,Q=u,X=d,J=-1,ee="",te=this.defaultPropsArray;if(2===e.j||1===e.j){var re=0,ne=0,ie=2===e.j?-.5:-1,se=0,ae=!0;for(i=0;i<s;i+=1)if(w[i].n){for(re&&(re+=ne);se<i;)w[se].animatorJustifyOffset=re,se+=1;re=0,ae=!0}else{for(M=0;M<R;M+=1)(A=C[M].a).t.propType&&(ae&&2===e.j&&(ne+=A.t.v*ie),($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?re+=A.t.v*$[0]*ie:re+=A.t.v*$*ie);ae=!1}for(re&&(re+=ne);se<i;)w[se].animatorJustifyOffset=re,se+=1}for(i=0;i<s;i+=1){if(T.reset(),V=1,w[i].n)r=0,n+=e.yOffset,n+=L?1:0,o=q,L=!1,this._hasMaskedPath&&(d=X,p=(f=m[u=Q].points)[d-1],g=(l=f[d]).partialLength,c=0),ee="",W="",H="",K="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if(J!==w[i].line){switch(e.j){case 1:o+=y-e.lineWidths[w[i].line];break;case 2:o+=(y-e.lineWidths[w[i].line])/2}J=w[i].line}Y!==w[i].ind&&(w[Y]&&(o+=w[Y].extra),o+=w[i].an/2,Y=w[i].ind),o+=E[0]*w[i].an*.005;var oe=0;for(M=0;M<R;M+=1)(A=C[M].a).p.propType&&(($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?oe+=A.p.v[0]*$[0]:oe+=A.p.v[0]*$),A.a.propType&&(($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?oe+=A.a.v[0]*$[0]:oe+=A.a.v[0]*$);for(h=!0,this._pathData.a.v&&(o=.5*w[0].an+(y-this._pathData.f.v-.5*w[0].an-.5*w[w.length-1].an)*Y/(s-1),o+=this._pathData.f.v);h;)c+g>=o+oe||!f?(v=(o+oe-c)/l.partialLength,N=p.point[0]+(l.point[0]-p.point[0])*v,B=p.point[1]+(l.point[1]-p.point[1])*v,T.translate(-E[0]*w[i].an*.005,-E[1]*D*.01),h=!1):f&&(c+=l.partialLength,(d+=1)>=f.length&&(d=0,m[u+=1]?f=m[u].points:S.v.c?(d=0,f=m[u=0].points):(c-=l.partialLength,f=null)),f&&(p=l,g=(l=f[d]).partialLength));F=w[i].an/2-w[i].add,T.translate(-F,0,0)}else F=w[i].an/2-w[i].add,T.translate(-F,0,0),T.translate(-E[0]*w[i].an*.005,-E[1]*D*.01,0);for(M=0;M<R;M+=1)(A=C[M].a).t.propType&&($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars),0===r&&0===e.j||(this._hasMaskedPath?$.length?o+=A.t.v*$[0]:o+=A.t.v*$:$.length?r+=A.t.v*$[0]:r+=A.t.v*$));for(e.strokeWidthAnim&&(z=e.sw||0),e.strokeColorAnim&&(U=e.sc?[e.sc[0],e.sc[1],e.sc[2]]:[0,0,0]),e.fillColorAnim&&e.fc&&(j=[e.fc[0],e.fc[1],e.fc[2]]),M=0;M<R;M+=1)(A=C[M].a).a.propType&&(($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?T.translate(-A.a.v[0]*$[0],-A.a.v[1]*$[1],A.a.v[2]*$[2]):T.translate(-A.a.v[0]*$,-A.a.v[1]*$,A.a.v[2]*$));for(M=0;M<R;M+=1)(A=C[M].a).s.propType&&(($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?T.scale(1+(A.s.v[0]-1)*$[0],1+(A.s.v[1]-1)*$[1],1):T.scale(1+(A.s.v[0]-1)*$,1+(A.s.v[1]-1)*$,1));for(M=0;M<R;M+=1){if(A=C[M].a,$=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars),A.sk.propType&&($.length?T.skewFromAxis(-A.sk.v*$[0],A.sa.v*$[1]):T.skewFromAxis(-A.sk.v*$,A.sa.v*$)),A.r.propType&&($.length?T.rotateZ(-A.r.v*$[2]):T.rotateZ(-A.r.v*$)),A.ry.propType&&($.length?T.rotateY(A.ry.v*$[1]):T.rotateY(A.ry.v*$)),A.rx.propType&&($.length?T.rotateX(A.rx.v*$[0]):T.rotateX(A.rx.v*$)),A.o.propType&&($.length?V+=(A.o.v*$[0]-V)*$[0]:V+=(A.o.v*$-V)*$),e.strokeWidthAnim&&A.sw.propType&&($.length?z+=A.sw.v*$[0]:z+=A.sw.v*$),e.strokeColorAnim&&A.sc.propType)for(G=0;G<3;G+=1)$.length?U[G]+=(A.sc.v[G]-U[G])*$[0]:U[G]+=(A.sc.v[G]-U[G])*$;if(e.fillColorAnim&&e.fc){if(A.fc.propType)for(G=0;G<3;G+=1)$.length?j[G]+=(A.fc.v[G]-j[G])*$[0]:j[G]+=(A.fc.v[G]-j[G])*$;A.fh.propType&&(j=$.length?addHueToRGB(j,A.fh.v*$[0]):addHueToRGB(j,A.fh.v*$)),A.fs.propType&&(j=$.length?addSaturationToRGB(j,A.fs.v*$[0]):addSaturationToRGB(j,A.fs.v*$)),A.fb.propType&&(j=$.length?addBrightnessToRGB(j,A.fb.v*$[0]):addBrightnessToRGB(j,A.fb.v*$))}}for(M=0;M<R;M+=1)(A=C[M].a).p.propType&&($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars),this._hasMaskedPath?$.length?T.translate(0,A.p.v[1]*$[0],-A.p.v[2]*$[1]):T.translate(0,A.p.v[1]*$,-A.p.v[2]*$):$.length?T.translate(A.p.v[0]*$[0],A.p.v[1]*$[1],-A.p.v[2]*$[2]):T.translate(A.p.v[0]*$,A.p.v[1]*$,-A.p.v[2]*$));if(e.strokeWidthAnim&&(H=z<0?0:z),e.strokeColorAnim&&(Z="rgb("+Math.round(255*U[0])+","+Math.round(255*U[1])+","+Math.round(255*U[2])+")"),e.fillColorAnim&&e.fc&&(W="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),this._hasMaskedPath){if(T.translate(0,-e.ls),T.translate(0,E[1]*D*.01+n,0),this._pathData.p.v){b=(l.point[1]-p.point[1])/(l.point[0]-p.point[0]);var le=180*Math.atan(b)/Math.PI;l.point[0]<p.point[0]&&(le+=180),T.rotate(-le*Math.PI/180)}T.translate(N,B,0),o-=E[0]*w[i].an*.005,w[i+1]&&Y!==w[i+1].ind&&(o+=w[i].an/2,o+=.001*e.tr*e.finalSize)}else{switch(T.translate(r,n,0),e.ps&&T.translate(e.ps[0],e.ps[1]+e.ascent,0),e.j){case 1:T.translate(w[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[w[i].line]),0,0);break;case 2:T.translate(w[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[w[i].line])/2,0,0)}T.translate(0,-e.ls),T.translate(F,0,0),T.translate(E[0]*w[i].an*.005,E[1]*D*.01,0),r+=w[i].l+.001*e.tr*e.finalSize}"html"===x?ee=T.toCSS():"svg"===x?ee=T.to2dCSS():te=[T.props[0],T.props[1],T.props[2],T.props[3],T.props[4],T.props[5],T.props[6],T.props[7],T.props[8],T.props[9],T.props[10],T.props[11],T.props[12],T.props[13],T.props[14],T.props[15]],K=V}P<=i?(O=new LetterProps(K,H,Z,W,ee,te),this.renderedLetters.push(O),P+=1,this.lettersChangedFlag=!0):(O=this.renderedLetters[i],this.lettersChangedFlag=O.update(K,H,Z,W,ee,te)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(e,t,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(e,t,r),this.textProperty=new TextProperty(this,e.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(e.t,this.renderType,this),this.initTransform(e,t,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(e,t){var r,n,i=t.length,s="";for(r=0;r<i;r+=1)"sh"===t[r].ty&&(n=t[r].ks.k,s+=buildShapeString(n,n.i.length,!0,e));return s},ITextElement.prototype.updateDocumentData=function(e,t){this.textProperty.updateDocumentData(e,t)},ITextElement.prototype.canResizeFont=function(e){this.textProperty.canResizeFont(e)},ITextElement.prototype.setMinimumFontSize=function(e){this.textProperty.setMinimumFontSize(e)},ITextElement.prototype.applyTextPropertiesToMatrix=function(e,t,r,n,i){switch(e.ps&&t.translate(e.ps[0],e.ps[1]+e.ascent,0),t.translate(0,-e.ls,0),e.j){case 1:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[r]),0,0);break;case 2:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[r])/2,0,0)}t.translate(n,i,0)},ITextElement.prototype.buildColor=function(e){return"rgb("+Math.round(255*e[0])+","+Math.round(255*e[1])+","+Math.round(255*e[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){};var emptyShapeData={shapes:[]};function SVGTextLottieElement(e,t,r){this.textSpans=[],this.renderType="svg",this.initElement(e,t,r)}function ISolidElement(e,t,r){this.initElement(e,t,r)}function NullElement(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initFrame(),this.initTransform(e,t,r),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(e,t,r){this.layers=e.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function SVGRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(t&&t.title){var n=createNS("title"),i=createElementID();n.setAttribute("id",i),n.textContent=t.title,this.svgElement.appendChild(n),r+=i}if(t&&t.description){var s=createNS("desc"),a=createElementID();s.setAttribute("id",a),s.textContent=t.description,this.svgElement.appendChild(s),r+=" "+a}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",progressiveLoad:t&&t.progressiveLoad||!1,hideOnTransparent:!(t&&!1===t.hideOnTransparent),viewBoxOnly:t&&t.viewBoxOnly||!1,viewBoxSize:t&&t.viewBoxSize||!1,className:t&&t.className||"",id:t&&t.id||"",focusable:t&&t.focusable,filterSize:{width:t&&t.filterSize&&t.filterSize.width||"100%",height:t&&t.filterSize&&t.filterSize.height||"100%",x:t&&t.filterSize&&t.filterSize.x||"0%",y:t&&t.filterSize&&t.filterSize.y||"0%"},width:t&&t.width,height:t&&t.height,runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CVContextData(){var e;for(this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1,this.savedOp=createTypedArray("float32",15),e=0;e<15;e+=1)this.saved[e]=createTypedArray("float32",16);this._length=15}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(e){for(var t=0,r=e.length,n=[],i="";t<r;)e[t]===String.fromCharCode(13)||e[t]===String.fromCharCode(3)?(n.push(i),i=""):i+=e[t],t+=1;return n.push(i),n},SVGTextLottieElement.prototype.buildShapeData=function(e,t){if(e.shapes&&e.shapes.length){var r=e.shapes[0];if(r.it){var n=r.it[r.it.length-1];n.s&&(n.s.k[0]=t,n.s.k[1]=t)}}return e},SVGTextLottieElement.prototype.buildNewText=function(){var e,t;this.addDynamicProperty(this);var r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var n=this.globalData.fontManager.getFontByName(r.f);if(n.fClass)this.layerElement.setAttribute("class",n.fClass);else{this.layerElement.setAttribute("font-family",n.fFamily);var i=r.fWeight,s=r.fStyle;this.layerElement.setAttribute("font-style",s),this.layerElement.setAttribute("font-weight",i)}this.layerElement.setAttribute("aria-label",r.t);var a,o=r.l||[],l=!!this.globalData.fontManager.chars;t=o.length;var c=this.mHelper,h=this.data.singleShape,d=0,u=0,p=!0,f=.001*r.tr*r.finalSize;if(!h||l||r.sz){var m,g=this.textSpans.length;for(e=0;e<t;e+=1){if(this.textSpans[e]||(this.textSpans[e]={span:null,childSpan:null,glyph:null}),!l||!h||0===e){if(a=g>e?this.textSpans[e].span:createNS(l?"g":"text"),g<=e){if(a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=a,l){var y=createNS("g");a.appendChild(y),this.textSpans[e].childSpan=y}this.textSpans[e].span=a,this.layerElement.appendChild(a)}a.style.display="inherit"}if(c.reset(),h&&(o[e].n&&(d=-f,u+=r.yOffset,u+=p?1:0,p=!1),this.applyTextPropertiesToMatrix(r,c,o[e].line,d,u),d+=o[e].l||0,d+=f),l){var v;if(1===(m=this.globalData.fontManager.getCharData(r.finalText[e],n.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily)).t)v=new SVGCompElement(m.data,this.globalData,this);else{var b=emptyShapeData;m.data&&m.data.shapes&&(b=this.buildShapeData(m.data,r.finalSize)),v=new SVGShapeElement(b,this.globalData,this)}if(this.textSpans[e].glyph){var S=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(S.layerElement),S.destroy()}this.textSpans[e].glyph=v,v._debug=!0,v.prepareFrame(0),v.renderFrame(),this.textSpans[e].childSpan.appendChild(v.layerElement),1===m.t&&this.textSpans[e].childSpan.setAttribute("transform","scale("+r.finalSize/100+","+r.finalSize/100+")")}else h&&a.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),a.textContent=o[e].val,a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}h&&a&&a.setAttribute("d","")}else{var E=this.textContainer,C="start";switch(r.j){case 1:C="end";break;case 2:C="middle";break;default:C="start"}E.setAttribute("text-anchor",C),E.setAttribute("letter-spacing",f);var _=this.buildTextContents(r.finalText);for(t=_.length,u=r.ps?r.ps[1]+r.ascent:0,e=0;e<t;e+=1)(a=this.textSpans[e].span||createNS("tspan")).textContent=_[e],a.setAttribute("x",0),a.setAttribute("y",u),a.style.display="inherit",E.appendChild(a),this.textSpans[e]||(this.textSpans[e]={span:null,glyph:null}),this.textSpans[e].span=a,u+=r.finalLineHeight;this.layerElement.appendChild(E)}for(;e<this.textSpans.length;)this.textSpans[e].span.style.display="none",e+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var e,t,r=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,e=0;e<r;e+=1)(t=this.textSpans[e].glyph)&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if((!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var e,t;this._sizeChanged=!0;var r,n,i,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(t=a.length,e=0;e<t;e+=1)a[e].n||(r=s[e],n=this.textSpans[e].span,(i=this.textSpans[e].glyph)&&i.renderFrame(),r._mdf.m&&n.setAttribute("transform",r.m),r._mdf.o&&n.setAttribute("opacity",r.o),r._mdf.sw&&n.setAttribute("stroke-width",r.sw),r._mdf.sc&&n.setAttribute("stroke",r.sc),r._mdf.fc&&n.setAttribute("fill",r.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var e=createNS("rect");e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.layerElement.appendChild(e)},NullElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(e){return new NullElement(e,this.globalData,this)},SVGRendererBase.prototype.createShape=function(e){return new SVGShapeElement(e,this.globalData,this)},SVGRendererBase.prototype.createText=function(e){return new SVGTextLottieElement(e,this.globalData,this)},SVGRendererBase.prototype.createImage=function(e){return new IImageElement(e,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(e){return new ISolidElement(e,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(e){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+e.w+" "+e.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",e.w),this.svgElement.setAttribute("height",e.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var t=this.globalData.defs;this.setupGlobalData(e,t),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=e;var r=createNS("clipPath"),n=createNS("rect");n.setAttribute("width",e.w),n.setAttribute("height",e.h),n.setAttribute("x",0),n.setAttribute("y",0);var i=createElementID();r.setAttribute("id",i),r.appendChild(n),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),t.appendChild(r),this.layers=e.layers,this.elements=createSizedArray(e.layers.length)},SVGRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(e){var t=0,r=this.layers.length;for(t=0;t<r;t+=1)if(this.layers[t].ind===e)return t;return-1},SVGRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){t[e]=!0;var r=this.createItem(this.layers[e]);if(t[e]=r,getExpressionsPlugin()&&(0===this.layers[e].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,e),this.layers[e].tt){var n="tp"in this.layers[e]?this.findIndexByInd(this.layers[e].tp):e-1;if(-1===n)return;if(this.elements[n]&&!0!==this.elements[n]){var i=t[n].getMatte(this.layers[e].tt);r.setMatte(i)}else this.buildItem(n),this.addPendingElement(r)}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var e=this.pendingElements.pop();if(e.checkParenting(),e.data.tt)for(var t=0,r=this.elements.length;t<r;){if(this.elements[t]===e){var n="tp"in e.data?this.findIndexByInd(e.data.tp):t-1,i=this.elements[n].getMatte(this.layers[t].tt);e.setMatte(i);break}t+=1}}},SVGRendererBase.prototype.renderFrame=function(e){if(this.renderedFrame!==e&&!this.destroyed){var t;null===e?e=this.renderedFrame:this.renderedFrame=e,this.globalData.frameNum=e,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=e,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(e),t=r-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t<r;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(e,t){var r=e.getBaseElement();if(r){for(var n,i=0;i<t;)this.elements[i]&&!0!==this.elements[i]&&this.elements[i].getBaseElement()&&(n=this.elements[i].getBaseElement()),i+=1;n?this.layerElement.insertBefore(r,n):this.layerElement.appendChild(r)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initTransform(e,t,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&t.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(e){if(this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=e/this.data.sr;else{var t=this.tm.v;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}var r,n=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},ICompElement.prototype.setElements=function(e){this.elements=e},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},CVContextData.prototype.duplicate=function(){var e=2*this._length,t=this.savedOp;this.savedOp=createTypedArray("float32",e),this.savedOp.set(t);var r=0;for(r=this._length;r<e;r+=1)this.saved[r]=createTypedArray("float32",16);this._length=e},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVContextData.prototype.popTransform=function(){var e,t=this.saved[this.cArrPos],r=this.cTr.props;for(e=0;e<16;e+=1)r[e]=t[e];return t},CVContextData.prototype.popOpacity=function(){var e=this.savedOp[this.cArrPos];return this.cO=e,e},CVContextData.prototype.pop=function(){return this.cArrPos-=1,{transform:this.popTransform(),opacity:this.popOpacity()}},CVContextData.prototype.push=function(){var e,t=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var r=this.saved[this.cArrPos];for(e=0;e<16;e+=1)r[e]=t[e];this.savedOp[this.cArrPos]=this.cO,this.cArrPos+=1},CVContextData.prototype.getTransform=function(){return this.cTr},CVContextData.prototype.getOpacity=function(){return this.cO},CVContextData.prototype.setOpacity=function(e){this.cO=e},ShapeTransformManager.prototype={addTransformSequence:function(e){var t,r=e.length,n="_";for(t=0;t<r;t+=1)n+=e[t].transform.key+"_";var i=this.sequences[n];return i||(i={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[n]=i,this.sequenceList.push(i)),i},processSequence:function(e,t){for(var r,n=0,i=e.transforms.length,s=t;n<i&&!t;){if(e.transforms[n].transform.mProps._mdf){s=!0;break}n+=1}if(s)for(e.finalTransform.reset(),n=i-1;n>=0;n-=1)r=e.transforms[n].transform.mProps.v.props,e.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);e._mdf=s},processSequences:function(e){var t,r=this.sequenceList.length;for(t=0;t<r;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var e="__lottie_element_luma_buffer",t=null,r=null,n=null;function i(){var i,s,a;t||(i=createNS("svg"),s=createNS("filter"),a=createNS("feColorMatrix"),s.setAttribute("id",e),a.setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),s.appendChild(a),i.appendChild(s),i.setAttribute("id",e+"_svg"),featureSupport.svgLumaHidden&&(i.style.display="none"),n=i,document.body.appendChild(n),t=createTag("canvas"),(r=t.getContext("2d")).filter="url(#"+e+")",r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1))}return{load:i,get:function(n){return t||i(),t.width=n.width,t.height=n.height,r.filter="url(#"+e+")",t}}};function createCanvas(e,t){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(e,t);var r=createTag("canvas");return r.width=e,r.height=t,r}var assetLoader={loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas:createCanvas};function CVEffects(){}function CVMaskElement(e,t){var r;this.data=e,this.element=t,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var n=this.masksProperties.length,i=!1;for(r=0;r<n;r+=1)"n"!==this.masksProperties[r].mode&&(i=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}function CVBaseElement(){}CVEffects.prototype.renderFrame=function(){},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var e,t,r,n,i=this.element.finalTransform.mat,s=this.element.canvasContext,a=this.masksProperties.length;for(s.beginPath(),e=0;e<a;e+=1)if("n"!==this.masksProperties[e].mode){var o;this.masksProperties[e].inv&&(s.moveTo(0,0),s.lineTo(this.element.globalData.compSize.w,0),s.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),s.lineTo(0,this.element.globalData.compSize.h),s.lineTo(0,0)),n=this.viewData[e].v,t=i.applyToPointArray(n.v[0][0],n.v[0][1],0),s.moveTo(t[0],t[1]);var l=n._length;for(o=1;o<l;o+=1)r=i.applyToTriplePoints(n.o[o-1],n.i[o],n.v[o]),s.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=i.applyToTriplePoints(n.o[o-1],n.i[0],n.v[0]),s.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),s.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};function CVShapeData(e,t,r,n){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i,s=4;"rc"===t.ty?s=5:"el"===t.ty?s=6:"sr"===t.ty&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,s,e);var a,o=r.length;for(i=0;i<o;i+=1)r[i].closed||(a={transforms:n.addTransformSequence(r[i].transforms),trNodes:[]},this.styledShapes.push(a),r[i].elements.push(a))}function CVShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(e,t,r)}function CVTextElement(e,t,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(e,t,r)}function CVImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.img=t.imageLoader.getAsset(this.assetData),this.initElement(e,t,r)}function CVSolidElement(e,t,r){this.initElement(e,t,r)}function CanvasRendererBase(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||""},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function CVCompElement(e,t,r){this.completeLayers=!1,this.layers=e.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function CanvasRenderer(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||"",runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function HBaseElement(){}function HSolidElement(e,t,r){this.initElement(e,t,r)}function HShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(e,t,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(e,t,r){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(e,t,r)}function HCameraElement(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initHierarchy();var n=PropertyFactory.getProp;if(this.pe=n(this,e.pe,0,0,this),e.ks.p.s?(this.px=n(this,e.ks.p.x,1,0,this),this.py=n(this,e.ks.p.y,1,0,this),this.pz=n(this,e.ks.p.z,1,0,this)):this.p=n(this,e.ks.p,1,0,this),e.ks.a&&(this.a=n(this,e.ks.a,1,0,this)),e.ks.or.k.length&&e.ks.or.k[0].to){var i,s=e.ks.or.k.length;for(i=0;i<s;i+=1)e.ks.or.k[i].to=null,e.ks.or.k[i].ti=null}this.or=n(this,e.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=n(this,e.ks.rx,0,degToRads,this),this.ry=n(this,e.ks.ry,0,degToRads,this),this.rz=n(this,e.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,r)}function HybridRendererBase(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function HCompElement(e,t,r){this.layers=e.layers,this.supports3d=!e.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function HybridRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"},runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var e=this.globalData.canvasContext,t=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var r=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(r),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext("2d");if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var r=assetLoader.getLumaCanvas(this.canvasContext.canvas);r.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(r,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||e)){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(e,t){var r={data:e,type:e.ty,preTransforms:this.transformsManager.addTransformSequence(t),transforms:[],elements:[],closed:!0===e.hd},n={};if("fl"===e.ty||"st"===e.ty?(n.c=PropertyFactory.getProp(this,e.c,1,255,this),n.c.k||(r.co="rgb("+bmFloor(n.c.v[0])+","+bmFloor(n.c.v[1])+","+bmFloor(n.c.v[2])+")")):"gf"!==e.ty&&"gs"!==e.ty||(n.s=PropertyFactory.getProp(this,e.s,1,null,this),n.e=PropertyFactory.getProp(this,e.e,1,null,this),n.h=PropertyFactory.getProp(this,e.h||{k:0},0,.01,this),n.a=PropertyFactory.getProp(this,e.a||{k:0},0,degToRads,this),n.g=new GradientProperty(this,e.g,this)),n.o=PropertyFactory.getProp(this,e.o,0,.01,this),"st"===e.ty||"gs"===e.ty){if(r.lc=lineCapEnum[e.lc||2],r.lj=lineJoinEnum[e.lj||2],1==e.lj&&(r.ml=e.ml),n.w=PropertyFactory.getProp(this,e.w,0,null,this),n.w.k||(r.wi=n.w.v),e.d){var i=new DashProperty(this,e.d,"canvas",this);n.d=i,n.d.k||(r.da=n.d.dashArray,r.do=n.d.dashoffset[0])}}else r.r=2===e.r?"evenodd":"nonzero";return this.stylesList.push(r),n.style=r,n},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(e){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,e.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,e,this)}}},CVShapeElement.prototype.createShapeElement=function(e){var t=new CVShapeData(this,e,this.stylesList,this.transformsManager);return this.shapes.push(t),this.addShapeToModifiers(t),t},CVShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(e){var t,r=this.stylesList.length;for(t=0;t<r;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.push(e)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.pop()},CVShapeElement.prototype.closeStyles=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t].closed=!0},CVShapeElement.prototype.searchShapes=function(e,t,r,n,i){var s,a,o,l,c,h,d=e.length-1,u=[],p=[],f=[].concat(i);for(s=d;s>=0;s-=1){if((l=this.searchProcessedElement(e[s]))?t[s]=r[l-1]:e[s]._shouldRender=n,"fl"===e[s].ty||"st"===e[s].ty||"gf"===e[s].ty||"gs"===e[s].ty)l?t[s].style.closed=!1:t[s]=this.createStyleElement(e[s],f),u.push(t[s].style);else if("gr"===e[s].ty){if(l)for(o=t[s].it.length,a=0;a<o;a+=1)t[s].prevViewData[a]=t[s].it[a];else t[s]=this.createGroupElement(e[s]);this.searchShapes(e[s].it,t[s].it,t[s].prevViewData,n,f)}else"tr"===e[s].ty?(l||(h=this.createTransformElement(e[s]),t[s]=h),f.push(t[s]),this.addTransformToStyleList(t[s])):"sh"===e[s].ty||"rc"===e[s].ty||"el"===e[s].ty||"sr"===e[s].ty?l||(t[s]=this.createShapeElement(e[s])):"tm"===e[s].ty||"rd"===e[s].ty||"pb"===e[s].ty||"zz"===e[s].ty||"op"===e[s].ty?(l?(c=t[s]).closed=!1:((c=ShapeModifiers.getModifier(e[s].ty)).init(this,e[s]),t[s]=c,this.shapeModifiers.push(c)),p.push(c)):"rp"===e[s].ty&&(l?(c=t[s]).closed=!0:(c=ShapeModifiers.getModifier(e[s].ty),t[s]=c,c.init(this,e,s,t),this.shapeModifiers.push(c),n=!1),p.push(c));this.addProcessedElement(e[s],s+1)}for(this.removeTransformFromStyleList(),this.closeStyles(u),d=p.length,s=0;s<d;s+=1)p[s].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(e,t){(e._opMdf||t.op._mdf||this._isFirstFrame)&&(t.opacity=e.opacity,t.opacity*=t.op.v,t._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var e,t,r,n,i,s,a,o,l,c=this.stylesList.length,h=this.globalData.renderer,d=this.globalData.canvasContext;for(e=0;e<c;e+=1)if(("st"!==(o=(l=this.stylesList[e]).type)&&"gs"!==o||0!==l.wi)&&l.data._shouldRender&&0!==l.coOp&&0!==this.globalData.currentGlobalAlpha){for(h.save(),s=l.elements,"st"===o||"gs"===o?(d.strokeStyle="st"===o?l.co:l.grd,d.lineWidth=l.wi,d.lineCap=l.lc,d.lineJoin=l.lj,d.miterLimit=l.ml||0):d.fillStyle="fl"===o?l.co:l.grd,h.ctxOpacity(l.coOp),"st"!==o&&"gs"!==o&&d.beginPath(),h.ctxTransform(l.preTransforms.finalTransform.props),r=s.length,t=0;t<r;t+=1){for("st"!==o&&"gs"!==o||(d.beginPath(),l.da&&(d.setLineDash(l.da),d.lineDashOffset=l.do)),i=(a=s[t].trNodes).length,n=0;n<i;n+=1)"m"===a[n].t?d.moveTo(a[n].p[0],a[n].p[1]):"c"===a[n].t?d.bezierCurveTo(a[n].pts[0],a[n].pts[1],a[n].pts[2],a[n].pts[3],a[n].pts[4],a[n].pts[5]):d.closePath();"st"!==o&&"gs"!==o||(d.stroke(),l.da&&d.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&d.fill(l.r),h.restore()}},CVShapeElement.prototype.renderShape=function(e,t,r,n){var i,s;for(s=e,i=t.length-1;i>=0;i-=1)"tr"===t[i].ty?(s=r[i].transform,this.renderShapeTransform(e,s)):"sh"===t[i].ty||"el"===t[i].ty||"rc"===t[i].ty||"sr"===t[i].ty?this.renderPath(t[i],r[i]):"fl"===t[i].ty?this.renderFill(t[i],r[i],s):"st"===t[i].ty?this.renderStroke(t[i],r[i],s):"gf"===t[i].ty||"gs"===t[i].ty?this.renderGradientFill(t[i],r[i],s):"gr"===t[i].ty?this.renderShape(s,t[i].it,r[i].it):t[i].ty;n&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var r,n,i,s=e.trNodes,a=t.paths,o=a._length;s.length=0;var l=e.transforms.finalTransform;for(i=0;i<o;i+=1){var c=a.shapes[i];if(c&&c.v){for(n=c._length,r=1;r<n;r+=1)1===r&&s.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),s.push({t:"c",pts:l.applyToTriplePoints(c.o[r-1],c.i[r],c.v[r])});1===n&&s.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),c.c&&n&&(s.push({t:"c",pts:l.applyToTriplePoints(c.o[r-1],c.i[0],c.v[0])}),s.push({t:"z"}))}}e.trNodes=s}},CVShapeElement.prototype.renderPath=function(e,t){if(!0!==e.hd&&e._shouldRender){var r,n=t.styledShapes.length;for(r=0;r<n;r+=1)this.renderStyledShape(t.styledShapes[r],t.sh)}},CVShapeElement.prototype.renderFill=function(e,t,r){var n=t.style;(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(e,t,r){var n,i=t.style;if(!i.grd||t.g._mdf||t.s._mdf||t.e._mdf||1!==e.t&&(t.h._mdf||t.a._mdf)){var s,a=this.globalData.canvasContext,o=t.s.v,l=t.e.v;if(1===e.t)n=a.createLinearGradient(o[0],o[1],l[0],l[1]);else{var c=Math.sqrt(Math.pow(o[0]-l[0],2)+Math.pow(o[1]-l[1],2)),h=Math.atan2(l[1]-o[1],l[0]-o[0]),d=t.h.v;d>=1?d=.99:d<=-1&&(d=-.99);var u=c*d,p=Math.cos(h+t.a.v)*u+o[0],f=Math.sin(h+t.a.v)*u+o[1];n=a.createRadialGradient(p,f,0,o[0],o[1],c)}var m=e.g.p,g=t.g.c,y=1;for(s=0;s<m;s+=1)t.g._hasOpacity&&t.g._collapsable&&(y=t.g.o[2*s+1]),n.addColorStop(g[4*s]/100,"rgba("+g[4*s+1]+","+g[4*s+2]+","+g[4*s+3]+","+y+")");i.grd=n}i.coOp=t.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(e,t,r){var n=t.style,i=t.d;i&&(i._mdf||this._isFirstFrame)&&(n.da=i.dashArray,n.do=i.dashoffset[0]),(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*r.opacity),(t.w._mdf||this._isFirstFrame)&&(n.wi=t.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=!1;e.fc?(t=!0,this.values.fill=this.buildColor(e.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=t;var r=!1;e.sc&&(r=!0,this.values.stroke=this.buildColor(e.sc),this.values.sWidth=e.sw);var n,i,s,a,o,l,c,h,d,u,p,f,m=this.globalData.fontManager.getFontByName(e.f),g=e.l,y=this.mHelper;this.stroke=r,this.values.fValue=e.finalSize+"px "+this.globalData.fontManager.getFontByName(e.f).fFamily,i=e.finalText.length;var v=this.data.singleShape,b=.001*e.tr*e.finalSize,S=0,E=0,C=!0,_=0;for(n=0;n<i;n+=1){a=(s=this.globalData.fontManager.getCharData(e.finalText[n],m.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily))&&s.data||{},y.reset(),v&&g[n].n&&(S=-b,E+=e.yOffset,E+=C?1:0,C=!1),d=(c=a.shapes?a.shapes[0].it:[]).length,y.scale(e.finalSize/100,e.finalSize/100),v&&this.applyTextPropertiesToMatrix(e,y,g[n].line,S,E),p=createSizedArray(d-1);var T=0;for(h=0;h<d;h+=1)if("sh"===c[h].ty){for(l=c[h].ks.k.i.length,u=c[h].ks.k,f=[],o=1;o<l;o+=1)1===o&&f.push(y.applyToX(u.v[0][0],u.v[0][1],0),y.applyToY(u.v[0][0],u.v[0][1],0)),f.push(y.applyToX(u.o[o-1][0],u.o[o-1][1],0),y.applyToY(u.o[o-1][0],u.o[o-1][1],0),y.applyToX(u.i[o][0],u.i[o][1],0),y.applyToY(u.i[o][0],u.i[o][1],0),y.applyToX(u.v[o][0],u.v[o][1],0),y.applyToY(u.v[o][0],u.v[o][1],0));f.push(y.applyToX(u.o[o-1][0],u.o[o-1][1],0),y.applyToY(u.o[o-1][0],u.o[o-1][1],0),y.applyToX(u.i[0][0],u.i[0][1],0),y.applyToY(u.i[0][0],u.i[0][1],0),y.applyToX(u.v[0][0],u.v[0][1],0),y.applyToY(u.v[0][0],u.v[0][1],0)),p[T]=f,T+=1}v&&(S+=g[n].l,S+=b),this.textSpans[_]?this.textSpans[_].elem=p:this.textSpans[_]={elem:p},_+=1}},CVTextElement.prototype.renderInnerContent=function(){var e,t,r,n,i,s,a=this.canvasContext;a.font=this.values.fValue,a.lineCap="butt",a.lineJoin="miter",a.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;t=c.length;var h,d,u=null,p=null,f=null;for(e=0;e<t;e+=1)if(!c[e].n){if((o=l[e])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(o.p),this.globalData.renderer.ctxOpacity(o.o)),this.fill){for(o&&o.fc?u!==o.fc&&(u=o.fc,a.fillStyle=o.fc):u!==this.values.fill&&(u=this.values.fill,a.fillStyle=this.values.fill),n=(h=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<n;r+=1)for(s=(d=h[r]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<s;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(o&&o.sw?f!==o.sw&&(f=o.sw,a.lineWidth=o.sw):f!==this.values.sWidth&&(f=this.values.sWidth,a.lineWidth=this.values.sWidth),o&&o.sc?p!==o.sc&&(p=o.sc,a.strokeStyle=o.sc):p!==this.values.stroke&&(p=this.values.stroke,a.strokeStyle=this.values.stroke),n=(h=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<n;r+=1)for(s=(d=h[r]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<s;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}o&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var e=createTag("canvas");e.width=this.assetData.w,e.height=this.assetData.h;var t,r,n=e.getContext("2d"),i=this.img.width,s=this.img.height,a=i/s,o=this.assetData.w/this.assetData.h,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;a>o&&"xMidYMid slice"===l||a<o&&"xMidYMid slice"!==l?t=(r=s)*o:r=(t=i)/o,n.drawImage(this.img,(i-t)/2,(s-r)/2,t,r,0,0,this.assetData.w,this.assetData.h),this.img=e}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var e=this.canvasContext;e.fillStyle=this.data.sc,e.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(e){return new CVShapeElement(e,this.globalData,this)},CanvasRendererBase.prototype.createText=function(e){return new CVTextElement(e,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(e){return new CVImageElement(e,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(e){return new CVSolidElement(e,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(e){if(1!==e[0]||0!==e[1]||0!==e[4]||1!==e[5]||0!==e[12]||0!==e[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(e);var t=this.contextData.getTransform(),r=t.props;this.transformMat.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]),t.cloneFromProps(this.transformMat.props);var n=t.props;this.canvasContext.setTransform(n[0],n[1],n[4],n[5],n[12],n[13])}else this.canvasContext.transform(e[0],e[1],e[4],e[5],e[12],e[13])},CanvasRendererBase.prototype.ctxOpacity=function(e){var t=this.contextData.getOpacity();if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=e<0?0:e,void(this.globalData.currentGlobalAlpha=t);t*=e<0?0:e,this.contextData.setOpacity(t),this.globalData.currentGlobalAlpha!==t&&(this.canvasContext.globalAlpha=t,this.globalData.currentGlobalAlpha=t)},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(e){this.renderConfig.clearCanvas?(e&&this.canvasContext.save(),this.contextData.push()):this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(e){if(this.renderConfig.clearCanvas){e&&(this.canvasContext.restore(),this.globalData.blendMode="source-over");var t=this.contextData.pop(),r=t.transform,n=t.opacity;this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),this.globalData.currentGlobalAlpha!==n&&(this.canvasContext.globalAlpha=n,this.globalData.currentGlobalAlpha=n)}else this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(e){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var t=this.animationItem.container.style;t.width="100%",t.height="100%";var r="0px 0px 0px";t.transformOrigin=r,t.mozTransformOrigin=r,t.webkitTransformOrigin=r,t["-webkit-transform"]=r,t.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.data=e,this.layers=e.layers,this.transformCanvas={w:e.w,h:e.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(e,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(e.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(e,t){var r,n,i,s;if(this.reset(),e?(r=e,n=t,this.canvasContext.canvas.width=r,this.canvasContext.canvas.height=n):(this.animationItem.wrapper&&this.animationItem.container?(r=this.animationItem.wrapper.offsetWidth,n=this.animationItem.wrapper.offsetHeight):(r=this.canvasContext.canvas.width,n=this.canvasContext.canvas.height),this.canvasContext.canvas.width=r*this.renderConfig.dpr,this.canvasContext.canvas.height=n*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var a=this.renderConfig.preserveAspectRatio.split(" "),o=a[1]||"meet",l=a[0]||"xMidYMid",c=l.substr(0,4),h=l.substr(4);i=r/n,(s=this.transformCanvas.w/this.transformCanvas.h)>i&&"meet"===o||s<i&&"slice"===o?(this.transformCanvas.sx=r/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=r/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===c&&(s<i&&"meet"===o||s>i&&"slice"===o)?(r-this.transformCanvas.w*(n/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===c&&(s<i&&"meet"===o||s>i&&"slice"===o)?(r-this.transformCanvas.w*(n/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(s>i&&"meet"===o||s<i&&"slice"===o)?(n-this.transformCanvas.h*(r/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(s>i&&"meet"===o||s<i&&"slice"===o)?(n-this.transformCanvas.h*(r/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=r/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var e;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),e=(this.layers?this.layers.length:0)-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(e,t){if((this.renderedFrame!==e||!0!==this.renderConfig.clearCanvas||t)&&!this.destroyed&&-1!==e){var r;this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n=this.layers.length;for(this.completeLayers||this.checkLayers(e),r=0;r<n;r+=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(e-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){var r=this.createItem(this.layers[e],this,this.globalData);t[e]=r,r.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var e,t=this.canvasContext;for(t.beginPath(),t.moveTo(0,0),t.lineTo(this.data.w,0),t.lineTo(this.data.w,this.data.h),t.lineTo(0,this.data.h),t.lineTo(0,0),t.clip(),e=this.layers.length-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects,this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var t=this.finalTransform.mat.toCSS();e.transform=t,e.webkitTransform=t}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var e;this.data.hasMask?((e=createNS("rect")).setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((e=createTag("div")).style.width=this.data.sw+"px",e.style.height=this.data.sh+"px",e.style.backgroundColor=this.data.sc),this.layerElement.appendChild(e)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var e;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),e=this.svgElement;else{e=createNS("svg");var t=this.comp.data?this.comp.data:this.globalData.compSize;e.setAttribute("width",t.w),e.setAttribute("height",t.h),e.appendChild(this.shapesContainer),this.layerElement.appendChild(e)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=e},HShapeElement.prototype.getTransformedPoint=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)t=e[r].mProps.v.applyToPointArray(t[0],t[1],0);return t},HShapeElement.prototype.calculateShapeBoundingBox=function(e,t){var r,n,i,s,a,o=e.sh.v,l=e.transformers,c=o._length;if(!(c<=1)){for(r=0;r<c-1;r+=1)n=this.getTransformedPoint(l,o.v[r]),i=this.getTransformedPoint(l,o.o[r]),s=this.getTransformedPoint(l,o.i[r+1]),a=this.getTransformedPoint(l,o.v[r+1]),this.checkBounds(n,i,s,a,t);o.c&&(n=this.getTransformedPoint(l,o.v[r]),i=this.getTransformedPoint(l,o.o[r]),s=this.getTransformedPoint(l,o.i[0]),a=this.getTransformedPoint(l,o.v[0]),this.checkBounds(n,i,s,a,t))}},HShapeElement.prototype.checkBounds=function(e,t,r,n,i){this.getBoundsOfCurve(e,t,r,n);var s=this.shapeBoundingBox;i.x=bmMin(s.left,i.x),i.xMax=bmMax(s.right,i.xMax),i.y=bmMin(s.top,i.y),i.yMax=bmMax(s.bottom,i.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(e,t,r,n){for(var i,s,a,o,l,c,h,d=[[e[0],n[0]],[e[1],n[1]]],u=0;u<2;++u)s=6*e[u]-12*t[u]+6*r[u],i=-3*e[u]+9*t[u]-9*r[u]+3*n[u],a=3*t[u]-3*e[u],s|=0,a|=0,0==(i|=0)&&0===s||(0===i?(o=-a/s)>0&&o<1&&d[u].push(this.calculateF(o,e,t,r,n,u)):(l=s*s-4*a*i)>=0&&((c=(-s+bmSqrt(l))/(2*i))>0&&c<1&&d[u].push(this.calculateF(c,e,t,r,n,u)),(h=(-s-bmSqrt(l))/(2*i))>0&&h<1&&d[u].push(this.calculateF(h,e,t,r,n,u))));this.shapeBoundingBox.left=bmMin.apply(null,d[0]),this.shapeBoundingBox.top=bmMin.apply(null,d[1]),this.shapeBoundingBox.right=bmMax.apply(null,d[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,d[1])},HShapeElement.prototype.calculateF=function(e,t,r,n,i,s){return bmPow(1-e,3)*t[s]+3*bmPow(1-e,2)*e*r[s]+3*(1-e)*bmPow(e,2)*n[s]+bmPow(e,3)*i[s]},HShapeElement.prototype.calculateBoundingBox=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)e[r]&&e[r].sh?this.calculateShapeBoundingBox(e[r],t):e[r]&&e[r].it?this.calculateBoundingBox(e[r].it,t):e[r]&&e[r].style&&e[r].w&&this.expandStrokeBoundingBox(e[r].w,t)},HShapeElement.prototype.expandStrokeBoundingBox=function(e,t){var r=0;if(e.keyframes){for(var n=0;n<e.keyframes.length;n+=1){var i=e.keyframes[n].s;i>r&&(r=i)}r*=e.mult}else r=e.v*e.mult;t.x-=r,t.xMax+=r,t.y-=r,t.yMax+=r},HShapeElement.prototype.currentBoxContains=function(e){return this.currentBBox.x<=e.x&&this.currentBBox.y<=e.y&&this.currentBBox.width+this.currentBBox.x>=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var e=this.tempBoundingBox,t=999999;if(e.x=t,e.xMax=-t,e.y=t,e.yMax=-t,this.calculateBoundingBox(this.itemsData,e),e.width=e.xMax<e.x?0:e.xMax-e.x,e.height=e.yMax<e.y?0:e.yMax-e.y,this.currentBoxContains(e))return;var r=!1;if(this.currentBBox.w!==e.width&&(this.currentBBox.w=e.width,this.shapeCont.setAttribute("width",e.width),r=!0),this.currentBBox.h!==e.height&&(this.currentBBox.h=e.height,this.shapeCont.setAttribute("height",e.height),r=!0),r||this.currentBBox.x!==e.x||this.currentBBox.y!==e.y){this.currentBBox.w=e.width,this.currentBBox.h=e.height,this.currentBBox.x=e.x,this.currentBBox.y=e.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var n=this.shapeCont.style,i="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";n.transform=i,n.webkitTransform=i}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var e=createNS("g");this.maskedElement.appendChild(e),this.innerElem=e}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=this.innerElem.style,r=e.fc?this.buildColor(e.fc):"rgba(0,0,0,0)";t.fill=r,t.color=r,e.sc&&(t.stroke=this.buildColor(e.sc),t.strokeWidth=e.sw+"px");var n,i,s=this.globalData.fontManager.getFontByName(e.f);if(!this.globalData.fontManager.chars)if(t.fontSize=e.finalSize+"px",t.lineHeight=e.finalSize+"px",s.fClass)this.innerElem.className=s.fClass;else{t.fontFamily=s.fFamily;var a=e.fWeight,o=e.fStyle;t.fontStyle=o,t.fontWeight=a}var l,c,h,d=e.l;i=d.length;var u,p=this.mHelper,f="",m=0;for(n=0;n<i;n+=1){if(this.globalData.fontManager.chars?(this.textPaths[m]?l=this.textPaths[m]:((l=createNS("path")).setAttribute("stroke-linecap",lineCapEnum[1]),l.setAttribute("stroke-linejoin",lineJoinEnum[2]),l.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[m]?h=(c=this.textSpans[m]).children[0]:((c=createTag("div")).style.lineHeight=0,(h=createNS("svg")).appendChild(l),styleDiv(c)))):this.isMasked?l=this.textPaths[m]?this.textPaths[m]:createNS("text"):this.textSpans[m]?(c=this.textSpans[m],l=this.textPaths[m]):(styleDiv(c=createTag("span")),styleDiv(l=createTag("span")),c.appendChild(l)),this.globalData.fontManager.chars){var g,y=this.globalData.fontManager.getCharData(e.finalText[n],s.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily);if(g=y?y.data:null,p.reset(),g&&g.shapes&&g.shapes.length&&(u=g.shapes[0].it,p.scale(e.finalSize/100,e.finalSize/100),f=this.createPathShape(p,u),l.setAttribute("d",f)),this.isMasked)this.innerElem.appendChild(l);else{if(this.innerElem.appendChild(c),g&&g.shapes){document.body.appendChild(h);var v=h.getBBox();h.setAttribute("width",v.width+2),h.setAttribute("height",v.height+2),h.setAttribute("viewBox",v.x-1+" "+(v.y-1)+" "+(v.width+2)+" "+(v.height+2));var b=h.style,S="translate("+(v.x-1)+"px,"+(v.y-1)+"px)";b.transform=S,b.webkitTransform=S,d[n].yOffset=v.y-1}else h.setAttribute("width",1),h.setAttribute("height",1);c.appendChild(h)}}else if(l.textContent=d[n].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(l);else{this.innerElem.appendChild(c);var E=l.style,C="translate3d(0,"+-e.finalSize/1.2+"px,0)";E.transform=C,E.webkitTransform=C}this.isMasked?this.textSpans[m]=l:this.textSpans[m]=c,this.textSpans[m].style.display="block",this.textPaths[m]=l,m+=1}for(;m<this.textSpans.length;)this.textSpans[m].style.display="none",m+=1},HTextElement.prototype.renderInnerContent=function(){var e;if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),e=this.svgElement.style;var t="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";e.transform=t,e.webkitTransform=t}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var r,n,i,s,a,o=0,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;for(n=c.length,r=0;r<n;r+=1)c[r].n?o+=1:(s=this.textSpans[r],a=this.textPaths[r],i=l[o],o+=1,i._mdf.m&&(this.isMasked?s.setAttribute("transform",i.m):(s.style.webkitTransform=i.m,s.style.transform=i.m)),s.style.opacity=i.o,i.sw&&i._mdf.sw&&a.setAttribute("stroke-width",i.sw),i.sc&&i._mdf.sc&&a.setAttribute("stroke",i.sc),i.fc&&i._mdf.fc&&(a.setAttribute("fill",i.fc),a.style.color=i.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var h=this.innerElem.getBBox();if(this.currentBBox.w!==h.width&&(this.currentBBox.w=h.width,this.svgElement.setAttribute("width",h.width)),this.currentBBox.h!==h.height&&(this.currentBBox.h=h.height,this.svgElement.setAttribute("height",h.height)),this.currentBBox.w!==h.width+2||this.currentBBox.h!==h.height+2||this.currentBBox.x!==h.x-1||this.currentBBox.y!==h.y-1){this.currentBBox.w=h.width+2,this.currentBBox.h=h.height+2,this.currentBBox.x=h.x-1,this.currentBBox.y=h.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),e=this.svgElement.style;var d="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";e.transform=d,e.webkitTransform=d}}}},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var e,t,r,n,i=this.comp.threeDElements.length;for(e=0;e<i;e+=1)if("3d"===(t=this.comp.threeDElements[e]).type){r=t.perspectiveElem.style,n=t.container.style;var s=this.pe.v+"px",a="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.perspective=s,r.webkitPerspective=s,n.transformOrigin=a,n.mozTransformOrigin=a,n.webkitTransformOrigin=a,r.transform=o,r.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var e,t,r=this._isFirstFrame;if(this.hierarchy)for(t=this.hierarchy.length,e=0;e<t;e+=1)r=this.hierarchy[e].finalTransform.mProp._mdf||r;if(r||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(e=t=this.hierarchy.length-1;e>=0;e-=1){var n=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-n.p.v[0],-n.p.v[1],n.p.v[2]),this.mat.rotateX(-n.or.v[0]).rotateY(-n.or.v[1]).rotateZ(n.or.v[2]),this.mat.rotateX(-n.rx.v).rotateY(-n.ry.v).rotateZ(n.rz.v),this.mat.scale(1/n.s.v[0],1/n.s.v[1],1/n.s.v[2]),this.mat.translate(n.a.v[0],n.a.v[1],n.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var i;i=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var s=Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2)+Math.pow(i[2],2)),a=[i[0]/s,i[1]/s,i[2]/s],o=Math.sqrt(a[2]*a[2]+a[0]*a[0]),l=Math.atan2(a[1],o),c=Math.atan2(a[0],-a[2]);this.mat.rotateY(c).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var h=!this._prevMat.equals(this.mat);if((h||this.pe._mdf)&&this.comp.threeDElements){var d,u,p;for(t=this.comp.threeDElements.length,e=0;e<t;e+=1)if("3d"===(d=this.comp.threeDElements[e]).type){if(h){var f=this.mat.toCSS();(p=d.container.style).transform=f,p.webkitTransform=f}this.pe._mdf&&((u=d.perspectiveElem.style).perspective=this.pe.v+"px",u.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData),t=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(t),t.crossOrigin="anonymous",t.src=e,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRendererBase.prototype.appendElementInPos=function(e,t){var r=e.getBaseElement();if(r){var n=this.layers[t];if(n.ddd&&this.supports3d)this.addTo3dContainer(r,t);else if(this.threeDElements)this.addTo3dContainer(r,t);else{for(var i,s,a=0;a<t;)this.elements[a]&&!0!==this.elements[a]&&this.elements[a].getBaseElement&&(s=this.elements[a],i=(this.layers[a].ddd?this.getThreeDContainerByPos(a):s.getBaseElement())||i),a+=1;i?n.ddd&&this.supports3d||this.layerElement.insertBefore(r,i):n.ddd&&this.supports3d||this.layerElement.appendChild(r)}}},HybridRendererBase.prototype.createShape=function(e){return this.supports3d?new HShapeElement(e,this.globalData,this):new SVGShapeElement(e,this.globalData,this)},HybridRendererBase.prototype.createText=function(e){return this.supports3d?new HTextElement(e,this.globalData,this):new SVGTextLottieElement(e,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(e){return this.camera=new HCameraElement(e,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(e){return this.supports3d?new HImageElement(e,this.globalData,this):new IImageElement(e,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(e){return this.supports3d?new HSolidElement(e,this.globalData,this):new ISolidElement(e,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(e){for(var t=0,r=this.threeDElements.length;t<r;){if(this.threeDElements[t].startPos<=e&&this.threeDElements[t].endPos>=e)return this.threeDElements[t].perspectiveElem;t+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(e,t){var r,n,i=createTag("div");styleDiv(i);var s=createTag("div");if(styleDiv(s),"3d"===t){(r=i.style).width=this.globalData.compSize.w+"px",r.height=this.globalData.compSize.h+"px";var a="50% 50%";r.webkitTransformOrigin=a,r.mozTransformOrigin=a,r.transformOrigin=a;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(n=s.style).transform=o,n.webkitTransform=o}i.appendChild(s);var l={container:s,perspectiveElem:i,startPos:e,endPos:e,type:t};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var e,t,r=this.layers.length,n="";for(e=0;e<r;e+=1)this.layers[e].ddd&&3!==this.layers[e].ty?("3d"!==n&&(n="3d",t=this.createThreeDContainer(e,"3d")),t.endPos=Math.max(t.endPos,e)):("2d"!==n&&(n="2d",t=this.createThreeDContainer(e,"2d")),t.endPos=Math.max(t.endPos,e));for(e=(r=this.threeDElements.length)-1;e>=0;e-=1)this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(e,t){for(var r=0,n=this.threeDElements.length;r<n;){if(t<=this.threeDElements[r].endPos){for(var i,s=this.threeDElements[r].startPos;s<t;)this.elements[s]&&this.elements[s].getBaseElement&&(i=this.elements[s].getBaseElement()),s+=1;i?this.threeDElements[r].container.insertBefore(e,i):this.threeDElements[r].container.appendChild(e);break}r+=1}},HybridRendererBase.prototype.configAnimation=function(e){var t=createTag("div"),r=this.animationItem.wrapper,n=t.style;n.width=e.w+"px",n.height=e.h+"px",this.resizerElem=t,styleDiv(t),n.transformStyle="flat",n.mozTransformStyle="flat",n.webkitTransformStyle="flat",this.renderConfig.className&&t.setAttribute("class",this.renderConfig.className),r.appendChild(t),n.overflow="hidden";var i=createNS("svg");i.setAttribute("width","1"),i.setAttribute("height","1"),styleDiv(i),this.resizerElem.appendChild(i);var s=createNS("defs");i.appendChild(s),this.data=e,this.setupGlobalData(e,i),this.globalData.defs=s,this.layers=e.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var e,t,r,n,i=this.animationItem.wrapper.offsetWidth,s=this.animationItem.wrapper.offsetHeight,a=i/s;this.globalData.compSize.w/this.globalData.compSize.h>a?(e=i/this.globalData.compSize.w,t=i/this.globalData.compSize.w,r=0,n=(s-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(e=s/this.globalData.compSize.h,t=s/this.globalData.compSize.h,r=(i-this.globalData.compSize.w*(s/this.globalData.compSize.h))/2,n=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+e+",0,0,0,0,"+t+",0,0,0,0,1,0,"+r+","+n+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var e,t=this.globalData.compSize.w,r=this.globalData.compSize.h,n=this.threeDElements.length;for(e=0;e<n;e+=1){var i=this.threeDElements[e].perspectiveElem.style;i.webkitPerspective=Math.sqrt(Math.pow(t,2)+Math.pow(r,2))+"px",i.perspective=i.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(e){var t,r=e.length,n=createTag("div");for(t=0;t<r;t+=1)if(e[t].xt){var i=this.createComp(e[t],n,this.globalData.comp,null);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(e,t){for(var r,n=0;n<t;)this.elements[n]&&this.elements[n].getBaseElement&&(r=this.elements[n].getBaseElement()),n+=1;r?this.layerElement.insertBefore(e,r):this.layerElement.appendChild(e)},HCompElement.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)},extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)};var CompExpressionInterface=function(e){function t(t){for(var r=0,n=e.layers.length;r<n;){if(e.layers[r].nm===t||e.layers[r].ind===t)return e.elements[r].layerInterface;r+=1}return null}return Object.defineProperty(t,"_name",{value:e.data.nm}),t.layer=t,t.pixelAspect=1,t.height=e.data.h||e.globalData.compSize.h,t.width=e.data.w||e.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/e.globalData.frameRate,t.displayStartTime=0,t.numLayers=e.layers.length,t},Expressions=function(){var e={initExpressions:function(e){var t=0,r=[];e.renderer.compInterface=CompExpressionInterface(e.renderer),e.renderer.globalData.projectInterface.registerComposition(e.renderer),e.renderer.globalData.pushExpression=function(){t+=1},e.renderer.globalData.popExpression=function(){0==(t-=1)&&function(){var e,t=r.length;for(e=0;e<t;e+=1)r[e].release();r.length=0}()},e.renderer.globalData.registerExpressionProperty=function(e){-1===r.indexOf(e)&&r.push(e)}}};return e}(),MaskManagerInterface=function(){function e(e,t){this._mask=e,this._data=t}return Object.defineProperty(e.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}}),function(t){var r,n=createSizedArray(t.viewData.length),i=t.viewData.length;for(r=0;r<i;r+=1)n[r]=new e(t.viewData[r],t.masksProperties[r]);return function(e){for(r=0;r<i;){if(t.masksProperties[r].nm===e)return n[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var e={pv:0,v:0,mult:1},t={pv:[0,0,0],v:[0,0,0],mult:1};function r(e,t,r){Object.defineProperty(e,"velocity",{get:function(){return t.getVelocityAtTime(t.comp.currentFrame)}}),e.numKeys=t.keyframes?t.keyframes.length:0,e.key=function(n){if(!e.numKeys)return 0;var i="";i="s"in t.keyframes[n-1]?t.keyframes[n-1].s:"e"in t.keyframes[n-2]?t.keyframes[n-2].e:t.keyframes[n-2].s;var s="unidimensional"===r?new Number(i):Object.assign({},i);return s.time=t.keyframes[n-1].t/t.elem.comp.globalData.frameRate,s.value="unidimensional"===r?i[0]:i,s},e.valueAtTime=t.getValueAtTime,e.speedAtTime=t.getSpeedAtTime,e.velocityAtTime=t.getVelocityAtTime,e.propertyGroup=t.propertyGroup}function n(){return e}return function(i){return i?"unidimensional"===i.propType?function(t){t&&"pv"in t||(t=e);var n=1/t.mult,i=t.pv*n,s=new Number(i);return s.value=i,r(s,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*n,s.value!==i&&((s=new Number(i)).value=i,r(s,t,"unidimensional")),s}}(i):function(e){e&&"pv"in e||(e=t);var n=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,r(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)a[t]=e.v[t]*n,s[t]=a[t];return s}}(i):n}}(),TransformExpressionInterface=function(e){function t(e){switch(e){case"scale":case"Scale":case"ADBE Scale":case 6:return t.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return t.rotation;case"ADBE Rotate X":return t.xRotation;case"ADBE Rotate Y":return t.yRotation;case"position":case"Position":case"ADBE Position":case 2:return t.position;case"ADBE Position_0":return t.xPosition;case"ADBE Position_1":return t.yPosition;case"ADBE Position_2":return t.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return t.anchorPoint;case"opacity":case"Opacity":case 11:return t.opacity;default:return null}}var r,n,i,s;return Object.defineProperty(t,"rotation",{get:ExpressionPropertyInterface(e.r||e.rz)}),Object.defineProperty(t,"zRotation",{get:ExpressionPropertyInterface(e.rz||e.r)}),Object.defineProperty(t,"xRotation",{get:ExpressionPropertyInterface(e.rx)}),Object.defineProperty(t,"yRotation",{get:ExpressionPropertyInterface(e.ry)}),Object.defineProperty(t,"scale",{get:ExpressionPropertyInterface(e.s)}),e.p?s=ExpressionPropertyInterface(e.p):(r=ExpressionPropertyInterface(e.px),n=ExpressionPropertyInterface(e.py),e.pz&&(i=ExpressionPropertyInterface(e.pz))),Object.defineProperty(t,"position",{get:function(){return e.p?s():[r(),n(),i?i():0]}}),Object.defineProperty(t,"xPosition",{get:ExpressionPropertyInterface(e.px)}),Object.defineProperty(t,"yPosition",{get:ExpressionPropertyInterface(e.py)}),Object.defineProperty(t,"zPosition",{get:ExpressionPropertyInterface(e.pz)}),Object.defineProperty(t,"anchorPoint",{get:ExpressionPropertyInterface(e.a)}),Object.defineProperty(t,"opacity",{get:ExpressionPropertyInterface(e.o)}),Object.defineProperty(t,"skew",{get:ExpressionPropertyInterface(e.sk)}),Object.defineProperty(t,"skewAxis",{get:ExpressionPropertyInterface(e.sa)}),Object.defineProperty(t,"orientation",{get:ExpressionPropertyInterface(e.or)}),t},LayerExpressionInterface=function(){function e(e){var t=new Matrix;return void 0!==e?this._elem.finalTransform.mProp.getValueAtTime(e).clone(t):this._elem.finalTransform.mProp.applyToMatrix(t),t}function t(e,t){var r=this.getMatrix(t);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,e)}function r(e,t){var r=this.getMatrix(t);return this.applyPoint(r,e)}function n(e,t){var r=this.getMatrix(t);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,e)}function i(e,t){var r=this.getMatrix(t);return this.invertPoint(r,e)}function s(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)}return e.applyToPointArray(t[0],t[1],t[2]||0)}function a(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)}return e.inversePoint(t)}function o(e){var t=new Matrix;if(t.reset(),this._elem.finalTransform.mProp.applyToMatrix(t),this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t);return t.inversePoint(e)}return t.inversePoint(e)}function l(){return[1,1,1,1]}return function(c){var h;function d(e){switch(e){case"ADBE Root Vectors Group":case"Contents":case 2:return d.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return h;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return d.effect;case"ADBE Text Properties":return d.textInterface;default:return null}}d.getMatrix=e,d.invertPoint=a,d.applyPoint=s,d.toWorld=r,d.toWorldVec=t,d.fromWorld=i,d.fromWorldVec=n,d.toComp=r,d.fromComp=o,d.sampleImage=l,d.sourceRectAtTime=c.sourceRectAtTime.bind(c),d._elem=c;var u=getDescriptor(h=TransformExpressionInterface(c.finalTransform.mProp),"anchorPoint");return Object.defineProperties(d,{hasParent:{get:function(){return c.hierarchy.length}},parent:{get:function(){return c.hierarchy[0].layerInterface}},rotation:getDescriptor(h,"rotation"),scale:getDescriptor(h,"scale"),position:getDescriptor(h,"position"),opacity:getDescriptor(h,"opacity"),anchorPoint:u,anchor_point:u,transform:{get:function(){return h}},active:{get:function(){return c.isInRange}}}),d.startTime=c.data.st,d.index=c.data.ind,d.source=c.data.refId,d.height=0===c.data.ty?c.data.h:100,d.width=0===c.data.ty?c.data.w:100,d.inPoint=c.data.ip/c.comp.globalData.frameRate,d.outPoint=c.data.op/c.comp.globalData.frameRate,d._name=c.data.nm,d.registerMaskInterface=function(e){d.mask=new MaskManagerInterface(e,c)},d.registerEffectsInterface=function(e){d.effect=e},d}}(),propertyGroupFactory=function(e,t){return function(r){return(r=void 0===r?1:r)<=0?e:t(r-1)}},PropertyInterface=function(e,t){var r={_name:e};return function(e){return(e=void 0===e?1:e)<=0?r:t(e-1)}},EffectsExpressionInterface=function(){var e={createEffectsInterface:function(e,r){if(e.effectsManager){var n,i=[],s=e.data.ef,a=e.effectsManager.effectElements.length;for(n=0;n<a;n+=1)i.push(t(s[n],e.effectsManager.effectElements[n],r,e));var o=e.data.ef||[],l=function(e){for(n=0,a=o.length;n<a;){if(e===o[n].nm||e===o[n].mn||e===o[n].ix)return i[n];n+=1}return null};return Object.defineProperty(l,"numProperties",{get:function(){return o.length}}),l}return null}};function t(e,n,i,s){function a(t){for(var r=e.ef,n=0,i=r.length;n<i;){if(t===r[n].nm||t===r[n].mn||t===r[n].ix)return 5===r[n].ty?c[n]:c[n]();n+=1}throw new Error}var o,l=propertyGroupFactory(a,i),c=[],h=e.ef.length;for(o=0;o<h;o+=1)5===e.ef[o].ty?c.push(t(e.ef[o],n.effectElements[o],n.effectElements[o].propertyGroup,s)):c.push(r(n.effectElements[o],e.ef[o].ty,s,l));return"ADBE Color Control"===e.mn&&Object.defineProperty(a,"color",{get:function(){return c[0]()}}),Object.defineProperties(a,{numProperties:{get:function(){return e.np}},_name:{value:e.nm},propertyGroup:{value:l}}),a.enabled=0!==e.en,a.active=a.enabled,a}function r(e,t,r,n){var i=ExpressionPropertyInterface(e.p);return e.p.setGroupProperty&&e.p.setGroupProperty(PropertyInterface("",n)),function(){return 10===t?r.comp.compInterface(e.p.v):i()}}return e}(),ShapePathInterface=function(e,t,r){var n=t.sh;function i(e){return"Shape"===e||"shape"===e||"Path"===e||"path"===e||"ADBE Vector Shape"===e||2===e?i.path:null}var s=propertyGroupFactory(i,r);return n.setGroupProperty(PropertyInterface("Path",s)),Object.defineProperties(i,{path:{get:function(){return n.k&&n.getValue(),n}},shape:{get:function(){return n.k&&n.getValue(),n}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:r}}),i},ShapeExpressionInterface=function(){function e(e,a,u){var p,f=[],m=e?e.length:0;for(p=0;p<m;p+=1)"gr"===e[p].ty?f.push(t(e[p],a[p],u)):"fl"===e[p].ty?f.push(r(e[p],a[p],u)):"st"===e[p].ty?f.push(i(e[p],a[p],u)):"tm"===e[p].ty?f.push(s(e[p],a[p],u)):"tr"===e[p].ty||("el"===e[p].ty?f.push(o(e[p],a[p],u)):"sr"===e[p].ty?f.push(l(e[p],a[p],u)):"sh"===e[p].ty?f.push(ShapePathInterface(e[p],a[p],u)):"rc"===e[p].ty?f.push(c(e[p],a[p],u)):"rd"===e[p].ty?f.push(h(e[p],a[p],u)):"rp"===e[p].ty?f.push(d(e[p],a[p],u)):"gf"===e[p].ty?f.push(n(e[p],a[p],u)):f.push((e[p],a[p],function(){return null})));return f}function t(t,r,n){var i=function(e){switch(e){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,n);var s=function(t,r,n){var i,s=function(e){for(var t=0,r=i.length;t<r;){if(i[t]._name===e||i[t].mn===e||i[t].propertyIndex===e||i[t].ix===e||i[t].ind===e)return i[t];t+=1}return"number"==typeof e?i[e-1]:null};s.propertyGroup=propertyGroupFactory(s,n),i=e(t.it,r.it,s.propertyGroup),s.numProperties=i.length;var o=a(t.it[t.it.length-1],r.it[r.it.length-1],s.propertyGroup);return s.transform=o,s.propertyIndex=t.cix,s._name=t.nm,s}(t,r,i.propertyGroup),o=a(t.it[t.it.length-1],r.it[r.it.length-1],i.propertyGroup);return i.content=s,i.transform=o,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function r(e,t,r){function n(e){return"Color"===e||"color"===e?n.color:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),n}function n(e,t,r){function n(e){return"Start Point"===e||"start point"===e?n.startPoint:"End Point"===e||"end point"===e?n.endPoint:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{startPoint:{get:ExpressionPropertyInterface(t.s)},endPoint:{get:ExpressionPropertyInterface(t.e)},opacity:{get:ExpressionPropertyInterface(t.o)},type:{get:function(){return"a"}},_name:{value:e.nm},mn:{value:e.mn}}),t.s.setGroupProperty(PropertyInterface("Start Point",r)),t.e.setGroupProperty(PropertyInterface("End Point",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),n}function i(e,t,r){var n,i=propertyGroupFactory(c,r),s=propertyGroupFactory(l,i);function a(r){Object.defineProperty(l,e.d[r].nm,{get:ExpressionPropertyInterface(t.d.dataProps[r].p)})}var o=e.d?e.d.length:0,l={};for(n=0;n<o;n+=1)a(n),t.d.dataProps[n].p.setGroupProperty(s);function c(e){return"Color"===e||"color"===e?c.color:"Opacity"===e||"opacity"===e?c.opacity:"Stroke Width"===e||"stroke width"===e?c.strokeWidth:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},strokeWidth:{get:ExpressionPropertyInterface(t.w)},dash:{get:function(){return l}},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",i)),t.o.setGroupProperty(PropertyInterface("Opacity",i)),t.w.setGroupProperty(PropertyInterface("Stroke Width",i)),c}function s(e,t,r){function n(t){return t===e.e.ix||"End"===t||"end"===t?n.end:t===e.s.ix?n.start:t===e.o.ix?n.offset:null}var i=propertyGroupFactory(n,r);return n.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",i)),t.e.setGroupProperty(PropertyInterface("End",i)),t.o.setGroupProperty(PropertyInterface("Offset",i)),n.propertyIndex=e.ix,n.propertyGroup=r,Object.defineProperties(n,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),n.mn=e.mn,n}function a(e,t,r){function n(t){return e.a.ix===t||"Anchor Point"===t?n.anchorPoint:e.o.ix===t||"Opacity"===t?n.opacity:e.p.ix===t||"Position"===t?n.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?n.rotation:e.s.ix===t||"Scale"===t?n.scale:e.sk&&e.sk.ix===t||"Skew"===t?n.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?n.skewAxis:null}var i=propertyGroupFactory(n,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",i)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",i)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",i)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",i)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",i)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",i)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",i))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",i)),Object.defineProperties(n,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),n.ty="tr",n.mn=e.mn,n.propertyGroup=r,n}function o(e,t,r){function n(t){return e.p.ix===t?n.position:e.s.ix===t?n.size:null}var i=propertyGroupFactory(n,r);n.propertyIndex=e.ix;var s="tm"===t.sh.ty?t.sh.prop:t.sh;return s.s.setGroupProperty(PropertyInterface("Size",i)),s.p.setGroupProperty(PropertyInterface("Position",i)),Object.defineProperties(n,{size:{get:ExpressionPropertyInterface(s.s)},position:{get:ExpressionPropertyInterface(s.p)},_name:{value:e.nm}}),n.mn=e.mn,n}function l(e,t,r){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.rotation:e.pt.ix===t?n.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?n.outerRadius:e.os.ix===t?n.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?n.innerRoundness:null:n.innerRadius}var i=propertyGroupFactory(n,r),s="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,s.or.setGroupProperty(PropertyInterface("Outer Radius",i)),s.os.setGroupProperty(PropertyInterface("Outer Roundness",i)),s.pt.setGroupProperty(PropertyInterface("Points",i)),s.p.setGroupProperty(PropertyInterface("Position",i)),s.r.setGroupProperty(PropertyInterface("Rotation",i)),e.ir&&(s.ir.setGroupProperty(PropertyInterface("Inner Radius",i)),s.is.setGroupProperty(PropertyInterface("Inner Roundness",i))),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(s.p)},rotation:{get:ExpressionPropertyInterface(s.r)},points:{get:ExpressionPropertyInterface(s.pt)},outerRadius:{get:ExpressionPropertyInterface(s.or)},outerRoundness:{get:ExpressionPropertyInterface(s.os)},innerRadius:{get:ExpressionPropertyInterface(s.ir)},innerRoundness:{get:ExpressionPropertyInterface(s.is)},_name:{value:e.nm}}),n.mn=e.mn,n}function c(e,t,r){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?n.size:null}var i=propertyGroupFactory(n,r),s="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,s.p.setGroupProperty(PropertyInterface("Position",i)),s.s.setGroupProperty(PropertyInterface("Size",i)),s.r.setGroupProperty(PropertyInterface("Rotation",i)),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(s.p)},roundness:{get:ExpressionPropertyInterface(s.r)},size:{get:ExpressionPropertyInterface(s.s)},_name:{value:e.nm}}),n.mn=e.mn,n}function h(e,t,r){function n(t){return e.r.ix===t||"Round Corners 1"===t?n.radius:null}var i=propertyGroupFactory(n,r),s=t;return n.propertyIndex=e.ix,s.rd.setGroupProperty(PropertyInterface("Radius",i)),Object.defineProperties(n,{radius:{get:ExpressionPropertyInterface(s.rd)},_name:{value:e.nm}}),n.mn=e.mn,n}function d(e,t,r){function n(t){return e.c.ix===t||"Copies"===t?n.copies:e.o.ix===t||"Offset"===t?n.offset:null}var i=propertyGroupFactory(n,r),s=t;return n.propertyIndex=e.ix,s.c.setGroupProperty(PropertyInterface("Copies",i)),s.o.setGroupProperty(PropertyInterface("Offset",i)),Object.defineProperties(n,{copies:{get:ExpressionPropertyInterface(s.c)},offset:{get:ExpressionPropertyInterface(s.o)},_name:{value:e.nm}}),n.mn=e.mn,n}return function(t,r,n){var i;function s(e){if("number"==typeof e)return 0===(e=void 0===e?1:e)?n:i[e-1];for(var t=0,r=i.length;t<r;){if(i[t]._name===e)return i[t];t+=1}return null}return s.propertyGroup=propertyGroupFactory(s,(function(){return n})),i=e(t,r,s.propertyGroup),s.numProperties=i.length,s._name="Contents",s}}(),TextExpressionInterface=function(e){var t,r;function n(e){return"ADBE Text Document"===e?n.sourceText:null}return Object.defineProperty(n,"sourceText",{get:function(){e.textProperty.getValue();var n=e.textProperty.currentData.t;return n!==t&&(t=e.textProperty.currentData.t,(r=new String(n)).value=n||new String(n),Object.defineProperty(r,"style",{get:function(){return{fillColor:e.textProperty.currentData.fc}}})),r}}),n};function _typeof$2(e){return _typeof$2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(e)}var FootageInterface=(dataInterfaceFactory=function(e){function t(e){return"Outline"===e?t.outlineInterface():null}return t._name="Outline",t.outlineInterface=function(e){var t="",r=e.getFootageData();function n(e){if(r[e])return t=e,"object"===_typeof$2(r=r[e])?n:r;var i=e.indexOf(t);if(-1!==i){var s=parseInt(e.substr(i+t.length),10);return"object"===_typeof$2(r=r[s])?n:r}return""}return function(){return t="",r=e.getFootageData(),n}}(e),t},function(e){function t(e){return"Data"===e?t.dataInterface:null}return t._name="Data",t.dataInterface=dataInterfaceFactory(e),t}),dataInterfaceFactory,interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(e){return interfaces[e]||null}function _typeof$1(e){return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(e)}function seedRandom(e,t){var r=this,n=256,i="random",s=t.pow(n,6),a=t.pow(2,52),o=2*a,l=n-1;function c(e){var t,r=e.length,i=this,s=0,a=i.i=i.j=0,o=i.S=[];for(r||(e=[r++]);s<n;)o[s]=s++;for(s=0;s<n;s++)o[s]=o[a=l&a+e[s%r]+(t=o[s])],o[a]=t;i.g=function(e){for(var t,r=0,s=i.i,a=i.j,o=i.S;e--;)t=o[s=l&s+1],r=r*n+o[l&(o[s]=o[a=l&a+t])+(o[a]=t)];return i.i=s,i.j=a,r}}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function d(e,t){var r,n=[],i=_typeof$1(e);if(t&&"object"==i)for(r in e)try{n.push(d(e[r],t-1))}catch(e){}return n.length?n:"string"==i?e:e+"\0"}function u(e,t){for(var r,n=e+"",i=0;i<n.length;)t[l&i]=l&(r^=19*t[l&i])+n.charCodeAt(i++);return p(t)}function p(e){return String.fromCharCode.apply(0,e)}t["seed"+i]=function(l,f,m){var g=[],y=u(d((f=!0===f?{entropy:!0}:f||{}).entropy?[l,p(e)]:null===l?function(){try{var t=new Uint8Array(n);return(r.crypto||r.msCrypto).getRandomValues(t),p(t)}catch(t){var i=r.navigator,s=i&&i.plugins;return[+new Date,r,s,r.screen,p(e)]}}():l,3),g),v=new c(g),b=function(){for(var e=v.g(6),t=s,r=0;e<a;)e=(e+r)*n,t*=n,r=v.g(1);for(;e>=o;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|v.g(4)},b.quick=function(){return v.g(4)/4294967296},b.double=b,u(p(v.S),e),(f.pass||m||function(e,r,n,s){return s&&(s.S&&h(s,v),e.state=function(){return h(v,{})}),n?(t[i]=e,r):e})(b,y,"global"in f?f.global:this==t,f.state)},u(t.random(),e)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null;function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||"boolean"===e||"string"===e||t instanceof Number}function $bm_neg(e){var t=_typeof(e);if("number"===t||"boolean"===t||e instanceof Number)return-e;if($bm_isInstanceOfArray(e)){var r,n=e.length,i=[];for(r=0;r<n;r+=1)i[r]=-e[r];return i}return e.propType?e.v:-e}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(e,t){var r=_typeof(e),n=_typeof(t);if("string"===r||"string"===n)return e+t;if(isNumerable(r,e)&&isNumerable(n,t))return e+t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]+=t,e;if(isNumerable(r,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e+t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,s=e.length,a=t.length,o=[];i<s||i<a;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?o[i]=e[i]+t[i]:o[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return o}return 0}var add=sum;function sub(e,t){var r=_typeof(e),n=_typeof(t);if(isNumerable(r,e)&&isNumerable(n,t))return"string"===r&&(e=parseInt(e,10)),"string"===n&&(t=parseInt(t,10)),e-t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]-=t,e;if(isNumerable(r,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e-t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,s=e.length,a=t.length,o=[];i<s||i<a;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?o[i]=e[i]-t[i]:o[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return o}return 0}function mul(e,t){var r,n,i,s=_typeof(e),a=_typeof(t);if(isNumerable(s,e)&&isNumerable(a,t))return e*t;if($bm_isInstanceOfArray(e)&&isNumerable(a,t)){for(i=e.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e[n]*t;return r}if(isNumerable(s,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e*t[n];return r}return 0}function div(e,t){var r,n,i,s=_typeof(e),a=_typeof(t);if(isNumerable(s,e)&&isNumerable(a,t))return e/t;if($bm_isInstanceOfArray(e)&&isNumerable(a,t)){for(i=e.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e[n]/t;return r}if(isNumerable(s,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e/t[n];return r}return 0}function mod(e,t){return"string"==typeof e&&(e=parseInt(e,10)),"string"==typeof t&&(t=parseInt(t,10)),e%t}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(e,t,r){if(t>r){var n=r;r=t,t=n}return Math.min(Math.max(e,t),r)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if("number"==typeof e||e instanceof Number)return t=t||0,Math.abs(e-t);var r;t||(t=helperLengthArray);var n=Math.min(e.length,t.length),i=0;for(r=0;r<n;r+=1)i+=Math.pow(t[r]-e[r],2);return Math.sqrt(i)}function normalize(e){return div(e,length(e))}function rgbToHsl(e){var t,r,n=e[0],i=e[1],s=e[2],a=Math.max(n,i,s),o=Math.min(n,i,s),l=(a+o)/2;if(a===o)t=0,r=0;else{var c=a-o;switch(r=l>.5?c/(2-a-o):c/(a+o),a){case n:t=(i-s)/c+(i<s?6:0);break;case i:t=(s-n)/c+2;break;case s:t=(n-i)/c+4}t/=6}return[t,r,l,e[3]]}function hue2rgb(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function hslToRgb(e){var t,r,n,i=e[0],s=e[1],a=e[2];if(0===s)t=a,n=a,r=a;else{var o=a<.5?a*(1+s):a+s-a*s,l=2*a-o;t=hue2rgb(l,o,i+1/3),r=hue2rgb(l,o,i),n=hue2rgb(l,o,i-1/3)}return[t,r,n,e[3]]}function linear(e,t,r,n,i){if(void 0!==n&&void 0!==i||(n=t,i=r,t=0,r=1),r<t){var s=r;r=t,t=s}if(e<=t)return n;if(e>=r)return i;var a,o=r===t?0:(e-t)/(r-t);if(!n.length)return n+(i-n)*o;var l=n.length,c=createTypedArray("float32",l);for(a=0;a<l;a+=1)c[a]=n[a]+(i[a]-n[a])*o;return c}function random(e,t){if(void 0===t&&(void 0===e?(e=0,t=1):(t=e,e=void 0)),t.length){var r,n=t.length;e||(e=createTypedArray("float32",n));var i=createTypedArray("float32",n),s=BMMath.random();for(r=0;r<n;r+=1)i[r]=e[r]+s*(t[r]-e[r]);return i}return void 0===e&&(e=0),e+BMMath.random()*(t-e)}function createPath(e,t,r,n){var i,s=e.length,a=shapePool.newElement();a.setPathData(!!n,s);var o,l,c=[0,0];for(i=0;i<s;i+=1)o=t&&t[i]?t[i]:c,l=r&&r[i]?r[i]:c,a.setTripleAt(e[i][0],e[i][1],l[0]+e[i][0],l[1]+e[i][1],o[0]+e[i][0],o[1]+e[i][1],i,!0);return a}function initiateExpression(elem,data,property){function noOp(e){return e}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(e,t){var r,n,i=this.pv.length?this.pv.length:1,s=createTypedArray("float32",i),a=Math.floor(5*time);for(r=0,n=0;r<a;){for(n=0;n<i;n+=1)s[n]+=-t+2*t*BMMath.random();r+=1}var o=5*time,l=o-Math.floor(o),c=createTypedArray("float32",i);if(i>1){for(n=0;n<i;n+=1)c[n]=this.pv[n]+s[n]+(-t+2*t*BMMath.random())*l;return c}return this.pv+s[0]+(-t+2*t*BMMath.random())*l}.bind(this);function loopInDuration(e,t){return loopIn(e,t,!0)}function loopOutDuration(e,t){return loopOut(e,t,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(e,t){var r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],n=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,n,0]}function easeOut(e,t,r,n,i){return applyEase(easeOutBez,e,t,r,n,i)}function easeIn(e,t,r,n,i){return applyEase(easeInBez,e,t,r,n,i)}function ease(e,t,r,n,i){return applyEase(easeInOutBez,e,t,r,n,i)}function applyEase(e,t,r,n,i,s){void 0===i?(i=r,s=n):t=(t-r)/(n-r),t>1?t=1:t<0&&(t=0);var a=e(t);if($bm_isInstanceOfArray(i)){var o,l=i.length,c=createTypedArray("float32",l);for(o=0;o<l;o+=1)c[o]=(s[o]-i[o])*a+i[o];return c}return(s-i)*a+i}function nearestKey(e){var t,r,n,i=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(e*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,n=data.k[0].t;else{for(t=0;t<i-1;t+=1){if(e===data.k[t].t){r=t+1,n=data.k[t].t;break}if(e>data.k[t].t&&e<data.k[t+1].t){e-data.k[t].t>data.k[t+1].t-e?(r=t+2,n=data.k[t+1].t):(r=t+1,n=data.k[t].t);break}}-1===r&&(r=t+1,n=data.k[t].t)}else r=0,n=0;var s={};return s.index=r,s.time=n/elem.comp.globalData.frameRate,s}function key(e){var t,r,n;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var i=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(n=i.length,r=0;r<n;r+=1)t[r]=i[r],t.value[r]=i[r];return t}function framesToTime(e,t){return t||(t=elem.comp.globalData.frameRate),e/t}function timeToFrames(e,t){return e||0===e||(e=time),t||(t=elem.comp.globalData.frameRate),e*t}function seedRandom(e){BMMath.seedrandom(randSeed+e)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(e,t){return"string"==typeof value?void 0===t?value.substring(e):value.substring(e,t):""}function substr(e,t){return"string"==typeof value?void 0===t?value.substr(e):value.substr(e,t):""}function posterizeTime(e){time=0===e?0:Math.floor(time*e)/e,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(e){return value=e,this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath],ob}(),expressionHelpers={searchExpressions:function(e,t,r){t.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(e,t,r).bind(r)))},getSpeedAtTime:function(e){var t=this.getValueAtTime(e),r=this.getValueAtTime(e+-.01),n=0;if(t.length){var i;for(i=0;i<t.length;i+=1)n+=Math.pow(r[i]-t[i],2);n=100*Math.sqrt(n)}else n=0;return n},getVelocityAtTime:function(e){if(void 0!==this.vel)return this.vel;var t,r,n=-.001,i=this.getValueAtTime(e),s=this.getValueAtTime(e+n);if(i.length)for(t=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)t[r]=(s[r]-i[r])/n;else t=(s-i)/n;return t},getValueAtTime:function(e){return e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<e?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(e,this._cachingAtTime),this._cachingAtTime.lastFrame=e),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(e){this.propertyGroup=e}};function addPropertyDecorator(){function e(e,t,r){if(!this.k||!this.keyframes)return this.pv;e=e?e.toLowerCase():"";var n,i,s,a,o,l=this.comp.renderedFrame,c=this.keyframes,h=c[c.length-1].t;if(l<=h)return this.pv;if(r?i=h-(n=t?Math.abs(h-this.elem.comp.globalData.frameRate*t):Math.max(0,h-this.elem.data.ip)):((!t||t>c.length-1)&&(t=c.length-1),n=h-(i=c[c.length-1-t].t)),"pingpong"===e){if(Math.floor((l-i)/n)%2!=0)return this.getValueAtTime((n-(l-i)%n+i)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var d=this.getValueAtTime(i/this.comp.globalData.frameRate,0),u=this.getValueAtTime(h/this.comp.globalData.frameRate,0),p=this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0),f=Math.floor((l-i)/n);if(this.pv.length){for(a=(o=new Array(d.length)).length,s=0;s<a;s+=1)o[s]=(u[s]-d[s])*f+p[s];return o}return(u-d)*f+p}if("continue"===e){var m=this.getValueAtTime(h/this.comp.globalData.frameRate,0),g=this.getValueAtTime((h-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(a=(o=new Array(m.length)).length,s=0;s<a;s+=1)o[s]=m[s]+(m[s]-g[s])*((l-h)/this.comp.globalData.frameRate)/5e-4;return o}return m+(l-h)/.001*(m-g)}}return this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0)}function t(e,t,r){if(!this.k)return this.pv;e=e?e.toLowerCase():"";var n,i,s,a,o,l=this.comp.renderedFrame,c=this.keyframes,h=c[0].t;if(l>=h)return this.pv;if(r?i=h+(n=t?Math.abs(this.elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-h)):((!t||t>c.length-1)&&(t=c.length-1),n=(i=c[t].t)-h),"pingpong"===e){if(Math.floor((h-l)/n)%2==0)return this.getValueAtTime(((h-l)%n+h)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var d=this.getValueAtTime(h/this.comp.globalData.frameRate,0),u=this.getValueAtTime(i/this.comp.globalData.frameRate,0),p=this.getValueAtTime((n-(h-l)%n+h)/this.comp.globalData.frameRate,0),f=Math.floor((h-l)/n)+1;if(this.pv.length){for(a=(o=new Array(d.length)).length,s=0;s<a;s+=1)o[s]=p[s]-(u[s]-d[s])*f;return o}return p-(u-d)*f}if("continue"===e){var m=this.getValueAtTime(h/this.comp.globalData.frameRate,0),g=this.getValueAtTime((h+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(a=(o=new Array(m.length)).length,s=0;s<a;s+=1)o[s]=m[s]+(m[s]-g[s])*(h-l)/.001;return o}return m+(m-g)*(h-l)/.001}}return this.getValueAtTime((n-((h-l)%n+h))/this.comp.globalData.frameRate,0)}function r(e,t){if(!this.k)return this.pv;if(e=.5*(e||.4),(t=Math.floor(t||5))<=1)return this.pv;var r,n,i=this.comp.renderedFrame/this.comp.globalData.frameRate,s=i-e,a=t>1?(i+e-s)/(t-1):1,o=0,l=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<t;){if(n=this.getValueAtTime(s+o*a),this.pv.length)for(l=0;l<this.pv.length;l+=1)r[l]+=n[l];else r+=n;o+=1}if(this.pv.length)for(l=0;l<this.pv.length;l+=1)r[l]/=t;else r/=t;return r}function n(e){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var t=this._transformCachingAtTime.v;if(t.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(e);t.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var n=this.s.getValueAtTime(e);t.scale(n[0]*this.s.mult,n[1]*this.s.mult,n[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var i=this.sk.getValueAtTime(e),s=this.sa.getValueAtTime(e);t.skewFromAxis(-i*this.sk.mult,s*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var a=this.r.getValueAtTime(e);t.rotate(-a*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(e),l=this.ry.getValueAtTime(e),c=this.rx.getValueAtTime(e),h=this.or.getValueAtTime(e);t.rotateZ(-o*this.rz.mult).rotateY(l*this.ry.mult).rotateX(c*this.rx.mult).rotateZ(-h[2]*this.or.mult).rotateY(h[1]*this.or.mult).rotateX(h[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var d=this.px.getValueAtTime(e),u=this.py.getValueAtTime(e);if(this.data.p.z){var p=this.pz.getValueAtTime(e);t.translate(d*this.px.mult,u*this.py.mult,-p*this.pz.mult)}else t.translate(d*this.px.mult,u*this.py.mult,0)}else{var f=this.p.getValueAtTime(e);t.translate(f[0]*this.p.mult,f[1]*this.p.mult,-f[2]*this.p.mult)}return t}function i(){return this.v.clone(new Matrix)}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(e,t,r){var a=s(e,t,r);return a.dynamicProperties.length?a.getValueAtTime=n.bind(a):a.getValueAtTime=i.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a};var a=PropertyFactory.getProp;PropertyFactory.getProp=function(n,i,s,o,l){var c=a(n,i,s,o,l);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=e,c.loopIn=t,c.smooth=r,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=1===i.a?i.k.length:0,c.propertyIndex=i.ix;var h=0;return 0!==s&&(h=createTypedArray("float32",1===i.a?i.k[0].s.length:i.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:h},expressionHelpers.searchExpressions(n,i,c),c.k&&l.addDynamicProperty(c),c};var o=ShapePropertyFactory.getConstructorFunction(),l=ShapePropertyFactory.getKeyframedConstructorFunction();function c(){}c.prototype={vertices:function(e,t){this.k&&this.getValue();var r,n=this.v;void 0!==t&&(n=this.getValueAtTime(t,0));var i=n._length,s=n[e],a=n.v,o=createSizedArray(i);for(r=0;r<i;r+=1)o[r]="i"===e||"o"===e?[s[r][0]-a[r][0],s[r][1]-a[r][1]]:[s[r][0],s[r][1]];return o},points:function(e){return this.vertices("v",e)},inTangents:function(e){return this.vertices("i",e)},outTangents:function(e){return this.vertices("o",e)},isClosed:function(){return this.v.c},pointOnPath:function(e,t){var r=this.v;void 0!==t&&(r=this.getValueAtTime(t,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var n,i=this._segmentsLength,s=i.lengths,a=i.totalLength*e,o=0,l=s.length,c=0;o<l;){if(c+s[o].addedLength>a){var h=o,d=r.c&&o===l-1?0:o+1,u=(a-c)/s[o].addedLength;n=bez.getPointInSegment(r.v[h],r.v[d],r.o[h],r.i[d],u,s[o]);break}c+=s[o].addedLength,o+=1}return n||(n=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),n},vectorOnPath:function(e,t,r){1==e?e=this.v.c:0==e&&(e=.999);var n=this.pointOnPath(e,t),i=this.pointOnPath(e+.001,t),s=i[0]-n[0],a=i[1]-n[1],o=Math.sqrt(Math.pow(s,2)+Math.pow(a,2));return 0===o?[0,0]:"tangent"===r?[s/o,a/o]:[-a/o,s/o]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([c],o),extendPrototype([c],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<e?this._caching.lastIndex:0,this._cachingAtTime.lastTime=e,this.interpolateShape(e,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},l.prototype.initiateExpression=ExpressionManager.initiateExpression;var h=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(e,t,r,n,i){var s=h(e,t,r,n,i);return s.propertyIndex=t.ix,s.lock=!1,3===r?expressionHelpers.searchExpressions(e,t.pt,s):4===r&&expressionHelpers.searchExpressions(e,t.ks,s),s.k&&e.addDynamicProperty(s),s}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(e,t){var r=this.calculateExpression(t);if(e.t!==r){var n={};return this.copyData(n,e),n.t=r.toString(),n.__complete=!1,n}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function(e,t){var r,n,i=createNS("feMerge");for(i.setAttribute("result",e),n=0;n<t.length;n+=1)(r=createNS("feMergeNode")).setAttribute("in",t[n]),i.appendChild(r),i.appendChild(r);return i}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(e,t,r,n,i){this.filterManager=t;var s=createNS("feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=s,s.setAttribute("result",n+"_tint_1"),e.appendChild(s),(s=createNS("feColorMatrix")).setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),s.setAttribute("result",n+"_tint_2"),e.appendChild(s),this.matrixFilter=s;var a=this.createMergeNode(n,[i,n+"_tint_1",n+"_tint_2"]);e.appendChild(a)}function SVGFillFilter(e,t,r,n){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),i.setAttribute("result",n),e.appendChild(i),this.matrixFilter=i}function SVGStrokeEffect(e,t,r){this.initialized=!1,this.filterManager=t,this.elem=r,this.paths=[]}function SVGTritoneFilter(e,t,r,n){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),e.appendChild(i);var s=createNS("feComponentTransfer");s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",n),this.matrixFilter=s;var a=createNS("feFuncR");a.setAttribute("type","table"),s.appendChild(a),this.feFuncR=a;var o=createNS("feFuncG");o.setAttribute("type","table"),s.appendChild(o),this.feFuncG=o;var l=createNS("feFuncB");l.setAttribute("type","table"),s.appendChild(l),this.feFuncB=l,e.appendChild(s)}function SVGProLevelsFilter(e,t,r,n){this.filterManager=t;var i=this.filterManager.effectElements,s=createNS("feComponentTransfer");(i[10].p.k||0!==i[10].p.v||i[11].p.k||1!==i[11].p.v||i[12].p.k||1!==i[12].p.v||i[13].p.k||0!==i[13].p.v||i[14].p.k||1!==i[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",s)),(i[17].p.k||0!==i[17].p.v||i[18].p.k||1!==i[18].p.v||i[19].p.k||1!==i[19].p.v||i[20].p.k||0!==i[20].p.v||i[21].p.k||1!==i[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",s)),(i[24].p.k||0!==i[24].p.v||i[25].p.k||1!==i[25].p.v||i[26].p.k||1!==i[26].p.v||i[27].p.k||0!==i[27].p.v||i[28].p.k||1!==i[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",s)),(i[31].p.k||0!==i[31].p.v||i[32].p.k||1!==i[32].p.v||i[33].p.k||1!==i[33].p.v||i[34].p.k||0!==i[34].p.v||i[35].p.k||1!==i[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",s)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(s.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(s)),(i[3].p.k||0!==i[3].p.v||i[4].p.k||1!==i[4].p.v||i[5].p.k||1!==i[5].p.v||i[6].p.k||0!==i[6].p.v||i[7].p.k||1!==i[7].p.v)&&((s=createNS("feComponentTransfer")).setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",n),e.appendChild(s),this.feFuncRComposed=this.createFeFunc("feFuncR",s),this.feFuncGComposed=this.createFeFunc("feFuncG",s),this.feFuncBComposed=this.createFeFunc("feFuncB",s))}function SVGDropShadowEffect(e,t,r,n,i){var s=t.container.globalData.renderConfig.filterSize,a=t.data.fs||s;e.setAttribute("x",a.x||s.x),e.setAttribute("y",a.y||s.y),e.setAttribute("width",a.width||s.width),e.setAttribute("height",a.height||s.height),this.filterManager=t;var o=createNS("feGaussianBlur");o.setAttribute("in","SourceAlpha"),o.setAttribute("result",n+"_drop_shadow_1"),o.setAttribute("stdDeviation","0"),this.feGaussianBlur=o,e.appendChild(o);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",n+"_drop_shadow_1"),l.setAttribute("result",n+"_drop_shadow_2"),this.feOffset=l,e.appendChild(l);var c=createNS("feFlood");c.setAttribute("flood-color","#00ff00"),c.setAttribute("flood-opacity","1"),c.setAttribute("result",n+"_drop_shadow_3"),this.feFlood=c,e.appendChild(c);var h=createNS("feComposite");h.setAttribute("in",n+"_drop_shadow_3"),h.setAttribute("in2",n+"_drop_shadow_2"),h.setAttribute("operator","in"),h.setAttribute("result",n+"_drop_shadow_4"),e.appendChild(h);var d=this.createMergeNode(n,[n+"_drop_shadow_4",i]);e.appendChild(d)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+n+" 0"),this.matrixFilter.setAttribute("values",r[0]-t[0]+" 0 0 0 "+t[0]+" "+(r[1]-t[1])+" 0 0 0 "+t[1]+" "+(r[2]-t[2])+" 0 0 0 "+t[2]+" 0 0 0 1 0")}},SVGFillFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+t[0]+" 0 0 0 0 "+t[1]+" 0 0 0 0 "+t[2]+" 0 0 0 "+r+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var e,t,r,n,i=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(n=this.elem.maskManager.masksProperties.length,r=0):n=1+(r=this.filterManager.effectElements[0].p.v-1),(t=createNS("g")).setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1);r<n;r+=1)e=createNS("path"),t.appendChild(e),this.paths.push({p:e,m:r});if(3===this.filterManager.effectElements[10].p.v){var s=createNS("mask"),a=createElementID();s.setAttribute("id",a),s.setAttribute("mask-type","alpha"),s.appendChild(t),this.elem.globalData.defs.appendChild(s);var o=createNS("g");for(o.setAttribute("mask","url("+getLocationHref()+"#"+a+")");i[0];)o.appendChild(i[0]);this.elem.layerElement.appendChild(o),this.masker=s,t.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(i=this.elem.layerElement.children||this.elem.layerElement.childNodes;i.length;)this.elem.layerElement.removeChild(i[0]);this.elem.layerElement.appendChild(t),this.elem.layerElement.removeAttribute("mask"),t.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=t},SVGStrokeEffect.prototype.renderFrame=function(e){var t;this.initialized||this.initialize();var r,n,i=this.paths.length;for(t=0;t<i;t+=1)if(-1!==this.paths[t].m&&(r=this.elem.maskManager.viewData[this.paths[t].m],n=this.paths[t].p,(e||this.filterManager._mdf||r.prop._mdf)&&n.setAttribute("d",r.lastPath),e||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var s;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var a=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),o=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),l=n.getTotalLength();s="0 0 0 "+l*a+" ";var c,h=l*(o-a),d=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,u=Math.floor(h/d);for(c=0;c<u;c+=1)s+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";s+="0 "+10*l+" 0 0"}else s="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;n.setAttribute("stroke-dasharray",s)}if((e||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(e||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(e||this.filterManager.effectElements[3].p._mdf)){var p=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*p[0])+","+bmFloor(255*p[1])+","+bmFloor(255*p[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v,i=n[0]+" "+r[0]+" "+t[0],s=n[1]+" "+r[1]+" "+t[1],a=n[2]+" "+r[2]+" "+t[2];this.feFuncR.setAttribute("tableValues",i),this.feFuncG.setAttribute("tableValues",s),this.feFuncB.setAttribute("tableValues",a)}},SVGProLevelsFilter.prototype.createFeFunc=function(e,t){var r=createNS(e);return r.setAttribute("type","table"),t.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(e,t,r,n,i){for(var s,a,o=0,l=Math.min(e,t),c=Math.max(e,t),h=Array.call(null,{length:256}),d=0,u=i-n,p=t-e;o<=256;)a=(s=o/256)<=l?p<0?i:n:s>=c?p<0?n:i:n+u*Math.pow((s-e)/p,1/r),h[d]=a,d+=1,o+=256/255;return h.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,r=this.filterManager.effectElements;this.feFuncRComposed&&(e||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(t=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(t=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(t=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(t=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(t=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",t))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*t[0]),Math.round(255*t[1]),Math.round(255*t[2])))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,n=(this.filterManager.effectElements[2].p.v-90)*degToRads,i=r*Math.cos(n),s=r*Math.sin(n);this.feOffset.setAttribute("dx",i),this.feOffset.setAttribute("dy",s)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,r){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=r,r.matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGGaussianBlurEffect(e,t,r,n){e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width","300%"),e.setAttribute("height","300%"),this.filterManager=t;var i=createNS("feGaussianBlur");i.setAttribute("result",n),e.appendChild(i),this.feGaussianBlur=i}return SVGMatte3Effect.prototype.findSymbol=function(e){for(var t=0,r=_svgMatteSymbols.length;t<r;){if(_svgMatteSymbols[t]===e)return _svgMatteSymbols[t];t+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(e,t){var r=e.layerElement.parentNode;if(r){for(var n,i=r.children,s=0,a=i.length;s<a&&i[s]!==e.layerElement;)s+=1;s<=a-2&&(n=i[s+1]);var o=createNS("use");o.setAttribute("href","#"+t),n?r.insertBefore(o,n):r.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(e,t){if(!this.findSymbol(t)){var r=createElementID(),n=createNS("mask");n.setAttribute("id",t.layerId),n.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(t);var i=e.globalData.defs;i.appendChild(n);var s=createNS("symbol");s.setAttribute("id",r),this.replaceInParent(t,r),s.appendChild(t.layerElement),i.appendChild(s);var a=createNS("use");a.setAttribute("href","#"+r),n.appendChild(a),t.data.hd=!1,t.show()}e.setMatte(t.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var e=this.filterManager.effectElements[0].p.v,t=this.elem.comp.elements,r=0,n=t.length;r<n;)t[r]&&t[r].data.ind===e&&this.setElementAsMask(this.elem,t[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGGaussianBlurEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=3==r?0:t,i=2==r?0:t;this.feGaussianBlur.setAttribute("stdDeviation",n+" "+i);var s=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",s)}},registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect(20,SVGTintFilter,!0),registerEffect(21,SVGFillFilter,!0),registerEffect(22,SVGStrokeEffect,!1),registerEffect(23,SVGTritoneFilter,!0),registerEffect(24,SVGProLevelsFilter,!0),registerEffect(25,SVGDropShadowEffect,!0),registerEffect(28,SVGMatte3Effect,!1),registerEffect(29,SVGGaussianBlurEffect,!0),lottie},module.exports=factory())})(lottie$1,lottie$1.exports);var lottie=lottie$1.exports,v="5.7.4",fr=24,ip=0,op=24,w=1080,h=1080,nm="Loading animation",ddd=0,assets=[{id:"comp_0",layers:[{ddd:0,ind:1,ty:1,nm:"Light Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[540,541.688,0],ix:2,l:2},a:{a:0,k:[540,540,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,hasMask:!0,masksProperties:[{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:25,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[364.9,189.65],[296.6,189.65],[295.9,190.35],[295.9,455.55],[296.6,456.25],[364.9,456.25],[365.6,455.55],[365.6,190.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:34.417,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[364.9,249.65],[296.6,249.65],[295.9,250.35],[295.9,515.55],[296.6,516.25],[364.9,516.25],[365.6,515.55],[365.6,250.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:119.167,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[364.9,249.65],[296.6,249.65],[295.9,250.35],[295.9,515.55],[296.6,516.25],[364.9,516.25],[365.6,515.55],[365.6,250.35]],c:!0}]},{t:128.5830078125,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[364.9,189.65],[296.6,189.65],[295.9,190.35],[295.9,455.55],[296.6,456.25],[364.9,456.25],[365.6,455.55],[365.6,190.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 1"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:28.767,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[504.4,189.65],[436.1,189.65],[435.4,190.35],[435.4,581.05],[436.1,581.75],[504.4,581.75],[505.1,581.05],[505.1,190.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:38.184,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[504.4,124.087],[436.1,124.087],[435.4,124.788],[435.4,515.487],[436.1,516.188],[504.4,516.188],[505.1,515.487],[505.1,124.788]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:122.934,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[504.4,124.087],[436.1,124.087],[435.4,124.788],[435.4,515.487],[436.1,516.188],[504.4,516.188],[505.1,515.487],[505.1,124.788]],c:!0}]},{t:132.349609375,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[504.4,189.65],[436.1,189.65],[435.4,190.35],[435.4,581.05],[436.1,581.75],[504.4,581.75],[505.1,581.05],[505.1,190.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 2"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:34.417,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[643.9,189.65],[575.6,189.65],[574.9,190.35],[574.9,455.55],[575.6,456.25],[643.9,456.25],[644.6,455.55],[644.6,190.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:43.833,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[643.9,250.4],[575.6,250.4],[574.9,251.1],[574.9,516.3],[575.6,517],[643.9,517],[644.6,516.3],[644.6,251.1]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:128.583,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[643.9,250.4],[575.6,250.4],[574.9,251.1],[574.9,516.3],[575.6,517],[643.9,517],[644.6,516.3],[644.6,251.1]],c:!0}]},{t:138,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[643.9,189.65],[575.6,189.65],[574.9,190.35],[574.9,455.55],[575.6,456.25],[643.9,456.25],[644.6,455.55],[644.6,190.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 3"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:41.95,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[.1,-.4]],v:[[783.3,189.65],[715,189.65],[714.3,190.35],[714.3,455.55],[715,456.25],[783.3,456.25],[784,455.55],[784,190.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:51.366,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[.1,-.4]],v:[[783.3,250.025],[715,250.025],[714.3,250.725],[714.3,515.925],[715,516.625],[783.3,516.625],[784,515.925],[784,250.725]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:119.167,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[.1,-.4]],v:[[783.3,250.025],[715,250.025],[714.3,250.725],[714.3,515.925],[715,516.625],[783.3,516.625],[784,515.925],[784,250.725]],c:!0}]},{t:128.5830078125,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[.1,-.4]],v:[[783.3,189.65],[715,189.65],[714.3,190.35],[714.3,455.55],[715,456.25],[783.3,456.25],[784,455.55],[784,190.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 4"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:38.184,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.3]],v:[[643.9,623.65],[575.6,623.65],[574.9,624.35],[574.9,889.55],[575.6,890.25],[643.9,890.25],[644.6,889.55],[644.6,624.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:47.6,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.3]],v:[[643.9,559.963],[575.6,559.963],[574.9,560.662],[574.9,825.862],[575.6,826.562],[643.9,826.562],[644.6,825.862],[644.6,560.662]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:122.934,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.3]],v:[[643.9,559.963],[575.6,559.963],[574.9,560.662],[574.9,825.862],[575.6,826.562],[643.9,826.562],[644.6,825.862],[644.6,560.662]],c:!0}]},{t:132.349609375,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.3]],v:[[643.9,623.65],[575.6,623.65],[574.9,624.35],[574.9,889.55],[575.6,890.25],[643.9,890.25],[644.6,889.55],[644.6,624.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 5"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:38.184,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4]],v:[[715,890.35],[783.3,890.35],[784,889.65],[784,498.85],[783.3,498.15],[715,498.15],[714.3,498.85],[714.3,889.55]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:47.6,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4]],v:[[715,952.225],[783.3,952.225],[784,951.525],[784,560.725],[783.3,560.025],[715,560.025],[714.3,560.725],[714.3,951.425]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:122.934,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4]],v:[[715,952.225],[783.3,952.225],[784,951.525],[784,560.725],[783.3,560.025],[715,560.025],[714.3,560.725],[714.3,951.425]],c:!0}]},{t:132.349609375,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4]],v:[[715,890.35],[783.3,890.35],[784,889.65],[784,498.85],[783.3,498.15],[715,498.15],[714.3,498.85],[714.3,889.55]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 6"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:34.417,s:[{i:[[-.3,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[436,890.35],[504.3,890.35],[505,889.65],[505,624.45],[504.3,623.75],[436,623.75],[435.3,624.45],[435.3,889.65]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:43.833,s:[{i:[[-.3,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[436,826.85],[504.3,826.85],[505,826.15],[505,560.95],[504.3,560.25],[436,560.25],[435.3,560.95],[435.3,826.15]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:119.167,s:[{i:[[-.3,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[436,826.85],[504.3,826.85],[505,826.15],[505,560.95],[504.3,560.25],[436,560.25],[435.3,560.95],[435.3,826.15]],c:!0}]},{t:128.5830078125,s:[{i:[[-.3,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[436,890.35],[504.3,890.35],[505,889.65],[505,624.45],[504.3,623.75],[436,623.75],[435.3,624.45],[435.3,889.65]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 7"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:28.767,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[296.6,890.35],[364.9,890.35],[365.6,889.65],[365.6,624.45],[364.9,623.75],[296.6,623.75],[295.9,624.45],[295.9,889.65]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:38.184,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[296.6,826.538],[364.9,826.538],[365.6,825.838],[365.6,560.638],[364.9,559.938],[296.6,559.938],[295.9,560.638],[295.9,825.838]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:122.934,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[296.6,826.538],[364.9,826.538],[365.6,825.838],[365.6,560.638],[364.9,559.938],[296.6,559.938],[295.9,560.638],[295.9,825.838]],c:!0}]},{t:132.349609375,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[296.6,890.35],[364.9,890.35],[365.6,889.65],[365.6,624.45],[364.9,623.75],[296.6,623.75],[295.9,624.45],[295.9,889.65]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 8"}],sw:1080,sh:1080,sc:"#d8d8d8",ip:0,op:169,st:0,bm:0}]}],layers=[{ddd:0,ind:1,ty:0,nm:"LogoTestAnim",refId:"comp_0",sr:.14201183431953,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[540,540,0],ix:2,l:2},a:{a:0,k:[540,540,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,w:1080,h:1080,ip:0,op:24,st:0,bm:0}],markers=[],animationData={v:v,fr:fr,ip:ip,op:op,w:w,h:h,nm:nm,ddd:ddd,assets:assets,layers:layers,markers:markers},WebsocketState;class ArcwareLogoLoader{constructor(){this.arcwareLogoLoader=this.createArcwareLogoLoader()}createArcwareLogoLoader(){var e;const t=document.createElement("div");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("arcware-logo-loader"),t&&(lottie.destroy(),lottie.loadAnimation({container:t,animationData:animationData})),t}}class MicrophoneOverlay{constructor(e){this.overlay=null,this.stream=e,this.micIcon=new MicIcon,this.parentElement=null==e?void 0:e.videoElementParent}createOverlay(){var e,t;if(this.parentElement){this.overlay&&(this.parentElement.removeChild(this.overlay),this.overlay=null),this.overlay=document.createElement("div"),this.overlay.id="microphoneOverlay",null===(t=null===(e=this.overlay)||void 0===e?void 0:e.classList)||void 0===t||t.add("hiddenState"),this.overlay.appendChild(this.micIcon.micIconUnmuted),this.overlay.appendChild(this.micIcon.micIconMuted),this.micIcon.micIconMuted.style.display="none";const r=document.createElement("div");r.className="title",r.textContent="Enabling microphone...";const n=document.createElement("p");n.textContent="Please check your browser's prompt to allow microphone access. You may also need to re-enable the sound.",this.overlay.appendChild(r),this.overlay.appendChild(n),this.parentElement.appendChild(this.overlay)}}toggleMessage(e){if(this.parentElement&&this.overlay){const t=this.overlay.querySelector(".title"),r=this.overlay.querySelector("p");this.micIcon.micIconMuted.style.display=e?"none":"block",this.micIcon.micIconUnmuted.style.display=e?"block":"none",t&&(t.textContent=e?"Enabling microphone":"Disabling microphone"),r&&(r.textContent=e?"Please check your browser's prompt to allow microphone access. You may also need to re-enable the sound.":"Please wait. You may need to re-enable the sound.")}}toggleVisibility(e){var t,r,n,i,s,a,o,l,c,h,d,u,p;if(this.parentElement){const f=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#infoOverlay"),m=null===(r=null==this?void 0:this.parentElement)||void 0===r?void 0:r.querySelector("#disconnectOverlay"),g=null===(n=null==this?void 0:this.parentElement)||void 0===n?void 0:n.querySelector("#errorOverlay"),y="mic-overlay-is-visible";this.overlay&&f&&m&&g&&(e?(null===(i=null==f?void 0:f.classList)||void 0===i||i.add(y),null===(s=null==m?void 0:m.classList)||void 0===s||s.add(y),null===(a=null==g?void 0:g.classList)||void 0===a||a.add(y),null===(l=null===(o=null==this?void 0:this.overlay)||void 0===o?void 0:o.classList)||void 0===l||l.remove("hiddenState")):(null===(h=null===(c=null==this?void 0:this.overlay)||void 0===c?void 0:c.classList)||void 0===h||h.add("hiddenState"),null===(d=null==f?void 0:f.classList)||void 0===d||d.remove(y),null===(u=null==m?void 0:m.classList)||void 0===u||u.remove(y),null===(p=null==g?void 0:g.classList)||void 0===p||p.remove(y)))}}}!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(WebsocketState||(WebsocketState={}));class ConnectionIdentifier{static get Instance(){return this.instance||(this.instance=new ConnectionIdentifier),this.instance}get WebsocketStates(){return this.aps.map((e=>e.websocketState))}constructor(){this.aps=[],this.enabled=!0}register(e){var t;this.aps.includes(e)||(this.aps.push(e),(null===(t=e.config.settings)||void 0===t?void 0:t.connectionIdentifierLoggingDisabled)&&this.disable()),this.interval||(this.interval=setInterval(this.connectionWatcher.bind(this),1e4))}GetWebSocketStates(){return this.aps.map((e=>e.websocketState))}ActiveInstances(){return this.GetWebSocketStates().filter((e=>e<=WebsocketState.OPEN)).length}disable(){this.enabled=!1}connectionWatcher(){if(!this.enabled)return;const e=this.GetWebSocketStates().filter((e=>e<=WebsocketState.OPEN));1===e.length?console.log("PixelStreaming Instance is connected."):0!==e.length&&console.warn(`${e.length} PixelStreaming Instances are connected!`)}}class ArcwarePixelStreaming extends jt{get WebsocketStates(){return ConnectionIdentifier.Instance.GetWebSocketStates()}get ActiveInstances(){return ConnectionIdentifier.Instance.ActiveInstances}get websocketState(){var e;return null===(e=this.webSocketController.webSocket)||void 0===e?void 0:e.readyState}constructor(e,t){ApplyUrlHack(),super(e,t),this.loveLettersQueue=[],this.isProcessingQueue=!1,this.queueHandler=new EventHandler,this.errorHandler=new EventHandler,this.loveLetterHandler=new EventHandler,this.sessionIdHandler=new EventHandler,this.videoInitializedHandler=new EventHandler,this.websocketOnCloseHandler=new EventHandler,this.config=e,this.webRtcController=this._webRtcController,this.loveLettersList=[],this.microphoneOverlay=new MicrophoneOverlay(this),this.wrapWebSocketOnCloseHandler(),this.handleResolutionChange=this.handleResolutionChange.bind(this),this.addMessageHandler("letter",ZLoveLetter,this.onLoveLetter),this.addMessageHandler("streamInfo",ZStreamInfo,this.onStreamInfo),this.addMessageHandler("sessionId",ZSessionId,this.onSessionId),this.addMessageHandler("error",ZErrorMessage,this.onError),this.addMessageHandler("ping",ZPing,this.onPing),this.addMessageHandler("queue",ZQueue,this.onQueue),this.addMessageHandler("version",ZVersion,this.onVersion);const r=lodash.exports.debounce((()=>{this.handleResolutionChange()}),500);this.addEventListener("videoInitialized",this.onVideoInitialized.bind(this)),this.addEventListener("statsReceived",(e=>{this.sendStats(e.data.aggregatedStats)})),window.addEventListener("resize",r),this.webRtcController.streamMessageController.registerMessageHandler(0,"TextboxEntry",(e=>{console.error("Incomplete handler: ToStreamer.TextboxEntry",e)})),this.initLoveLettersContainer(),this.createMicrophoneOverlay(),this.config.settings.errorHandler&&this.errorHandler.add(this.config.settings.errorHandler),this.config.settings.queueHandler&&this.queueHandler.add(this.config.settings.queueHandler),this.config.settings.sessionIdHandler&&this.sessionIdHandler.add(this.config.settings.sessionIdHandler),this.config.settings.loveLetterHandler&&this.loveLetterHandler.add(this.config.settings.loveLetterHandler),ConnectionIdentifier.Instance.register(this),this.removeXRIconIfDisabled(),this.handleMouseLock()}get session(){return this.config.session}onVersion(e){this.send({type:"version",version:this.config.VERSION})}onPing(e){var t,r;this.config.isFlagEnabled("HoveringMouse")!==!(null===(r=null===(t=null==this?void 0:this.streamInfo)||void 0===t?void 0:t.streamInfo.meta)||void 0===r?void 0:r.mouseLock)&&this.handleMouseLock(),this.session.current&&this.session.set(this.session.current)}onStreamInfo(e){var t,r,n,i;if(Vt.Info(Vt.GetStackTrace(),"StreamInfo received."),this.streamInfo=e,!(null===(r=null===(t=this.config)||void 0===t?void 0:t.settings)||void 0===r?void 0:r["do-not-eval-streamInfo"])){const{afk:t}=e.streamInfo;if(t){this.config.setFlagEnabled(Ot.AFKDetection,t.enabled),this.config.setNumericSetting($t.AFKTimeoutSecs,t.warn+t.error);const{afkController:e}=this.webRtcController;e.closeTimeout=t.action}(null===(n=e.streamInfo.webSdkSettings)||void 0===n?void 0:n.init)&&this.config.setSettings(e.streamInfo.webSdkSettings.init),(null===(i=e.streamInfo.webSdkSettings)||void 0===i?void 0:i.conf)&&Object.entries(e.streamInfo.webSdkSettings.conf).forEach((([e,t])=>{const r=e;this.config.settings[r]=t,"connectionIdentifierLoggingDisabled"===e&&!0===t&&ConnectionIdentifier.Instance.disable()}))}this.handleMouseLock(),this.injectCustomUI()}onQueue(e){Vt.Info(Vt.GetStackTrace(),"QueueInfo received."),EventHandler.Emit(this.queueHandler,e)}onError(e){Vt.Error(Vt.GetStackTrace(),e.type),EventHandler.Emit(this.errorHandler,e)}onLoveLetter(e){this.config.settings.loveLetterLogging&&console.info(e.reason),EventHandler.Emit(this.loveLetterHandler,e),this.pushLetter(e.reason)}onSessionId(e){Vt.Info(Vt.GetStackTrace(),e.sessionId),this.session.set(e.sessionId),EventHandler.Emit(this.sessionIdHandler,e.sessionId)}onVideoInitialized(){this.handleMouseLock(),this.send({type:"onVideoInitialized"}),EventHandler.Emit(this.videoInitializedHandler,void 0),this.handleResolutionChange(),this.handleRemoveLoveLetters(),this.microphoneOverlay.toggleVisibility(!1),this.applyResolutionIfPlaying(),this.removeXRIconIfDisabled()}addMessageHandler(e,t,r){this.webSocketController.signallingProtocol.addMessageHandler(e,(n=>{const i=t.safeParse(JSON.parse(n));if(i.success)r.call(this,i.data);else{const t=new Error(`Unexpected message content. Event:'${e}', ZodError: ${i.error.message}`);Vt.Error(t.stack,t.message)}}))}sendStats(e){const t={type:"stats",stats:Stats(e)};this.send(t)}send(e){if(Send[e.type]){const t=Send[e.type].safeParse(e);if(t.success)this.webSocketController.webSocket.send(JSON.stringify(t.data));else{const e=t;Vt.Error(Vt.GetStackTrace(),`Failed to send. ${e.error}`)}}else this.webSocketController.webSocket.send(JSON.stringify(e))}handleResolutionChange(){var e,t,r,n,i,s,a,o,l,c,h;if(!(null==this?void 0:this.streamInfo)||!(null==this?void 0:this.webRtcController)||!(null===(t=null===(e=null==this?void 0:this.webRtcController)||void 0===e?void 0:e.videoPlayer)||void 0===t?void 0:t.getVideoElement()))return;const d=null===(n=null===(r=null==this?void 0:this.streamInfo)||void 0===r?void 0:r.streamInfo)||void 0===n?void 0:n.resolution,u=null!==(o=null===(a=null===(s=null===(i=null==this?void 0:this.streamInfo)||void 0===i?void 0:i.streamInfo)||void 0===s?void 0:s.meta)||void 0===a?void 0:a.version)&&void 0!==o?o:null===(h=null===(c=null===(l=this.streamInfo)||void 0===l?void 0:l.streamInfo)||void 0===c?void 0:c.meta)||void 0===h?void 0:h.ueVersion;d&&(null==d?void 0:d.dynamic)&&setTimeout((()=>{var e;const{videoPlayer:t}=null==this?void 0:this.webRtcController,r=null==t?void 0:t.getVideoParentElement(),n=null==r?void 0:r.getBoundingClientRect().width,i=null==r?void 0:r.getBoundingClientRect().height,s=null==d?void 0:d.width,a=null==d?void 0:d.height,o=n/i;let l,c;if(o>s/a?(l=s,c=s/o):(c=a,l=a*o),t)if(!u||(null==u?void 0:u.startsWith("4.27"))){const t={Console:`r.setres ${Math.round(l)}x${Math.round(c)}w`};null===(e=null==this?void 0:this.webRtcController)||void 0===e||e.emitUIInteraction(t)}else t.onMatchViewportResolutionCallback(Math.round(l),Math.round(c))}),500)}applyResolutionIfPlaying(){var e;const t=null===(e=null==this?void 0:this.webRtcController)||void 0===e?void 0:e.videoPlayer.getVideoElement();t&&t.addEventListener("playing",(()=>{setTimeout((()=>{null==this||this.handleResolutionChange()}),1500)}))}removePlayer(){var e;null===(e=null==this?void 0:this.webSocketController)||void 0===e||e.close()}handleMouseLock(){var e,t,r;null===(e=null==this?void 0:this.config)||void 0===e||e.modifyInitialSettings(!(null===(r=null===(t=null==this?void 0:this.streamInfo)||void 0===t?void 0:t.streamInfo.meta)||void 0===r?void 0:r.mouseLock))}initLoveLettersContainer(){var e;const t=new ArcwareLogoLoader;if(!this.loveLettersContainer){const r=null===document||void 0===document?void 0:document.createElement("div"),{videoPlayer:n}=null==this?void 0:this.webRtcController,i=n.getVideoParentElement();null===(e=null==r?void 0:r.classList)||void 0===e||e.add("love-letters-box-root"),null==i||i.appendChild(r);const s=null===document||void 0===document?void 0:document.createElement("div");s.id="letters-block";const a=null===document||void 0===document?void 0:document.createElement("div");a.id="letters-wrapper",r&&(null==s||s.appendChild(null==t?void 0:t.arcwareLogoLoader),null==r||r.appendChild(s),null==s||s.appendChild(a)),s.innerHTML="",s&&(null==s||s.appendChild(null==t?void 0:t.arcwareLogoLoader),null==s||s.appendChild(a))}}pushLetter(e){var t;null===(t=null==this?void 0:this.loveLettersQueue)||void 0===t||t.push(e),this.isProcessingQueue||null==this||this.processLoveLetterQueue()}processLoveLetterQueue(){var e,t;this.isProcessingQueue=!0;const r=this.loveLettersQueue.shift();if(void 0!==r){const n=null==r?void 0:r.replace(/LL: |\.$/g,"");null===(e=null==this?void 0:this.loveLettersList)||void 0===e||e.push(n);const i=new LoveLetters;null==i||i.addLetter(n,null===(t=null==this?void 0:this.loveLettersList)||void 0===t?void 0:t.length),setTimeout((()=>{this.processLoveLetterQueue()}),1e3)}else this.isProcessingQueue=!1}handleRemoveLoveLetters(){const e=null===document||void 0===document?void 0:document.querySelector(".love-letters-box-root");setTimeout((()=>{var t;e&&(null===(t=null==e?void 0:e.classList)||void 0===t||t.add("fade-out"))}),1e3),setTimeout((()=>{var t;e&&(null==e?void 0:e.parentNode)&&(null===(t=null==e?void 0:e.parentNode)||void 0===t||t.removeChild(e))}),1600)}toggleAudio(e,t){var r,n;const{streamController:i}=this.webRtcController;e&&(e.muted=t,i&&(i.audioElement.muted=t,(null==e?void 0:e.currentTime)>0&&!(null==e?void 0:e.paused)&&(null===(r=null==i?void 0:i.audioElement)||void 0===r?void 0:r.paused)&&(null===(n=null==i?void 0:i.audioElement)||void 0===n||n.play())))}createMicrophoneOverlay(){var e;null===(e=null==this?void 0:this.microphoneOverlay)||void 0===e||e.createOverlay()}toggleMic(e,t){var r,n;null===(r=null==this?void 0:this.config)||void 0===r||r.setFlagEnabled(Ot.UseMic,e),t||(null===(n=null==this?void 0:this.microphoneOverlay)||void 0===n||n.toggleMessage(e),setTimeout((()=>{var e;null===(e=null==this?void 0:this.microphoneOverlay)||void 0===e||e.toggleVisibility(!0)}),200),setTimeout((()=>{var e;null===(e=null==this?void 0:this.webRtcController)||void 0===e||e.restartStreamAutomatically()}),1e3))}wrapWebSocketOnCloseHandler(){var e;(null===(e=null==this?void 0:this.webSocketController)||void 0===e?void 0:e.webSocket)&&(this.webSocketController.webSocket.onclose=e=>{var t;null===(t=null==this?void 0:this.webSocketController)||void 0===t||t.handleOnClose(e),EventHandler.Emit(this.websocketOnCloseHandler,e)})}onStreamingStateChange(e){var t,r,n,i,s,a;const o=null===(r=null===(t=null==this?void 0:this.webRtcController)||void 0===t?void 0:t.videoPlayer)||void 0===r?void 0:r.getVideoElement();null==o||o.addEventListener("play",(()=>e(!0))),null==o||o.addEventListener("pause",(()=>e(!1))),null==o||o.addEventListener("ended",(()=>e(!1)));const l=null===(i=null===(n=null==this?void 0:this.webSocketController)||void 0===n?void 0:n.webSocket)||void 0===i?void 0:i.onopen;this.webSocketController.webSocket.onopen=t=>{var r;null==l||l.call(null===(r=null==this?void 0:this.webSocketController)||void 0===r?void 0:r.webSocket,t),e(!0)};const c=null===(a=null===(s=null==this?void 0:this.webSocketController)||void 0===s?void 0:s.webSocket)||void 0===a?void 0:a.onclose;this.webSocketController.webSocket.onclose=t=>{var r;null==c||c.call(null===(r=null==this?void 0:this.webSocketController)||void 0===r?void 0:r.webSocket,t),e(!1)}}removeXRIconIfDisabled(){var e,t,r,n,i;if(!(null===(t=null===(e=null==this?void 0:this.config)||void 0===e?void 0:e.initialSettings)||void 0===t?void 0:t.XRControllerInput)&&(null===(r=null==this?void 0:this.config)||void 0===r||r.setFlagEnabled(Ot.XRControllerInput,!1),this.videoElementParent&&(null===(n=null==this?void 0:this.videoElementParent)||void 0===n?void 0:n.parentElement))){const e=null===(i=null==this?void 0:this.videoElementParent)||void 0===i?void 0:i.parentElement.querySelector("#xrBtn");null==e||e.remove()}}injectCustomUI(){var e;const t=null===document||void 0===document?void 0:document.getElementById("stream-ui"),r=null===(e=null==this?void 0:this.videoElementParent)||void 0===e?void 0:e.parentElement;t&&r&&(null==r||r.appendChild(t))}}var $=_export,assign=objectAssign;function ArcwareInit({shareId:e,projectId:t},r){if(e&&!e.startsWith("share-"))throw new Error(`Unexpected shareId-format: '${e}'.`);const n=new ArcwareConfig({useUrlParams:!0===(null==r?void 0:r.useUrlParams),initialSettings:Object.assign({ss:DefaultUrl,AutoConnect:!1,StartVideoMuted:!0,AutoPlayVideo:!0,KeyboardInput:!0,MouseInput:!0,GamepadInput:!1,TouchInput:!0,XRControllerInput:!1,UseMic:!0,SuppressBrowserKeys:!0,AFKTimeout:void 0,ControlsQuality:void 0,FakeMouseWithTouches:!1,ForceMonoAudio:!1,ForceTURN:void 0,HoveringMouse:!0,MatchViewportRes:void 0,MaxQP:void 0,MinQP:void 0,OfferToReceive:void 0,PreferredCodec:void 0,preferSFU:void 0,StreamerId:void 0,TimeoutIfIdle:void 0,WebRTCFPS:void 0,WebRTCMaxBitrate:void 0,WebRTCMinBitrate:void 0},null==r?void 0:r.initialSettings),settings:Object.assign({shareId:e,projectId:t,token:void 0,session:void 0,fullscreenButton:!0,audioButton:!0,stopButton:!1,infoButton:!1,micButton:!1,settingsButton:!1,connectionStrengthIcon:!1,connectionIdentifierLoggingDisabled:void 0,errorHandler:void 0,loveLetterHandler:void 0,loveLetterLogging:void 0,queueHandler:void 0,sessionIdHandler:void 0},null==r?void 0:r.settings)}),i=new ArcwarePixelStreaming(n);return{Config:n,PixelStreaming:i,Application:new ArcwareApplication({stream:i})}}$({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign},{assign:assign}),exports.AFKOverlay=q,exports.ActionOverlay=V,exports.AfkLogic=Ct,exports.AfkTimedOutEvent=ft,exports.AfkWarningActivateEvent=Tt,exports.AfkWarningDeactivateEvent=Et,exports.AfkWarningUpdateEvent=yt,exports.AggregatedStats=bt,exports.Application=G,exports.ArcwareApplication=ArcwareApplication,exports.ArcwareConfig=ArcwareConfig,exports.ArcwareInit=ArcwareInit,exports.ArcwarePixelStreaming=ArcwarePixelStreaming,exports.ArcwareStyles=ArcwareStyles,exports.CandidatePairStats=Mt,exports.CandidateStat=wt,exports.Config=Pt,exports.ConfigUI=J,exports.ConnectOverlay=Y,exports.ControlSchemeType=kt,exports.DataChannelCloseEvent=Rt,exports.DataChannelErrorEvent=Lt,exports.DataChannelOpenEvent=xt,exports.DataChannelStats=At,exports.DefaultUrl=DefaultUrl,exports.DisconnectOverlay=K,exports.EncoderSettings=Ft,exports.ErrorOverlay=$$9,exports.EventEmitter=Dt,exports.Flags=Ot,exports.HideFreezeFrameEvent=Ut,exports.InboundAudioStats=It,exports.InboundVideoStats=Gt,exports.InfoOverlay=tt,exports.InitialSettings=zt,exports.InitialSettingsEvent=Bt,exports.LatencyTestResultEvent=_t,exports.LatencyTestResults=Wt,exports.LoadFreezeFrameEvent=Ht,exports.Logger=Vt,exports.MessageRecv=Nt,exports.MessageSend=Kt,exports.MessageStreamerList=Qt,exports.NumericParameters=$t,exports.OptionParameters=qt,exports.OutBoundVideoStats=Xt,exports.OverlayBase=et,exports.PixelStreaming=jt,exports.PixelStreamingApplicationStyle=st,exports.PlayOverlay=it,exports.PlayStreamErrorEvent=Yt,exports.PlayStreamEvent=Jt,exports.PlayStreamRejectedEvent=Zt,exports.SettingBase=es,exports.SettingFlag=ts,exports.SettingNumber=ss,exports.SettingOption=ns$1,exports.SettingText=rs,exports.SettingUIBase=nt,exports.SettingUIFlag=ot,exports.SettingUINumber=lt,exports.SettingUIOption=at,exports.SettingUIText=rt,exports.SettingsChangedEvent=is,exports.SignallingProtocol=os,exports.StatsReceivedEvent=as,exports.StreamLoadingEvent=ds,exports.StreamerListMessageEvent=ls,exports.TextOverlay=ct,exports.TextParameters=cs,exports.UnquantizedAndDenormalizeUnsigned=hs,exports.VideoEncoderAvgQPEvent=gs,exports.VideoInitializedEvent=us,exports.WebRTCSettings=ms,exports.WebRtcAutoConnectEvent=Ss,exports.WebRtcConnectedEvent=ps,exports.WebRtcConnectingEvent=vs,exports.WebRtcDisconnectedEvent=Cs,exports.WebRtcFailedEvent=fs,exports.WebRtcPlayerController=Ts,exports.WebRtcSdpEvent=Es,exports.WebSocketController=ys,exports.WebXRController=bs,exports.XrFrameEvent=Ms,exports.XrSessionEndedEvent=ws,exports.XrSessionStartedEvent=Ps;
|
|
11
|
+
*/!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",a=16,o=32,l=64,c=128,h=256,d=1/0,u=9007199254740991,p=NaN,f=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",o],["partialRight",l],["rearg",h]],g="[object Arguments]",y="[object Array]",v="[object Boolean]",b="[object Date]",S="[object Error]",E="[object Function]",C="[object GeneratorFunction]",_="[object Map]",T="[object Number]",x="[object Object]",P="[object Promise]",w="[object RegExp]",I="[object Set]",k="[object String]",A="[object Symbol]",M="[object WeakMap]",R="[object ArrayBuffer]",O="[object DataView]",$="[object Float32Array]",D="[object Float64Array]",L="[object Int8Array]",F="[object Int16Array]",N="[object Int32Array]",B="[object Uint8Array]",V="[object Uint8ClampedArray]",U="[object Uint16Array]",z="[object Uint32Array]",j=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,K=RegExp(Z.source),Y=RegExp(W.source),q=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(re.source),ie=/^\s+/,se=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,Ce="\\ud800-\\udfff",_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Te="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",we="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="['’]",Ae="["+Ce+"]",Me="["+Ie+"]",Re="["+_e+"]",Oe="\\d+",$e="["+Te+"]",De="["+xe+"]",Le="[^"+Ce+Ie+Oe+Te+xe+Pe+"]",Fe="\\ud83c[\\udffb-\\udfff]",Ne="[^"+Ce+"]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Ve="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Pe+"]",ze="\\u200d",je="(?:"+De+"|"+Le+")",Ge="(?:"+Ue+"|"+Le+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",Ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Re+"|"+Fe+")"+"?",Ke="["+we+"]?",Ye=Ke+We+("(?:"+ze+"(?:"+[Ne,Be,Ve].join("|")+")"+Ke+We+")*"),qe="(?:"+[$e,Be,Ve].join("|")+")"+Ye,Qe="(?:"+[Ne+Re+"?",Re,Be,Ve,Ae].join("|")+")",Xe=RegExp(ke,"g"),Je=RegExp(Re,"g"),et=RegExp(Fe+"(?="+Fe+")|"+Qe+Ye,"g"),tt=RegExp([Ue+"?"+De+"+"+He+"(?="+[Me,Ue,"$"].join("|")+")",Ge+"+"+Ze+"(?="+[Me,Ue+je,"$"].join("|")+")",Ue+"?"+je+"+"+He,Ue+"+"+Ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,qe].join("|"),"g"),rt=RegExp("["+ze+Ce+_e+we+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,at={};at[$]=at[D]=at[L]=at[F]=at[N]=at[B]=at[V]=at[U]=at[z]=!0,at[g]=at[y]=at[R]=at[v]=at[O]=at[b]=at[S]=at[E]=at[_]=at[T]=at[x]=at[w]=at[I]=at[k]=at[M]=!1;var ot={};ot[g]=ot[y]=ot[R]=ot[O]=ot[v]=ot[b]=ot[$]=ot[D]=ot[L]=ot[F]=ot[N]=ot[_]=ot[T]=ot[x]=ot[w]=ot[I]=ot[k]=ot[A]=ot[B]=ot[V]=ot[U]=ot[z]=!0,ot[S]=ot[E]=ot[M]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,ht=parseInt,dt="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ut="object"==typeof self&&self&&self.Object===Object&&self,pt=dt||ut||Function("return this")(),ft=t&&!t.nodeType&&t,mt=ft&&e&&!e.nodeType&&e,gt=mt&&mt.exports===ft,yt=gt&&dt.process,vt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||yt&&yt.binding&&yt.binding("util")}catch(e){}}(),bt=vt&&vt.isArrayBuffer,St=vt&&vt.isDate,Et=vt&&vt.isMap,Ct=vt&&vt.isRegExp,_t=vt&&vt.isSet,Tt=vt&&vt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Pt(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i<s;){var a=e[i];t(n,a,r(a),e)}return n}function wt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function It(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function At(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}function Mt(e,t){return!!(null==e?0:e.length)&&Ut(e,t,0)>-1}function Rt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Ot(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function $t(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Dt(e,t,r,n){var i=-1,s=null==e?0:e.length;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function Lt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Ft(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Nt=Ht("length");function Bt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Vt(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function Ut(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Vt(e,jt,r)}function zt(e,t,r,n){for(var i=r-1,s=e.length;++i<s;)if(n(e[i],t))return i;return-1}function jt(e){return e!=e}function Gt(e,t){var r=null==e?0:e.length;return r?Kt(e,t)/r:p}function Ht(e){return function(t){return null==t?r:t[e]}}function Zt(e){return function(t){return null==e?r:e[t]}}function Wt(e,t,r,n,i){return i(e,(function(e,i,s){r=n?(n=!1,e):t(r,e,i,s)})),r}function Kt(e,t){for(var n,i=-1,s=e.length;++i<s;){var a=t(e[i]);a!==r&&(n=n===r?a:n+a)}return n}function Yt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function qt(e){return e?e.slice(0,pr(e)+1).replace(ie,""):e}function Qt(e){return function(t){return e(t)}}function Xt(e,t){return Ot(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function er(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function tr(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}var rr=Zt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=Zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function ir(e){return"\\"+lt[e]}function sr(e){return rt.test(e)}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function lr(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var o=e[r];o!==t&&o!==s||(e[r]=s,a[i++]=r)}return a}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function hr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function dr(e){return sr(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Nt(e)}function ur(e){return sr(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function pr(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var fr=Zt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var mr=function e(t){var se=(t=null==t?pt:mr.defaults(pt.Object(),t,mr.pick(pt,it))).Array,Ce=t.Date,_e=t.Error,Te=t.Function,xe=t.Math,Pe=t.Object,we=t.RegExp,Ie=t.String,ke=t.TypeError,Ae=se.prototype,Me=Te.prototype,Re=Pe.prototype,Oe=t["__core-js_shared__"],$e=Me.toString,De=Re.hasOwnProperty,Le=0,Fe=function(){var e=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ne=Re.toString,Be=$e.call(Pe),Ve=pt._,Ue=we("^"+$e.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=gt?t.Buffer:r,je=t.Symbol,Ge=t.Uint8Array,He=ze?ze.allocUnsafe:r,Ze=or(Pe.getPrototypeOf,Pe),We=Pe.create,Ke=Re.propertyIsEnumerable,Ye=Ae.splice,qe=je?je.isConcatSpreadable:r,Qe=je?je.iterator:r,et=je?je.toStringTag:r,rt=function(){try{var e=ds(Pe,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,dt=Ce&&Ce.now!==pt.Date.now&&Ce.now,ut=t.setTimeout!==pt.setTimeout&&t.setTimeout,ft=xe.ceil,mt=xe.floor,yt=Pe.getOwnPropertySymbols,vt=ze?ze.isBuffer:r,Nt=t.isFinite,Zt=Ae.join,gr=or(Pe.keys,Pe),yr=xe.max,vr=xe.min,br=Ce.now,Sr=t.parseInt,Er=xe.random,Cr=Ae.reverse,_r=ds(t,"DataView"),Tr=ds(t,"Map"),xr=ds(t,"Promise"),Pr=ds(t,"Set"),wr=ds(t,"WeakMap"),Ir=ds(Pe,"create"),kr=wr&&new wr,Ar={},Mr=Fs(_r),Rr=Fs(Tr),Or=Fs(xr),$r=Fs(Pr),Dr=Fs(wr),Lr=je?je.prototype:r,Fr=Lr?Lr.valueOf:r,Nr=Lr?Lr.toString:r;function Br(e){if(eo(e)&&!ja(e)&&!(e instanceof jr)){if(e instanceof zr)return e;if(De.call(e,"__wrapped__"))return Ns(e)}return new zr(e)}var Vr=function(){function e(){}return function(t){if(!Ja(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Ur(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function jr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Gr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Zr;++t<r;)this.add(e[t])}function Kr(e){var t=this.__data__=new Hr(e);this.size=t.size}function Yr(e,t){var r=ja(e),n=!r&&za(e),i=!r&&!n&&Wa(e),s=!r&&!n&&!i&&lo(e),a=r||n||i||s,o=a?Yt(e.length,Ie):[],l=o.length;for(var c in e)!t&&!De.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vs(c,l))||o.push(c);return o}function qr(e){var t=e.length;return t?e[Kn(0,t-1)]:r}function Qr(e,t){return $s(ki(e),on(t,0,e.length))}function Xr(e){return $s(ki(e))}function Jr(e,t,n){(n!==r&&!Ba(e[t],n)||n===r&&!(t in e))&&sn(e,t,n)}function en(e,t,n){var i=e[t];De.call(e,t)&&Ba(i,n)&&(n!==r||t in e)||sn(e,t,n)}function tn(e,t){for(var r=e.length;r--;)if(Ba(e[r][0],t))return r;return-1}function rn(e,t,r,n){return un(e,(function(e,i,s){t(n,e,r(e),s)})),n}function nn(e,t){return e&&Ai(t,Mo(t),e)}function sn(e,t,r){"__proto__"==t&&rt?rt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function an(e,t){for(var n=-1,i=t.length,s=se(i),a=null==e;++n<i;)s[n]=a?r:Po(e,t[n]);return s}function on(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function ln(e,t,n,i,s,a){var o,l=1&t,c=2&t,h=4&t;if(n&&(o=s?n(e,i,s,a):n(e)),o!==r)return o;if(!Ja(e))return e;var d=ja(e);if(d){if(o=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!l)return ki(e,o)}else{var u=fs(e),p=u==E||u==C;if(Wa(e))return _i(e,l);if(u==x||u==g||p&&!s){if(o=c||p?{}:gs(e),!l)return c?function(e,t){return Ai(e,ps(e),t)}(e,function(e,t){return e&&Ai(t,Ro(t),e)}(o,e)):function(e,t){return Ai(e,us(e),t)}(e,nn(o,e))}else{if(!ot[u])return s?e:{};o=function(e,t,r){var n=e.constructor;switch(t){case R:return Ti(e);case v:case b:return new n(+e);case O:return function(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case $:case D:case L:case F:case N:case B:case V:case U:case z:return xi(e,r);case _:return new n;case T:case k:return new n(e);case w:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case I:return new n;case A:return i=e,Fr?Pe(Fr.call(i)):{}}var i}(e,u,l)}}a||(a=new Kr);var f=a.get(e);if(f)return f;a.set(e,o),so(e)?e.forEach((function(r){o.add(ln(r,t,n,r,e,a))})):to(e)&&e.forEach((function(r,i){o.set(i,ln(r,t,n,i,e,a))}));var m=d?r:(h?c?is:ns:c?Ro:Mo)(e);return wt(m||e,(function(r,i){m&&(r=e[i=r]),en(o,i,ln(r,t,n,i,e,a))})),o}function cn(e,t,n){var i=n.length;if(null==e)return!i;for(e=Pe(e);i--;){var s=n[i],a=t[s],o=e[s];if(o===r&&!(s in e)||!a(o))return!1}return!0}function hn(e,t,i){if("function"!=typeof e)throw new ke(n);return As((function(){e.apply(r,i)}),t)}function dn(e,t,r,n){var i=-1,s=Mt,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;r&&(t=Ot(t,Qt(r))),n?(s=Rt,a=!1):t.length>=200&&(s=Jt,a=!1,t=new Wr(t));e:for(;++i<o;){var h=e[i],d=null==r?h:r(h);if(h=n||0!==h?h:0,a&&d==d){for(var u=c;u--;)if(t[u]===d)continue e;l.push(h)}else s(t,d,n)||l.push(h)}return l}Br.templateSettings={escape:q,evaluate:Q,interpolate:X,variable:"",imports:{_:Br}},Br.prototype=Ur.prototype,Br.prototype.constructor=Br,zr.prototype=Vr(Ur.prototype),zr.prototype.constructor=zr,jr.prototype=Vr(Ur.prototype),jr.prototype.constructor=jr,Gr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Gr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Gr.prototype.get=function(e){var t=this.__data__;if(Ir){var n=t[e];return n===i?r:n}return De.call(t,e)?t[e]:r},Gr.prototype.has=function(e){var t=this.__data__;return Ir?t[e]!==r:De.call(t,e)},Gr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ir&&t===r?i:t,this},Hr.prototype.clear=function(){this.__data__=[],this.size=0},Hr.prototype.delete=function(e){var t=this.__data__,r=tn(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},Hr.prototype.get=function(e){var t=this.__data__,n=tn(t,e);return n<0?r:t[n][1]},Hr.prototype.has=function(e){return tn(this.__data__,e)>-1},Hr.prototype.set=function(e,t){var r=this.__data__,n=tn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Gr,map:new(Tr||Hr),string:new Gr}},Zr.prototype.delete=function(e){var t=cs(this,e).delete(e);return this.size-=t?1:0,t},Zr.prototype.get=function(e){return cs(this,e).get(e)},Zr.prototype.has=function(e){return cs(this,e).has(e)},Zr.prototype.set=function(e,t){var r=cs(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Wr.prototype.add=Wr.prototype.push=function(e){return this.__data__.set(e,i),this},Wr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.clear=function(){this.__data__=new Hr,this.size=0},Kr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Kr.prototype.get=function(e){return this.__data__.get(e)},Kr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Hr){var n=r.__data__;if(!Tr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Zr(n)}return r.set(e,t),this.size=r.size,this};var un=Oi(Sn),pn=Oi(En,!0);function fn(e,t){var r=!0;return un(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function mn(e,t,n){for(var i=-1,s=e.length;++i<s;){var a=e[i],o=t(a);if(null!=o&&(l===r?o==o&&!oo(o):n(o,l)))var l=o,c=a}return c}function gn(e,t){var r=[];return un(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function yn(e,t,r,n,i){var s=-1,a=e.length;for(r||(r=ys),i||(i=[]);++s<a;){var o=e[s];t>0&&r(o)?t>1?yn(o,t-1,r,n,i):$t(i,o):n||(i[i.length]=o)}return i}var vn=$i(),bn=$i(!0);function Sn(e,t){return e&&vn(e,t,Mo)}function En(e,t){return e&&bn(e,t,Mo)}function Cn(e,t){return At(t,(function(t){return qa(e[t])}))}function _n(e,t){for(var n=0,i=(t=bi(t,e)).length;null!=e&&n<i;)e=e[Ls(t[n++])];return n&&n==i?e:r}function Tn(e,t,r){var n=t(e);return ja(e)?n:$t(n,r(e))}function xn(e){return null==e?e===r?"[object Undefined]":"[object Null]":et&&et in Pe(e)?function(e){var t=De.call(e,et),n=e[et];try{e[et]=r;var i=!0}catch(e){}var s=Ne.call(e);i&&(t?e[et]=n:delete e[et]);return s}(e):function(e){return Ne.call(e)}(e)}function Pn(e,t){return e>t}function wn(e,t){return null!=e&&De.call(e,t)}function In(e,t){return null!=e&&t in Pe(e)}function kn(e,t,n){for(var i=n?Rt:Mt,s=e[0].length,a=e.length,o=a,l=se(a),c=1/0,h=[];o--;){var d=e[o];o&&t&&(d=Ot(d,Qt(t))),c=vr(d.length,c),l[o]=!n&&(t||s>=120&&d.length>=120)?new Wr(o&&d):r}d=e[0];var u=-1,p=l[0];e:for(;++u<s&&h.length<c;){var f=d[u],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?Jt(p,m):i(h,m,n))){for(o=a;--o;){var g=l[o];if(!(g?Jt(g,m):i(e[o],m,n)))continue e}p&&p.push(m),h.push(f)}}return h}function An(e,t,n){var i=null==(e=ws(e,t=bi(t,e)))?e:e[Ls(Ys(t))];return null==i?r:xt(i,e,n)}function Mn(e){return eo(e)&&xn(e)==g}function Rn(e,t,n,i,s){return e===t||(null==e||null==t||!eo(e)&&!eo(t)?e!=e&&t!=t:function(e,t,n,i,s,a){var o=ja(e),l=ja(t),c=o?y:fs(e),h=l?y:fs(t),d=(c=c==g?x:c)==x,u=(h=h==g?x:h)==x,p=c==h;if(p&&Wa(e)){if(!Wa(t))return!1;o=!0,d=!1}if(p&&!d)return a||(a=new Kr),o||lo(e)?ts(e,t,n,i,s,a):function(e,t,r,n,i,s,a){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!s(new Ge(e),new Ge(t)));case v:case b:case T:return Ba(+e,+t);case S:return e.name==t.name&&e.message==t.message;case w:case k:return e==t+"";case _:var o=ar;case I:var l=1&n;if(o||(o=cr),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var h=ts(o(e),o(t),n,i,s,a);return a.delete(e),h;case A:if(Fr)return Fr.call(e)==Fr.call(t)}return!1}(e,t,c,n,i,s,a);if(!(1&n)){var f=d&&De.call(e,"__wrapped__"),m=u&&De.call(t,"__wrapped__");if(f||m){var E=f?e.value():e,C=m?t.value():t;return a||(a=new Kr),s(E,C,n,i,a)}}if(!p)return!1;return a||(a=new Kr),function(e,t,n,i,s,a){var o=1&n,l=ns(e),c=l.length,h=ns(t),d=h.length;if(c!=d&&!o)return!1;var u=c;for(;u--;){var p=l[u];if(!(o?p in t:De.call(t,p)))return!1}var f=a.get(e),m=a.get(t);if(f&&m)return f==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);var y=o;for(;++u<c;){var v=e[p=l[u]],b=t[p];if(i)var S=o?i(b,v,p,t,e,a):i(v,b,p,e,t,a);if(!(S===r?v===b||s(v,b,n,i,a):S)){g=!1;break}y||(y="constructor"==p)}if(g&&!y){var E=e.constructor,C=t.constructor;E==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof C&&C instanceof C||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,n,i,s,a)}(e,t,n,i,Rn,s))}function On(e,t,n,i){var s=n.length,a=s,o=!i;if(null==e)return!a;for(e=Pe(e);s--;){var l=n[s];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<a;){var c=(l=n[s])[0],h=e[c],d=l[1];if(o&&l[2]){if(h===r&&!(c in e))return!1}else{var u=new Kr;if(i)var p=i(h,d,c,e,t,u);if(!(p===r?Rn(d,h,3,i,u):p))return!1}}return!0}function $n(e){return!(!Ja(e)||(t=e,Fe&&Fe in t))&&(qa(e)?Ue:ge).test(Fs(e));var t}function Dn(e){return"function"==typeof e?e:null==e?nl:"object"==typeof e?ja(e)?Un(e[0],e[1]):Vn(e):ul(e)}function Ln(e){if(!_s(e))return gr(e);var t=[];for(var r in Pe(e))De.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Fn(e){if(!Ja(e))return function(e){var t=[];if(null!=e)for(var r in Pe(e))t.push(r);return t}(e);var t=_s(e),r=[];for(var n in e)("constructor"!=n||!t&&De.call(e,n))&&r.push(n);return r}function Nn(e,t){return e<t}function Bn(e,t){var r=-1,n=Ha(e)?se(e.length):[];return un(e,(function(e,i,s){n[++r]=t(e,i,s)})),n}function Vn(e){var t=hs(e);return 1==t.length&&t[0][2]?xs(t[0][0],t[0][1]):function(r){return r===e||On(r,e,t)}}function Un(e,t){return Ss(e)&&Ts(t)?xs(Ls(e),t):function(n){var i=Po(n,e);return i===r&&i===t?wo(n,e):Rn(t,i,3)}}function zn(e,t,n,i,s){e!==t&&vn(t,(function(a,o){if(s||(s=new Kr),Ja(a))!function(e,t,n,i,s,a,o){var l=Is(e,n),c=Is(t,n),h=o.get(c);if(h)return void Jr(e,n,h);var d=a?a(l,c,n+"",e,t,o):r,u=d===r;if(u){var p=ja(c),f=!p&&Wa(c),m=!p&&!f&&lo(c);d=c,p||f||m?ja(l)?d=l:Za(l)?d=ki(l):f?(u=!1,d=_i(c,!0)):m?(u=!1,d=xi(c,!0)):d=[]:no(c)||za(c)?(d=l,za(l)?d=yo(l):Ja(l)&&!qa(l)||(d=gs(c))):u=!1}u&&(o.set(c,d),s(d,c,i,a,o),o.delete(c));Jr(e,n,d)}(e,t,o,n,zn,i,s);else{var l=i?i(Is(e,o),a,o+"",e,t,s):r;l===r&&(l=a),Jr(e,o,l)}}),Ro)}function jn(e,t){var n=e.length;if(n)return vs(t+=t<0?n:0,n)?e[t]:r}function Gn(e,t,r){t=t.length?Ot(t,(function(e){return ja(e)?function(t){return _n(t,1===e.length?e[0]:e)}:e})):[nl];var n=-1;t=Ot(t,Qt(ls()));var i=Bn(e,(function(e,r,i){var s=Ot(t,(function(t){return t(e)}));return{criteria:s,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,s=t.criteria,a=i.length,o=r.length;for(;++n<a;){var l=Pi(i[n],s[n]);if(l)return n>=o?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Hn(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var a=t[n],o=_n(e,a);r(o,a)&&Jn(s,bi(a,e),o)}return s}function Zn(e,t,r,n){var i=n?zt:Ut,s=-1,a=t.length,o=e;for(e===t&&(t=ki(t)),r&&(o=Ot(e,Qt(r)));++s<a;)for(var l=0,c=t[s],h=r?r(c):c;(l=i(o,h,l,n))>-1;)o!==e&&Ye.call(o,l,1),Ye.call(e,l,1);return e}function Wn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;vs(i)?Ye.call(e,i,1):di(e,i)}}return e}function Kn(e,t){return e+mt(Er()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=mt(t/2))&&(e+=e)}while(t);return r}function qn(e,t){return Ms(Ps(e,t,nl),e+"")}function Qn(e){return qr(Vo(e))}function Xn(e,t){var r=Vo(e);return $s(r,on(t,0,r.length))}function Jn(e,t,n,i){if(!Ja(e))return e;for(var s=-1,a=(t=bi(t,e)).length,o=a-1,l=e;null!=l&&++s<a;){var c=Ls(t[s]),h=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(s!=o){var d=l[c];(h=i?i(d,c,l):r)===r&&(h=Ja(d)?d:vs(t[s+1])?[]:{})}en(l,c,h),l=l[c]}return e}var ei=kr?function(e,t){return kr.set(e,t),e}:nl,ti=rt?function(e,t){return rt(e,"toString",{configurable:!0,enumerable:!1,value:el(t),writable:!0})}:nl;function ri(e){return $s(Vo(e))}function ni(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=se(i);++n<i;)s[n]=e[n+t];return s}function ii(e,t){var r;return un(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function si(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var s=n+i>>>1,a=e[s];null!==a&&!oo(a)&&(r?a<=t:a<t)?n=s+1:i=s}return i}return ai(e,t,nl,r)}function ai(e,t,n,i){var s=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(t=n(t))!=t,l=null===t,c=oo(t),h=t===r;s<a;){var d=mt((s+a)/2),u=n(e[d]),p=u!==r,f=null===u,m=u==u,g=oo(u);if(o)var y=i||m;else y=h?m&&(i||p):l?m&&p&&(i||!f):c?m&&p&&!f&&(i||!g):!f&&!g&&(i?u<=t:u<t);y?s=d+1:a=d}return vr(a,4294967294)}function oi(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var a=e[r],o=t?t(a):a;if(!r||!Ba(o,l)){var l=o;s[i++]=0===a?0:a}}return s}function li(e){return"number"==typeof e?e:oo(e)?p:+e}function ci(e){if("string"==typeof e)return e;if(ja(e))return Ot(e,ci)+"";if(oo(e))return Nr?Nr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,r){var n=-1,i=Mt,s=e.length,a=!0,o=[],l=o;if(r)a=!1,i=Rt;else if(s>=200){var c=t?null:Yi(e);if(c)return cr(c);a=!1,i=Jt,l=new Wr}else l=t?[]:o;e:for(;++n<s;){var h=e[n],d=t?t(h):h;if(h=r||0!==h?h:0,a&&d==d){for(var u=l.length;u--;)if(l[u]===d)continue e;t&&l.push(d),o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}function di(e,t){return null==(e=ws(e,t=bi(t,e)))||delete e[Ls(Ys(t))]}function ui(e,t,r,n){return Jn(e,t,r(_n(e,t)),n)}function pi(e,t,r,n){for(var i=e.length,s=n?i:-1;(n?s--:++s<i)&&t(e[s],s,e););return r?ni(e,n?0:s,n?s+1:i):ni(e,n?s+1:0,n?i:s)}function fi(e,t){var r=e;return r instanceof jr&&(r=r.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,$t([e],t.args))}),r)}function mi(e,t,r){var n=e.length;if(n<2)return n?hi(e[0]):[];for(var i=-1,s=se(n);++i<n;)for(var a=e[i],o=-1;++o<n;)o!=i&&(s[i]=dn(s[i]||a,e[o],t,r));return hi(yn(s,1),t,r)}function gi(e,t,n){for(var i=-1,s=e.length,a=t.length,o={};++i<s;){var l=i<a?t[i]:r;n(o,e[i],l)}return o}function yi(e){return Za(e)?e:[]}function vi(e){return"function"==typeof e?e:nl}function bi(e,t){return ja(e)?e:Ss(e,t)?[e]:Ds(vo(e))}var Si=qn;function Ei(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ni(e,t,n)}var Ci=lt||function(e){return pt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=He?He(r):new e.constructor(r);return e.copy(n),n}function Ti(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function xi(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Pi(e,t){if(e!==t){var n=e!==r,i=null===e,s=e==e,a=oo(e),o=t!==r,l=null===t,c=t==t,h=oo(t);if(!l&&!h&&!a&&e>t||a&&o&&c&&!l&&!h||i&&o&&c||!n&&c||!s)return 1;if(!i&&!a&&!h&&e<t||h&&n&&s&&!i&&!a||l&&n&&s||!o&&s||!c)return-1}return 0}function wi(e,t,r,n){for(var i=-1,s=e.length,a=r.length,o=-1,l=t.length,c=yr(s-a,0),h=se(l+c),d=!n;++o<l;)h[o]=t[o];for(;++i<a;)(d||i<s)&&(h[r[i]]=e[i]);for(;c--;)h[o++]=e[i++];return h}function Ii(e,t,r,n){for(var i=-1,s=e.length,a=-1,o=r.length,l=-1,c=t.length,h=yr(s-o,0),d=se(h+c),u=!n;++i<h;)d[i]=e[i];for(var p=i;++l<c;)d[p+l]=t[l];for(;++a<o;)(u||i<s)&&(d[p+r[a]]=e[i++]);return d}function ki(e,t){var r=-1,n=e.length;for(t||(t=se(n));++r<n;)t[r]=e[r];return t}function Ai(e,t,n,i){var s=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var l=t[a],c=i?i(n[l],e[l],l,n,e):r;c===r&&(c=e[l]),s?sn(n,l,c):en(n,l,c)}return n}function Mi(e,t){return function(r,n){var i=ja(r)?Pt:rn,s=t?t():{};return i(r,e,ls(n,2),s)}}function Ri(e){return qn((function(t,n){var i=-1,s=n.length,a=s>1?n[s-1]:r,o=s>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(s--,a):r,o&&bs(n[0],n[1],o)&&(a=s<3?r:a,s=1),t=Pe(t);++i<s;){var l=n[i];l&&e(t,l,i,a)}return t}))}function Oi(e,t){return function(r,n){if(null==r)return r;if(!Ha(r))return e(r,n);for(var i=r.length,s=t?i:-1,a=Pe(r);(t?s--:++s<i)&&!1!==n(a[s],s,a););return r}}function $i(e){return function(t,r,n){for(var i=-1,s=Pe(t),a=n(t),o=a.length;o--;){var l=a[e?o:++i];if(!1===r(s[l],l,s))break}return t}}function Di(e){return function(t){var n=sr(t=vo(t))?ur(t):r,i=n?n[0]:t.charAt(0),s=n?Ei(n,1).join(""):t.slice(1);return i[e]()+s}}function Li(e){return function(t){return Dt(Qo(jo(t).replace(Xe,"")),e,"")}}function Fi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Vr(e.prototype),n=e.apply(r,t);return Ja(n)?n:r}}function Ni(e){return function(t,n,i){var s=Pe(t);if(!Ha(t)){var a=ls(n,3);t=Mo(t),n=function(e){return a(s[e],e,s)}}var o=e(t,n,i);return o>-1?s[a?t[o]:o]:r}}function Bi(e){return rs((function(t){var i=t.length,s=i,a=zr.prototype.thru;for(e&&t.reverse();s--;){var o=t[s];if("function"!=typeof o)throw new ke(n);if(a&&!l&&"wrapper"==as(o))var l=new zr([],!0)}for(s=l?s:i;++s<i;){var c=as(o=t[s]),h="wrapper"==c?ss(o):r;l=h&&Es(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?l[as(h[0])].apply(l,h[3]):1==o.length&&Es(o)?l[c]():l.thru(o)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&ja(r))return l.plant(r).value();for(var n=0,s=i?t[n].apply(this,e):r;++n<i;)s=t[n].call(this,s);return s}}))}function Vi(e,t,n,i,s,a,o,l,h,d){var u=t&c,p=1&t,f=2&t,m=24&t,g=512&t,y=f?r:Fi(e);return function c(){for(var v=arguments.length,b=se(v),S=v;S--;)b[S]=arguments[S];if(m)var E=os(c),C=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,E);if(i&&(b=wi(b,i,s,m)),a&&(b=Ii(b,a,o,m)),v-=C,m&&v<d){var _=lr(b,E);return Wi(e,t,Vi,c.placeholder,n,b,_,l,h,d-v)}var T=p?n:this,x=f?T[e]:e;return v=b.length,l?b=function(e,t){var n=e.length,i=vr(t.length,n),s=ki(e);for(;i--;){var a=t[i];e[i]=vs(a,n)?s[a]:r}return e}(b,l):g&&v>1&&b.reverse(),u&&h<v&&(b.length=h),this&&this!==pt&&this instanceof c&&(x=y||Fi(x)),x.apply(T,b)}}function Ui(e,t){return function(r,n){return function(e,t,r,n){return Sn(e,(function(e,i,s){t(n,r(e),i,s)})),n}(r,e,t(n),{})}}function zi(e,t){return function(n,i){var s;if(n===r&&i===r)return t;if(n!==r&&(s=n),i!==r){if(s===r)return i;"string"==typeof n||"string"==typeof i?(n=ci(n),i=ci(i)):(n=li(n),i=li(i)),s=e(n,i)}return s}}function ji(e){return rs((function(t){return t=Ot(t,Qt(ls())),qn((function(r){var n=this;return e(t,(function(e){return xt(e,n,r)}))}))}))}function Gi(e,t){var n=(t=t===r?" ":ci(t)).length;if(n<2)return n?Yn(t,e):t;var i=Yn(t,ft(e/dr(t)));return sr(t)?Ei(ur(i),0,e).join(""):i.slice(0,e)}function Hi(e){return function(t,n,i){return i&&"number"!=typeof i&&bs(t,n,i)&&(n=i=r),t=po(t),n===r?(n=t,t=0):n=po(n),function(e,t,r,n){for(var i=-1,s=yr(ft((t-e)/(r||1)),0),a=se(s);s--;)a[n?s:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:po(i),e)}}function Zi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=go(t),r=go(r)),e(t,r)}}function Wi(e,t,n,i,s,a,c,h,d,u){var p=8&t;t|=p?o:l,4&(t&=~(p?l:o))||(t&=-4);var f=[e,t,s,p?a:r,p?c:r,p?r:a,p?r:c,h,d,u],m=n.apply(r,f);return Es(e)&&ks(m,f),m.placeholder=i,Rs(m,e,t)}function Ki(e){var t=xe[e];return function(e,r){if(e=go(e),(r=null==r?0:vr(fo(r),292))&&Nt(e)){var n=(vo(e)+"e").split("e");return+((n=(vo(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=Pr&&1/cr(new Pr([,-0]))[1]==d?function(e){return new Pr(e)}:ll;function qi(e){return function(t){var r=fs(t);return r==_?ar(t):r==I?hr(t):function(e,t){return Ot(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Qi(e,t,i,d,u,p,f,m){var g=2&t;if(!g&&"function"!=typeof e)throw new ke(n);var y=d?d.length:0;if(y||(t&=-97,d=u=r),f=f===r?f:yr(fo(f),0),m=m===r?m:fo(m),y-=u?u.length:0,t&l){var v=d,b=u;d=u=r}var S=g?r:ss(e),E=[e,t,i,d,u,v,b,p,f,m];if(S&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,o=n==c&&8==r||n==c&&r==h&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!o)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var l=t[3];if(l){var d=e[3];e[3]=d?wi(d,l,t[4]):l,e[4]=d?lr(e[3],s):t[4]}(l=t[5])&&(d=e[5],e[5]=d?Ii(d,l,t[6]):l,e[6]=d?lr(e[5],s):t[6]);(l=t[7])&&(e[7]=l);n&c&&(e[8]=null==e[8]?t[8]:vr(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(E,S),e=E[0],t=E[1],i=E[2],d=E[3],u=E[4],!(m=E[9]=E[9]===r?g?0:e.length:yr(E[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)C=8==t||t==a?function(e,t,n){var i=Fi(e);return function s(){for(var a=arguments.length,o=se(a),l=a,c=os(s);l--;)o[l]=arguments[l];var h=a<3&&o[0]!==c&&o[a-1]!==c?[]:lr(o,c);return(a-=h.length)<n?Wi(e,t,Vi,s.placeholder,r,o,h,r,r,n-a):xt(this&&this!==pt&&this instanceof s?i:e,this,o)}}(e,t,m):t!=o&&33!=t||u.length?Vi.apply(r,E):function(e,t,r,n){var i=1&t,s=Fi(e);return function t(){for(var a=-1,o=arguments.length,l=-1,c=n.length,h=se(c+o),d=this&&this!==pt&&this instanceof t?s:e;++l<c;)h[l]=n[l];for(;o--;)h[l++]=arguments[++a];return xt(d,i?r:this,h)}}(e,t,i,d);else var C=function(e,t,r){var n=1&t,i=Fi(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Rs((S?ei:ks)(C,E),e,t)}function Xi(e,t,n,i){return e===r||Ba(e,Re[n])&&!De.call(i,n)?t:e}function Ji(e,t,n,i,s,a){return Ja(e)&&Ja(t)&&(a.set(t,e),zn(e,t,r,Ji,a),a.delete(t)),e}function es(e){return no(e)?r:e}function ts(e,t,n,i,s,a){var o=1&n,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var u=-1,p=!0,f=2&n?new Wr:r;for(a.set(e,t),a.set(t,e);++u<l;){var m=e[u],g=t[u];if(i)var y=o?i(g,m,u,t,e,a):i(m,g,u,e,t,a);if(y!==r){if(y)continue;p=!1;break}if(f){if(!Ft(t,(function(e,t){if(!Jt(f,t)&&(m===e||s(m,e,n,i,a)))return f.push(t)}))){p=!1;break}}else if(m!==g&&!s(m,g,n,i,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function rs(e){return Ms(Ps(e,r,Gs),e+"")}function ns(e){return Tn(e,Mo,us)}function is(e){return Tn(e,Ro,ps)}var ss=kr?function(e){return kr.get(e)}:ll;function as(e){for(var t=e.name+"",r=Ar[t],n=De.call(Ar,t)?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==e)return i.name}return t}function os(e){return(De.call(Br,"placeholder")?Br:e).placeholder}function ls(){var e=Br.iteratee||il;return e=e===il?Dn:e,arguments.length?e(arguments[0],arguments[1]):e}function cs(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function hs(e){for(var t=Mo(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ts(i)]}return t}function ds(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return $n(n)?n:r}var us=yt?function(e){return null==e?[]:(e=Pe(e),At(yt(e),(function(t){return Ke.call(e,t)})))}:ml,ps=yt?function(e){for(var t=[];e;)$t(t,us(e)),e=Ze(e);return t}:ml,fs=xn;function ms(e,t,r){for(var n=-1,i=(t=bi(t,e)).length,s=!1;++n<i;){var a=Ls(t[n]);if(!(s=null!=e&&r(e,a)))break;e=e[a]}return s||++n!=i?s:!!(i=null==e?0:e.length)&&Xa(i)&&vs(a,i)&&(ja(e)||za(e))}function gs(e){return"function"!=typeof e.constructor||_s(e)?{}:Vr(Ze(e))}function ys(e){return ja(e)||za(e)||!!(qe&&e&&e[qe])}function vs(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&ve.test(e))&&e>-1&&e%1==0&&e<t}function bs(e,t,r){if(!Ja(r))return!1;var n=typeof t;return!!("number"==n?Ha(r)&&vs(t,r.length):"string"==n&&t in r)&&Ba(r[t],e)}function Ss(e,t){if(ja(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!oo(e))||(ee.test(e)||!J.test(e)||null!=t&&e in Pe(t))}function Es(e){var t=as(e),r=Br[t];if("function"!=typeof r||!(t in jr.prototype))return!1;if(e===r)return!0;var n=ss(r);return!!n&&e===n[0]}(_r&&fs(new _r(new ArrayBuffer(1)))!=O||Tr&&fs(new Tr)!=_||xr&&fs(xr.resolve())!=P||Pr&&fs(new Pr)!=I||wr&&fs(new wr)!=M)&&(fs=function(e){var t=xn(e),n=t==x?e.constructor:r,i=n?Fs(n):"";if(i)switch(i){case Mr:return O;case Rr:return _;case Or:return P;case $r:return I;case Dr:return M}return t});var Cs=Oe?qa:gl;function _s(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Re)}function Ts(e){return e==e&&!Ja(e)}function xs(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Pe(n)))}}function Ps(e,t,n){return t=yr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=yr(r.length-t,0),a=se(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=se(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),xt(e,this,o)}}function ws(e,t){return t.length<2?e:_n(e,ni(t,0,-1))}function Is(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ks=Os(ei),As=ut||function(e,t){return pt.setTimeout(e,t)},Ms=Os(ti);function Rs(e,t,r){var n=t+"";return Ms(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return wt(m,(function(r){var n="_."+r[0];t&r[1]&&!Mt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(le):[]}(n),r)))}function Os(e){var t=0,n=0;return function(){var i=br(),s=16-(i-n);if(n=i,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function $s(e,t){var n=-1,i=e.length,s=i-1;for(t=t===r?i:t;++n<t;){var a=Kn(n,s),o=e[a];e[a]=e[n],e[n]=o}return e.length=t,e}var Ds=function(e){var t=Oa(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,(function(e,r,n,i){t.push(n?i.replace(de,"$1"):r||e)})),t}));function Ls(e){if("string"==typeof e||oo(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fs(e){if(null!=e){try{return $e.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ns(e){if(e instanceof jr)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=ki(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Bs=qn((function(e,t){return Za(e)?dn(e,yn(t,1,Za,!0)):[]})),Vs=qn((function(e,t){var n=Ys(t);return Za(n)&&(n=r),Za(e)?dn(e,yn(t,1,Za,!0),ls(n,2)):[]})),Us=qn((function(e,t){var n=Ys(t);return Za(n)&&(n=r),Za(e)?dn(e,yn(t,1,Za,!0),r,n):[]}));function zs(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fo(r);return i<0&&(i=yr(n+i,0)),Vt(e,ls(t,3),i)}function js(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return n!==r&&(s=fo(n),s=n<0?yr(i+s,0):vr(s,i-1)),Vt(e,ls(t,3),s,!0)}function Gs(e){return(null==e?0:e.length)?yn(e,1):[]}function Hs(e){return e&&e.length?e[0]:r}var Zs=qn((function(e){var t=Ot(e,yi);return t.length&&t[0]===e[0]?kn(t):[]})),Ws=qn((function(e){var t=Ys(e),n=Ot(e,yi);return t===Ys(n)?t=r:n.pop(),n.length&&n[0]===e[0]?kn(n,ls(t,2)):[]})),Ks=qn((function(e){var t=Ys(e),n=Ot(e,yi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?kn(n,r,t):[]}));function Ys(e){var t=null==e?0:e.length;return t?e[t-1]:r}var qs=qn(Qs);function Qs(e,t){return e&&e.length&&t&&t.length?Zn(e,t):e}var Xs=rs((function(e,t){var r=null==e?0:e.length,n=an(e,t);return Wn(e,Ot(t,(function(e){return vs(e,r)?+e:e})).sort(Pi)),n}));function Js(e){return null==e?e:Cr.call(e)}var ea=qn((function(e){return hi(yn(e,1,Za,!0))})),ta=qn((function(e){var t=Ys(e);return Za(t)&&(t=r),hi(yn(e,1,Za,!0),ls(t,2))})),ra=qn((function(e){var t=Ys(e);return t="function"==typeof t?t:r,hi(yn(e,1,Za,!0),r,t)}));function na(e){if(!e||!e.length)return[];var t=0;return e=At(e,(function(e){if(Za(e))return t=yr(e.length,t),!0})),Yt(t,(function(t){return Ot(e,Ht(t))}))}function ia(e,t){if(!e||!e.length)return[];var n=na(e);return null==t?n:Ot(n,(function(e){return xt(t,r,e)}))}var sa=qn((function(e,t){return Za(e)?dn(e,t):[]})),aa=qn((function(e){return mi(At(e,Za))})),oa=qn((function(e){var t=Ys(e);return Za(t)&&(t=r),mi(At(e,Za),ls(t,2))})),la=qn((function(e){var t=Ys(e);return t="function"==typeof t?t:r,mi(At(e,Za),r,t)})),ca=qn(na);var ha=qn((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ia(e,n)}));function da(e){var t=Br(e);return t.__chain__=!0,t}function ua(e,t){return t(e)}var pa=rs((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,s=function(t){return an(t,e)};return!(t>1||this.__actions__.length)&&i instanceof jr&&vs(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ua,args:[s],thisArg:r}),new zr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(s)}));var fa=Mi((function(e,t,r){De.call(e,r)?++e[r]:sn(e,r,1)}));var ma=Ni(zs),ga=Ni(js);function ya(e,t){return(ja(e)?wt:un)(e,ls(t,3))}function va(e,t){return(ja(e)?It:pn)(e,ls(t,3))}var ba=Mi((function(e,t,r){De.call(e,r)?e[r].push(t):sn(e,r,[t])}));var Sa=qn((function(e,t,r){var n=-1,i="function"==typeof t,s=Ha(e)?se(e.length):[];return un(e,(function(e){s[++n]=i?xt(t,e,r):An(e,t,r)})),s})),Ea=Mi((function(e,t,r){sn(e,r,t)}));function Ca(e,t){return(ja(e)?Ot:Bn)(e,ls(t,3))}var _a=Mi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ta=qn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&bs(e,t[0],t[1])?t=[]:r>2&&bs(t[0],t[1],t[2])&&(t=[t[0]]),Gn(e,yn(t,1),[])})),xa=dt||function(){return pt.Date.now()};function Pa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Qi(e,c,r,r,r,r,t)}function wa(e,t){var i;if("function"!=typeof t)throw new ke(n);return e=fo(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=qn((function(e,t,r){var n=1;if(r.length){var i=lr(r,os(Ia));n|=o}return Qi(e,n,t,r,i)})),ka=qn((function(e,t,r){var n=3;if(r.length){var i=lr(r,os(ka));n|=o}return Qi(t,n,e,r,i)}));function Aa(e,t,i){var s,a,o,l,c,h,d=0,u=!1,p=!1,f=!0;if("function"!=typeof e)throw new ke(n);function m(t){var n=s,i=a;return s=a=r,d=t,l=e.apply(i,n)}function g(e){var n=e-h;return h===r||n>=t||n<0||p&&e-d>=o}function y(){var e=xa();if(g(e))return v(e);c=As(y,function(e){var r=t-(e-h);return p?vr(r,o-(e-d)):r}(e))}function v(e){return c=r,f&&s?m(e):(s=a=r,l)}function b(){var e=xa(),n=g(e);if(s=arguments,a=this,h=e,n){if(c===r)return function(e){return d=e,c=As(y,t),u?m(e):l}(h);if(p)return Ci(c),c=As(y,t),m(h)}return c===r&&(c=As(y,t)),l}return t=go(t)||0,Ja(i)&&(u=!!i.leading,o=(p="maxWait"in i)?yr(go(i.maxWait)||0,t):o,f="trailing"in i?!!i.trailing:f),b.cancel=function(){c!==r&&Ci(c),d=0,s=h=a=c=r},b.flush=function(){return c===r?l:v(xa())},b}var Ma=qn((function(e,t){return hn(e,1,t)})),Ra=qn((function(e,t,r){return hn(e,go(t)||0,r)}));function Oa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ke(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(Oa.Cache||Zr),r}function $a(e){if("function"!=typeof e)throw new ke(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Oa.Cache=Zr;var Da=Si((function(e,t){var r=(t=1==t.length&&ja(t[0])?Ot(t[0],Qt(ls())):Ot(yn(t,1),Qt(ls()))).length;return qn((function(n){for(var i=-1,s=vr(n.length,r);++i<s;)n[i]=t[i].call(this,n[i]);return xt(e,this,n)}))})),La=qn((function(e,t){var n=lr(t,os(La));return Qi(e,o,r,t,n)})),Fa=qn((function(e,t){var n=lr(t,os(Fa));return Qi(e,l,r,t,n)})),Na=rs((function(e,t){return Qi(e,h,r,r,r,t)}));function Ba(e,t){return e===t||e!=e&&t!=t}var Va=Zi(Pn),Ua=Zi((function(e,t){return e>=t})),za=Mn(function(){return arguments}())?Mn:function(e){return eo(e)&&De.call(e,"callee")&&!Ke.call(e,"callee")},ja=se.isArray,Ga=bt?Qt(bt):function(e){return eo(e)&&xn(e)==R};function Ha(e){return null!=e&&Xa(e.length)&&!qa(e)}function Za(e){return eo(e)&&Ha(e)}var Wa=vt||gl,Ka=St?Qt(St):function(e){return eo(e)&&xn(e)==b};function Ya(e){if(!eo(e))return!1;var t=xn(e);return t==S||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!no(e)}function qa(e){if(!Ja(e))return!1;var t=xn(e);return t==E||t==C||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==fo(e)}function Xa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Ja(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eo(e){return null!=e&&"object"==typeof e}var to=Et?Qt(Et):function(e){return eo(e)&&fs(e)==_};function ro(e){return"number"==typeof e||eo(e)&&xn(e)==T}function no(e){if(!eo(e)||xn(e)!=x)return!1;var t=Ze(e);if(null===t)return!0;var r=De.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&$e.call(r)==Be}var io=Ct?Qt(Ct):function(e){return eo(e)&&xn(e)==w};var so=_t?Qt(_t):function(e){return eo(e)&&fs(e)==I};function ao(e){return"string"==typeof e||!ja(e)&&eo(e)&&xn(e)==k}function oo(e){return"symbol"==typeof e||eo(e)&&xn(e)==A}var lo=Tt?Qt(Tt):function(e){return eo(e)&&Xa(e.length)&&!!at[xn(e)]};var co=Zi(Nn),ho=Zi((function(e,t){return e<=t}));function uo(e){if(!e)return[];if(Ha(e))return ao(e)?ur(e):ki(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=fs(e);return(t==_?ar:t==I?cr:Vo)(e)}function po(e){return e?(e=go(e))===d||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fo(e){var t=po(e),r=t%1;return t==t?r?t-r:t:0}function mo(e){return e?on(fo(e),0,f):0}function go(e){if("number"==typeof e)return e;if(oo(e))return p;if(Ja(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ja(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var r=me.test(e);return r||ye.test(e)?ht(e.slice(2),r?2:8):fe.test(e)?p:+e}function yo(e){return Ai(e,Ro(e))}function vo(e){return null==e?"":ci(e)}var bo=Ri((function(e,t){if(_s(t)||Ha(t))Ai(t,Mo(t),e);else for(var r in t)De.call(t,r)&&en(e,r,t[r])})),So=Ri((function(e,t){Ai(t,Ro(t),e)})),Eo=Ri((function(e,t,r,n){Ai(t,Ro(t),e,n)})),Co=Ri((function(e,t,r,n){Ai(t,Mo(t),e,n)})),_o=rs(an);var To=qn((function(e,t){e=Pe(e);var n=-1,i=t.length,s=i>2?t[2]:r;for(s&&bs(t[0],t[1],s)&&(i=1);++n<i;)for(var a=t[n],o=Ro(a),l=-1,c=o.length;++l<c;){var h=o[l],d=e[h];(d===r||Ba(d,Re[h])&&!De.call(e,h))&&(e[h]=a[h])}return e})),xo=qn((function(e){return e.push(r,Ji),xt($o,r,e)}));function Po(e,t,n){var i=null==e?r:_n(e,t);return i===r?n:i}function wo(e,t){return null!=e&&ms(e,t,In)}var Io=Ui((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=r}),el(nl)),ko=Ui((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),De.call(e,t)?e[t].push(r):e[t]=[r]}),ls),Ao=qn(An);function Mo(e){return Ha(e)?Yr(e):Ln(e)}function Ro(e){return Ha(e)?Yr(e,!0):Fn(e)}var Oo=Ri((function(e,t,r){zn(e,t,r)})),$o=Ri((function(e,t,r,n){zn(e,t,r,n)})),Do=rs((function(e,t){var r={};if(null==e)return r;var n=!1;t=Ot(t,(function(t){return t=bi(t,e),n||(n=t.length>1),t})),Ai(e,is(e),r),n&&(r=ln(r,7,es));for(var i=t.length;i--;)di(r,t[i]);return r}));var Lo=rs((function(e,t){return null==e?{}:function(e,t){return Hn(e,t,(function(t,r){return wo(e,r)}))}(e,t)}));function Fo(e,t){if(null==e)return{};var r=Ot(is(e),(function(e){return[e]}));return t=ls(t),Hn(e,r,(function(e,r){return t(e,r[0])}))}var No=qi(Mo),Bo=qi(Ro);function Vo(e){return null==e?[]:Xt(e,Mo(e))}var Uo=Li((function(e,t,r){return t=t.toLowerCase(),e+(r?zo(t):t)}));function zo(e){return qo(vo(e).toLowerCase())}function jo(e){return(e=vo(e))&&e.replace(be,rr).replace(Je,"")}var Go=Li((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ho=Li((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Zo=Di("toLowerCase");var Wo=Li((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Ko=Li((function(e,t,r){return e+(r?" ":"")+qo(t)}));var Yo=Li((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),qo=Di("toUpperCase");function Qo(e,t,n){return e=vo(e),(t=n?r:t)===r?function(e){return nt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Xo=qn((function(e,t){try{return xt(e,r,t)}catch(e){return Ya(e)?e:new _e(e)}})),Jo=rs((function(e,t){return wt(t,(function(t){t=Ls(t),sn(e,t,Ia(e[t],e))})),e}));function el(e){return function(){return e}}var tl=Bi(),rl=Bi(!0);function nl(e){return e}function il(e){return Dn("function"==typeof e?e:ln(e,1))}var sl=qn((function(e,t){return function(r){return An(r,e,t)}})),al=qn((function(e,t){return function(r){return An(e,r,t)}}));function ol(e,t,r){var n=Mo(t),i=Cn(t,n);null!=r||Ja(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Cn(t,Mo(t)));var s=!(Ja(r)&&"chain"in r&&!r.chain),a=qa(e);return wt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=ki(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,$t([this.value()],arguments))})})),e}function ll(){}var cl=ji(Ot),hl=ji(kt),dl=ji(Ft);function ul(e){return Ss(e)?Ht(Ls(e)):function(e){return function(t){return _n(t,e)}}(e)}var pl=Hi(),fl=Hi(!0);function ml(){return[]}function gl(){return!1}var yl=zi((function(e,t){return e+t}),0),vl=Ki("ceil"),bl=zi((function(e,t){return e/t}),1),Sl=Ki("floor");var El,Cl=zi((function(e,t){return e*t}),1),_l=Ki("round"),Tl=zi((function(e,t){return e-t}),0);return Br.after=function(e,t){if("function"!=typeof t)throw new ke(n);return e=fo(e),function(){if(--e<1)return t.apply(this,arguments)}},Br.ary=Pa,Br.assign=bo,Br.assignIn=So,Br.assignInWith=Eo,Br.assignWith=Co,Br.at=_o,Br.before=wa,Br.bind=Ia,Br.bindAll=Jo,Br.bindKey=ka,Br.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return ja(e)?e:[e]},Br.chain=da,Br.chunk=function(e,t,n){t=(n?bs(e,t,n):t===r)?1:yr(fo(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,a=0,o=se(ft(i/t));s<i;)o[a++]=ni(e,s,s+=t);return o},Br.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var s=e[t];s&&(i[n++]=s)}return i},Br.concat=function(){var e=arguments.length;if(!e)return[];for(var t=se(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return $t(ja(r)?ki(r):[r],yn(t,1))},Br.cond=function(e){var t=null==e?0:e.length,r=ls();return e=t?Ot(e,(function(e){if("function"!=typeof e[1])throw new ke(n);return[r(e[0]),e[1]]})):[],qn((function(r){for(var n=-1;++n<t;){var i=e[n];if(xt(i[0],this,r))return xt(i[1],this,r)}}))},Br.conforms=function(e){return function(e){var t=Mo(e);return function(r){return cn(r,e,t)}}(ln(e,1))},Br.constant=el,Br.countBy=fa,Br.create=function(e,t){var r=Vr(e);return null==t?r:nn(r,t)},Br.curry=function e(t,n,i){var s=Qi(t,8,r,r,r,r,r,n=i?r:n);return s.placeholder=e.placeholder,s},Br.curryRight=function e(t,n,i){var s=Qi(t,a,r,r,r,r,r,n=i?r:n);return s.placeholder=e.placeholder,s},Br.debounce=Aa,Br.defaults=To,Br.defaultsDeep=xo,Br.defer=Ma,Br.delay=Ra,Br.difference=Bs,Br.differenceBy=Vs,Br.differenceWith=Us,Br.drop=function(e,t,n){var i=null==e?0:e.length;return i?ni(e,(t=n||t===r?1:fo(t))<0?0:t,i):[]},Br.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ni(e,0,(t=i-(t=n||t===r?1:fo(t)))<0?0:t):[]},Br.dropRightWhile=function(e,t){return e&&e.length?pi(e,ls(t,3),!0,!0):[]},Br.dropWhile=function(e,t){return e&&e.length?pi(e,ls(t,3),!0):[]},Br.fill=function(e,t,n,i){var s=null==e?0:e.length;return s?(n&&"number"!=typeof n&&bs(e,t,n)&&(n=0,i=s),function(e,t,n,i){var s=e.length;for((n=fo(n))<0&&(n=-n>s?0:s+n),(i=i===r||i>s?s:fo(i))<0&&(i+=s),i=n>i?0:mo(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Br.filter=function(e,t){return(ja(e)?At:gn)(e,ls(t,3))},Br.flatMap=function(e,t){return yn(Ca(e,t),1)},Br.flatMapDeep=function(e,t){return yn(Ca(e,t),d)},Br.flatMapDepth=function(e,t,n){return n=n===r?1:fo(n),yn(Ca(e,t),n)},Br.flatten=Gs,Br.flattenDeep=function(e){return(null==e?0:e.length)?yn(e,d):[]},Br.flattenDepth=function(e,t){return(null==e?0:e.length)?yn(e,t=t===r?1:fo(t)):[]},Br.flip=function(e){return Qi(e,512)},Br.flow=tl,Br.flowRight=rl,Br.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Br.functions=function(e){return null==e?[]:Cn(e,Mo(e))},Br.functionsIn=function(e){return null==e?[]:Cn(e,Ro(e))},Br.groupBy=ba,Br.initial=function(e){return(null==e?0:e.length)?ni(e,0,-1):[]},Br.intersection=Zs,Br.intersectionBy=Ws,Br.intersectionWith=Ks,Br.invert=Io,Br.invertBy=ko,Br.invokeMap=Sa,Br.iteratee=il,Br.keyBy=Ea,Br.keys=Mo,Br.keysIn=Ro,Br.map=Ca,Br.mapKeys=function(e,t){var r={};return t=ls(t,3),Sn(e,(function(e,n,i){sn(r,t(e,n,i),e)})),r},Br.mapValues=function(e,t){var r={};return t=ls(t,3),Sn(e,(function(e,n,i){sn(r,n,t(e,n,i))})),r},Br.matches=function(e){return Vn(ln(e,1))},Br.matchesProperty=function(e,t){return Un(e,ln(t,1))},Br.memoize=Oa,Br.merge=Oo,Br.mergeWith=$o,Br.method=sl,Br.methodOf=al,Br.mixin=ol,Br.negate=$a,Br.nthArg=function(e){return e=fo(e),qn((function(t){return jn(t,e)}))},Br.omit=Do,Br.omitBy=function(e,t){return Fo(e,$a(ls(t)))},Br.once=function(e){return wa(2,e)},Br.orderBy=function(e,t,n,i){return null==e?[]:(ja(t)||(t=null==t?[]:[t]),ja(n=i?r:n)||(n=null==n?[]:[n]),Gn(e,t,n))},Br.over=cl,Br.overArgs=Da,Br.overEvery=hl,Br.overSome=dl,Br.partial=La,Br.partialRight=Fa,Br.partition=_a,Br.pick=Lo,Br.pickBy=Fo,Br.property=ul,Br.propertyOf=function(e){return function(t){return null==e?r:_n(e,t)}},Br.pull=qs,Br.pullAll=Qs,Br.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Zn(e,t,ls(r,2)):e},Br.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Zn(e,t,r,n):e},Br.pullAt=Xs,Br.range=pl,Br.rangeRight=fl,Br.rearg=Na,Br.reject=function(e,t){return(ja(e)?At:gn)(e,$a(ls(t,3)))},Br.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],s=e.length;for(t=ls(t,3);++n<s;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Wn(e,i),r},Br.rest=function(e,t){if("function"!=typeof e)throw new ke(n);return qn(e,t=t===r?t:fo(t))},Br.reverse=Js,Br.sampleSize=function(e,t,n){return t=(n?bs(e,t,n):t===r)?1:fo(t),(ja(e)?Qr:Xn)(e,t)},Br.set=function(e,t,r){return null==e?e:Jn(e,t,r)},Br.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Jn(e,t,n,i)},Br.shuffle=function(e){return(ja(e)?Xr:ri)(e)},Br.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bs(e,t,n)?(t=0,n=i):(t=null==t?0:fo(t),n=n===r?i:fo(n)),ni(e,t,n)):[]},Br.sortBy=Ta,Br.sortedUniq=function(e){return e&&e.length?oi(e):[]},Br.sortedUniqBy=function(e,t){return e&&e.length?oi(e,ls(t,2)):[]},Br.split=function(e,t,n){return n&&"number"!=typeof n&&bs(e,t,n)&&(t=n=r),(n=n===r?f:n>>>0)?(e=vo(e))&&("string"==typeof t||null!=t&&!io(t))&&!(t=ci(t))&&sr(e)?Ei(ur(e),0,n):e.split(t,n):[]},Br.spread=function(e,t){if("function"!=typeof e)throw new ke(n);return t=null==t?0:yr(fo(t),0),qn((function(r){var n=r[t],i=Ei(r,0,t);return n&&$t(i,n),xt(e,this,i)}))},Br.tail=function(e){var t=null==e?0:e.length;return t?ni(e,1,t):[]},Br.take=function(e,t,n){return e&&e.length?ni(e,0,(t=n||t===r?1:fo(t))<0?0:t):[]},Br.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ni(e,(t=i-(t=n||t===r?1:fo(t)))<0?0:t,i):[]},Br.takeRightWhile=function(e,t){return e&&e.length?pi(e,ls(t,3),!1,!0):[]},Br.takeWhile=function(e,t){return e&&e.length?pi(e,ls(t,3)):[]},Br.tap=function(e,t){return t(e),e},Br.throttle=function(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new ke(n);return Ja(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),Aa(e,t,{leading:i,maxWait:t,trailing:s})},Br.thru=ua,Br.toArray=uo,Br.toPairs=No,Br.toPairsIn=Bo,Br.toPath=function(e){return ja(e)?Ot(e,Ls):oo(e)?[e]:ki(Ds(vo(e)))},Br.toPlainObject=yo,Br.transform=function(e,t,r){var n=ja(e),i=n||Wa(e)||lo(e);if(t=ls(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:Ja(e)&&qa(s)?Vr(Ze(e)):{}}return(i?wt:Sn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Br.unary=function(e){return Pa(e,1)},Br.union=ea,Br.unionBy=ta,Br.unionWith=ra,Br.uniq=function(e){return e&&e.length?hi(e):[]},Br.uniqBy=function(e,t){return e&&e.length?hi(e,ls(t,2)):[]},Br.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?hi(e,r,t):[]},Br.unset=function(e,t){return null==e||di(e,t)},Br.unzip=na,Br.unzipWith=ia,Br.update=function(e,t,r){return null==e?e:ui(e,t,vi(r))},Br.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ui(e,t,vi(n),i)},Br.values=Vo,Br.valuesIn=function(e){return null==e?[]:Xt(e,Ro(e))},Br.without=sa,Br.words=Qo,Br.wrap=function(e,t){return La(vi(t),e)},Br.xor=aa,Br.xorBy=oa,Br.xorWith=la,Br.zip=ca,Br.zipObject=function(e,t){return gi(e||[],t||[],en)},Br.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jn)},Br.zipWith=ha,Br.entries=No,Br.entriesIn=Bo,Br.extend=So,Br.extendWith=Eo,ol(Br,Br),Br.add=yl,Br.attempt=Xo,Br.camelCase=Uo,Br.capitalize=zo,Br.ceil=vl,Br.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=go(n))==n?n:0),t!==r&&(t=(t=go(t))==t?t:0),on(go(e),t,n)},Br.clone=function(e){return ln(e,4)},Br.cloneDeep=function(e){return ln(e,5)},Br.cloneDeepWith=function(e,t){return ln(e,5,t="function"==typeof t?t:r)},Br.cloneWith=function(e,t){return ln(e,4,t="function"==typeof t?t:r)},Br.conformsTo=function(e,t){return null==t||cn(e,t,Mo(t))},Br.deburr=jo,Br.defaultTo=function(e,t){return null==e||e!=e?t:e},Br.divide=bl,Br.endsWith=function(e,t,n){e=vo(e),t=ci(t);var i=e.length,s=n=n===r?i:on(fo(n),0,i);return(n-=t.length)>=0&&e.slice(n,s)==t},Br.eq=Ba,Br.escape=function(e){return(e=vo(e))&&Y.test(e)?e.replace(W,nr):e},Br.escapeRegExp=function(e){return(e=vo(e))&&ne.test(e)?e.replace(re,"\\$&"):e},Br.every=function(e,t,n){var i=ja(e)?kt:fn;return n&&bs(e,t,n)&&(t=r),i(e,ls(t,3))},Br.find=ma,Br.findIndex=zs,Br.findKey=function(e,t){return Bt(e,ls(t,3),Sn)},Br.findLast=ga,Br.findLastIndex=js,Br.findLastKey=function(e,t){return Bt(e,ls(t,3),En)},Br.floor=Sl,Br.forEach=ya,Br.forEachRight=va,Br.forIn=function(e,t){return null==e?e:vn(e,ls(t,3),Ro)},Br.forInRight=function(e,t){return null==e?e:bn(e,ls(t,3),Ro)},Br.forOwn=function(e,t){return e&&Sn(e,ls(t,3))},Br.forOwnRight=function(e,t){return e&&En(e,ls(t,3))},Br.get=Po,Br.gt=Va,Br.gte=Ua,Br.has=function(e,t){return null!=e&&ms(e,t,wn)},Br.hasIn=wo,Br.head=Hs,Br.identity=nl,Br.includes=function(e,t,r,n){e=Ha(e)?e:Vo(e),r=r&&!n?fo(r):0;var i=e.length;return r<0&&(r=yr(i+r,0)),ao(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Br.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fo(r);return i<0&&(i=yr(n+i,0)),Ut(e,t,i)},Br.inRange=function(e,t,n){return t=po(t),n===r?(n=t,t=0):n=po(n),function(e,t,r){return e>=vr(t,r)&&e<yr(t,r)}(e=go(e),t,n)},Br.invoke=Ao,Br.isArguments=za,Br.isArray=ja,Br.isArrayBuffer=Ga,Br.isArrayLike=Ha,Br.isArrayLikeObject=Za,Br.isBoolean=function(e){return!0===e||!1===e||eo(e)&&xn(e)==v},Br.isBuffer=Wa,Br.isDate=Ka,Br.isElement=function(e){return eo(e)&&1===e.nodeType&&!no(e)},Br.isEmpty=function(e){if(null==e)return!0;if(Ha(e)&&(ja(e)||"string"==typeof e||"function"==typeof e.splice||Wa(e)||lo(e)||za(e)))return!e.length;var t=fs(e);if(t==_||t==I)return!e.size;if(_s(e))return!Ln(e).length;for(var r in e)if(De.call(e,r))return!1;return!0},Br.isEqual=function(e,t){return Rn(e,t)},Br.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Rn(e,t,r,n):!!i},Br.isError=Ya,Br.isFinite=function(e){return"number"==typeof e&&Nt(e)},Br.isFunction=qa,Br.isInteger=Qa,Br.isLength=Xa,Br.isMap=to,Br.isMatch=function(e,t){return e===t||On(e,t,hs(t))},Br.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,On(e,t,hs(t),n)},Br.isNaN=function(e){return ro(e)&&e!=+e},Br.isNative=function(e){if(Cs(e))throw new _e("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return $n(e)},Br.isNil=function(e){return null==e},Br.isNull=function(e){return null===e},Br.isNumber=ro,Br.isObject=Ja,Br.isObjectLike=eo,Br.isPlainObject=no,Br.isRegExp=io,Br.isSafeInteger=function(e){return Qa(e)&&e>=-9007199254740991&&e<=u},Br.isSet=so,Br.isString=ao,Br.isSymbol=oo,Br.isTypedArray=lo,Br.isUndefined=function(e){return e===r},Br.isWeakMap=function(e){return eo(e)&&fs(e)==M},Br.isWeakSet=function(e){return eo(e)&&"[object WeakSet]"==xn(e)},Br.join=function(e,t){return null==e?"":Zt.call(e,t)},Br.kebabCase=Go,Br.last=Ys,Br.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==r&&(s=(s=fo(n))<0?yr(i+s,0):vr(s,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,s):Vt(e,jt,s,!0)},Br.lowerCase=Ho,Br.lowerFirst=Zo,Br.lt=co,Br.lte=ho,Br.max=function(e){return e&&e.length?mn(e,nl,Pn):r},Br.maxBy=function(e,t){return e&&e.length?mn(e,ls(t,2),Pn):r},Br.mean=function(e){return Gt(e,nl)},Br.meanBy=function(e,t){return Gt(e,ls(t,2))},Br.min=function(e){return e&&e.length?mn(e,nl,Nn):r},Br.minBy=function(e,t){return e&&e.length?mn(e,ls(t,2),Nn):r},Br.stubArray=ml,Br.stubFalse=gl,Br.stubObject=function(){return{}},Br.stubString=function(){return""},Br.stubTrue=function(){return!0},Br.multiply=Cl,Br.nth=function(e,t){return e&&e.length?jn(e,fo(t)):r},Br.noConflict=function(){return pt._===this&&(pt._=Ve),this},Br.noop=ll,Br.now=xa,Br.pad=function(e,t,r){e=vo(e);var n=(t=fo(t))?dr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Gi(mt(i),r)+e+Gi(ft(i),r)},Br.padEnd=function(e,t,r){e=vo(e);var n=(t=fo(t))?dr(e):0;return t&&n<t?e+Gi(t-n,r):e},Br.padStart=function(e,t,r){e=vo(e);var n=(t=fo(t))?dr(e):0;return t&&n<t?Gi(t-n,r)+e:e},Br.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),Sr(vo(e).replace(ie,""),t||0)},Br.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bs(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=po(e),t===r?(t=e,e=0):t=po(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var s=Er();return vr(e+s*(t-e+ct("1e-"+((s+"").length-1))),t)}return Kn(e,t)},Br.reduce=function(e,t,r){var n=ja(e)?Dt:Wt,i=arguments.length<3;return n(e,ls(t,4),r,i,un)},Br.reduceRight=function(e,t,r){var n=ja(e)?Lt:Wt,i=arguments.length<3;return n(e,ls(t,4),r,i,pn)},Br.repeat=function(e,t,n){return t=(n?bs(e,t,n):t===r)?1:fo(t),Yn(vo(e),t)},Br.replace=function(){var e=arguments,t=vo(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Br.result=function(e,t,n){var i=-1,s=(t=bi(t,e)).length;for(s||(s=1,e=r);++i<s;){var a=null==e?r:e[Ls(t[i])];a===r&&(i=s,a=n),e=qa(a)?a.call(e):a}return e},Br.round=_l,Br.runInContext=e,Br.sample=function(e){return(ja(e)?qr:Qn)(e)},Br.size=function(e){if(null==e)return 0;if(Ha(e))return ao(e)?dr(e):e.length;var t=fs(e);return t==_||t==I?e.size:Ln(e).length},Br.snakeCase=Wo,Br.some=function(e,t,n){var i=ja(e)?Ft:ii;return n&&bs(e,t,n)&&(t=r),i(e,ls(t,3))},Br.sortedIndex=function(e,t){return si(e,t)},Br.sortedIndexBy=function(e,t,r){return ai(e,t,ls(r,2))},Br.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=si(e,t);if(n<r&&Ba(e[n],t))return n}return-1},Br.sortedLastIndex=function(e,t){return si(e,t,!0)},Br.sortedLastIndexBy=function(e,t,r){return ai(e,t,ls(r,2),!0)},Br.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=si(e,t,!0)-1;if(Ba(e[r],t))return r}return-1},Br.startCase=Ko,Br.startsWith=function(e,t,r){return e=vo(e),r=null==r?0:on(fo(r),0,e.length),t=ci(t),e.slice(r,r+t.length)==t},Br.subtract=Tl,Br.sum=function(e){return e&&e.length?Kt(e,nl):0},Br.sumBy=function(e,t){return e&&e.length?Kt(e,ls(t,2)):0},Br.template=function(e,t,n){var i=Br.templateSettings;n&&bs(e,t,n)&&(t=r),e=vo(e),t=Eo({},t,i,Xi);var s,a,o=Eo({},t.imports,i.imports,Xi),l=Mo(o),c=Xt(o,l),h=0,d=t.interpolate||Se,u="__p += '",p=we((t.escape||Se).source+"|"+d.source+"|"+(d===X?ue:Se).source+"|"+(t.evaluate||Se).source+"|$","g"),f="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++st+"]")+"\n";e.replace(p,(function(t,r,n,i,o,l){return n||(n=i),u+=e.slice(h,l).replace(Ee,ir),r&&(s=!0,u+="' +\n__e("+r+") +\n'"),o&&(a=!0,u+="';\n"+o+";\n__p += '"),n&&(u+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=l+t.length,t})),u+="';\n";var m=De.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new _e("Invalid `variable` option passed into `_.template`")}else u="with (obj) {\n"+u+"\n}\n";u=(a?u.replace(j,""):u).replace(G,"$1").replace(H,"$1;"),u="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}";var g=Xo((function(){return Te(l,f+"return "+u).apply(r,c)}));if(g.source=u,Ya(g))throw g;return g},Br.times=function(e,t){if((e=fo(e))<1||e>u)return[];var r=f,n=vr(e,f);t=ls(t),e-=f;for(var i=Yt(n,t);++r<e;)t(r);return i},Br.toFinite=po,Br.toInteger=fo,Br.toLength=mo,Br.toLower=function(e){return vo(e).toLowerCase()},Br.toNumber=go,Br.toSafeInteger=function(e){return e?on(fo(e),-9007199254740991,u):0===e?e:0},Br.toString=vo,Br.toUpper=function(e){return vo(e).toUpperCase()},Br.trim=function(e,t,n){if((e=vo(e))&&(n||t===r))return qt(e);if(!e||!(t=ci(t)))return e;var i=ur(e),s=ur(t);return Ei(i,er(i,s),tr(i,s)+1).join("")},Br.trimEnd=function(e,t,n){if((e=vo(e))&&(n||t===r))return e.slice(0,pr(e)+1);if(!e||!(t=ci(t)))return e;var i=ur(e);return Ei(i,0,tr(i,ur(t))+1).join("")},Br.trimStart=function(e,t,n){if((e=vo(e))&&(n||t===r))return e.replace(ie,"");if(!e||!(t=ci(t)))return e;var i=ur(e);return Ei(i,er(i,ur(t))).join("")},Br.truncate=function(e,t){var n=30,i="...";if(Ja(t)){var s="separator"in t?t.separator:s;n="length"in t?fo(t.length):n,i="omission"in t?ci(t.omission):i}var a=(e=vo(e)).length;if(sr(e)){var o=ur(e);a=o.length}if(n>=a)return e;var l=n-dr(i);if(l<1)return i;var c=o?Ei(o,0,l).join(""):e.slice(0,l);if(s===r)return c+i;if(o&&(l+=c.length-l),io(s)){if(e.slice(l).search(s)){var h,d=c;for(s.global||(s=we(s.source,vo(pe.exec(s))+"g")),s.lastIndex=0;h=s.exec(d);)var u=h.index;c=c.slice(0,u===r?l:u)}}else if(e.indexOf(ci(s),l)!=l){var p=c.lastIndexOf(s);p>-1&&(c=c.slice(0,p))}return c+i},Br.unescape=function(e){return(e=vo(e))&&K.test(e)?e.replace(Z,fr):e},Br.uniqueId=function(e){var t=++Le;return vo(e)+t},Br.upperCase=Yo,Br.upperFirst=qo,Br.each=ya,Br.eachRight=va,Br.first=Hs,ol(Br,(El={},Sn(Br,(function(e,t){De.call(Br.prototype,t)||(El[t]=e)})),El),{chain:!1}),Br.VERSION="4.17.21",wt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Br[e].placeholder=Br})),wt(["drop","take"],(function(e,t){jr.prototype[e]=function(n){n=n===r?1:yr(fo(n),0);var i=this.__filtered__&&!t?new jr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,f),type:e+(i.__dir__<0?"Right":"")}),i},jr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),wt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;jr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ls(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),wt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");jr.prototype[e]=function(){return this[r](1).value()[0]}})),wt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");jr.prototype[e]=function(){return this.__filtered__?new jr(this):this[r](1)}})),jr.prototype.compact=function(){return this.filter(nl)},jr.prototype.find=function(e){return this.filter(e).head()},jr.prototype.findLast=function(e){return this.reverse().find(e)},jr.prototype.invokeMap=qn((function(e,t){return"function"==typeof e?new jr(this):this.map((function(r){return An(r,e,t)}))})),jr.prototype.reject=function(e){return this.filter($a(ls(e)))},jr.prototype.slice=function(e,t){e=fo(e);var n=this;return n.__filtered__&&(e>0||t<0)?new jr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fo(t))<0?n.dropRight(-t):n.take(t-e)),n)},jr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},jr.prototype.toArray=function(){return this.take(f)},Sn(jr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=Br[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);s&&(Br.prototype[t]=function(){var t=this.__wrapped__,o=i?[1]:arguments,l=t instanceof jr,c=o[0],h=l||ja(t),d=function(e){var t=s.apply(Br,$t([e],o));return i&&u?t[0]:t};h&&n&&"function"==typeof c&&1!=c.length&&(l=h=!1);var u=this.__chain__,p=!!this.__actions__.length,f=a&&!u,m=l&&!p;if(!a&&h){t=m?t:new jr(this);var g=e.apply(t,o);return g.__actions__.push({func:ua,args:[d],thisArg:r}),new zr(g,u)}return f&&m?e.apply(this,o):(g=this.thru(d),f?i?g.value()[0]:g.value():g)})})),wt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Br.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(ja(i)?i:[],e)}return this[r]((function(r){return t.apply(ja(r)?r:[],e)}))}})),Sn(jr.prototype,(function(e,t){var r=Br[t];if(r){var n=r.name+"";De.call(Ar,n)||(Ar[n]=[]),Ar[n].push({name:t,func:r})}})),Ar[Vi(r,2).name]=[{name:"wrapper",func:r}],jr.prototype.clone=function(){var e=new jr(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},jr.prototype.reverse=function(){if(this.__filtered__){var e=new jr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},jr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=ja(e),n=t<0,i=r?e.length:0,s=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var s=r[n],a=s.size;switch(s.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=vr(t,e+a);break;case"takeRight":e=yr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=s.start,o=s.end,l=o-a,c=n?o:a-1,h=this.__iteratees__,d=h.length,u=0,p=vr(l,this.__takeCount__);if(!r||!n&&i==l&&p==l)return fi(e,this.__actions__);var f=[];e:for(;l--&&u<p;){for(var m=-1,g=e[c+=t];++m<d;){var y=h[m],v=y.iteratee,b=y.type,S=v(g);if(2==b)g=S;else if(!S){if(1==b)continue e;break e}}f[u++]=g}return f},Br.prototype.at=pa,Br.prototype.chain=function(){return da(this)},Br.prototype.commit=function(){return new zr(this.value(),this.__chain__)},Br.prototype.next=function(){this.__values__===r&&(this.__values__=uo(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Br.prototype.plant=function(e){for(var t,n=this;n instanceof Ur;){var i=Ns(n);i.__index__=0,i.__values__=r,t?s.__wrapped__=i:t=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,t},Br.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof jr){var t=e;return this.__actions__.length&&(t=new jr(this)),(t=t.reverse()).__actions__.push({func:ua,args:[Js],thisArg:r}),new zr(t,this.__chain__)}return this.thru(Js)},Br.prototype.toJSON=Br.prototype.valueOf=Br.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Br.prototype.first=Br.prototype.head,Qe&&(Br.prototype[Qe]=function(){return this}),Br}();mt?((mt.exports=mr)._=mr,ft._=mr):pt._=mr}).call(commonjsGlobal)}(lodash,lodash.exports);class LoveLetters{constructor(){this.loveLettersRoot=null}addLetter(e,t){var r;const n=document.querySelector("#letters-wrapper"),i=document.createElement("p");i.textContent=e,null===(r=null==i?void 0:i.classList)||void 0===r||r.add("letter-animation","letter-animation-enter"),n&&(n.appendChild(i),this.updateOpacity(t)),setTimeout((()=>{var e;null===(e=null==i?void 0:i.classList)||void 0===e||e.remove("letter-animation-enter"),null==i||i.addEventListener("transitioned",(()=>{this.updateOpacity(t)}))}),1e3)}updateOpacity(e){const t=document.querySelectorAll("#letters-block p"),r=1.2/t.length;t.forEach(((n,i)=>{var s;const a=n,o=.6-(t.length-1-i)*r*.6;e!==i+1?(a.style.opacity=Math.max(0,o).toString(),null===(s=null==a?void 0:a.classList)||void 0===s||s.add("letter-animation-exit")):a.style.opacity="1"}))}}var lottie$1={exports:{}};(function(module,exports){var factory;"undefined"!=typeof navigator&&(factory=function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var r,n,i=e.length;for(r=0;r<i;r+=1)for(var s in n=e[r].prototype)Object.prototype.hasOwnProperty.call(n,s)&&(t.prototype[s]=n[s])}function getDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)}function createProxyFunction(e){function t(){}return t.prototype=e,t}var audioControllerFactory=function(){function e(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return e.prototype={addAudio:function(e){this.audios.push(e)},pause:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].pause()},resume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].resume()},setRate:function(e){var t,r=this.audios.length;for(t=0;t<r;t+=1)this.audios[t].setRate(e)},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e},setVolume:function(e){this._volume=e,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1))}},function(){return new e}}(),createTypedArray=function(){function e(e,t){var r,n=0,i=[];switch(e){case"int16":case"uint8c":r=1;break;default:r=1.1}for(n=0;n<t;n+=1)i.push(r);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,r){return"float32"===t?new Float32Array(r):"int16"===t?new Int16Array(r):"uint8c"===t?new Uint8ClampedArray(r):e(t,r)}:e}();function createSizedArray(e){return Array.apply(null,{length:e})}function _typeof$6(e){return _typeof$6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(e)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};!function(){var e,t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],r=t.length;for(e=0;e<r;e+=1)BMMath[t[e]]=Math[t[e]]}(),BMMath.random=Math.random,BMMath.abs=function(e){if("object"===_typeof$6(e)&&e.length){var t,r=createSizedArray(e.length),n=e.length;for(t=0;t<n;t+=1)r[t]=Math.abs(e[t]);return r}return Math.abs(e)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(e){e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.display="block",e.style.transformOrigin="0 0",e.style.webkitTransformOrigin="0 0",e.style.backfaceVisibility="visible",e.style.webkitBackfaceVisibility="visible",e.style.transformStyle="preserve-3d",e.style.webkitTransformStyle="preserve-3d",e.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(e,t,r,n){this.type=e,this.currentTime=t,this.totalTime=r,this.direction=n<0?-1:1}function BMCompleteEvent(e,t){this.type=e,this.direction=t<0?-1:1}function BMCompleteLoopEvent(e,t,r,n){this.type=e,this.currentLoop=r,this.totalLoops=t,this.direction=n<0?-1:1}function BMSegmentStartEvent(e,t,r){this.type=e,this.firstFrame=t,this.totalFrames=r}function BMDestroyEvent(e,t){this.type=e,this.target=t}function BMRenderFrameErrorEvent(e,t){this.type="renderFrameError",this.nativeError=e,this.currentTime=t}function BMConfigErrorEvent(e){this.type="configError",this.nativeError=e}var createElementID=(_count=0,function(){return idPrefix$1+"__lottie_element_"+(_count+=1)}),_count;function HSVtoRGB(e,t,r){var n,i,s,a,o,l,c,h;switch(l=r*(1-t),c=r*(1-(o=6*e-(a=Math.floor(6*e)))*t),h=r*(1-(1-o)*t),a%6){case 0:n=r,i=h,s=l;break;case 1:n=c,i=r,s=l;break;case 2:n=l,i=r,s=h;break;case 3:n=l,i=c,s=r;break;case 4:n=h,i=l,s=r;break;case 5:n=r,i=l,s=c}return[n,i,s]}function RGBtoHSV(e,t,r){var n,i=Math.max(e,t,r),s=Math.min(e,t,r),a=i-s,o=0===i?0:a/i,l=i/255;switch(i){case s:n=0;break;case e:n=t-r+a*(t<r?6:0),n/=6*a;break;case t:n=r-e+2*a,n/=6*a;break;case r:n=e-t+4*a,n/=6*a}return[n,o,l]}function addSaturationToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[1]+=t,r[1]>1?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[2]+=t,r[2]>1?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[0]+=t/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var e,t,r=[];for(e=0;e<256;e+=1)t=e.toString(16),r[e]=1===t.length?"0"+t:t;return function(e,t,n){return e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),"#"+r[e]+r[t]+r[n]}}(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(e){return document.createElementNS(svgNS,e)}function _typeof$5(e){return _typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(e)}var dataManager=function(){var e,t,r=1,n=[],i={onmessage:function(){},postMessage:function(t){e({data:t})}},s={postMessage:function(e){i.onmessage({data:e})}};function a(){t||(t=function(t){if(window.Worker&&window.Blob&&getWebWorker()){var r=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),n=URL.createObjectURL(r);return new Worker(n)}return e=t,i}((function(e){if(s.dataManager||(s.dataManager=function(){function e(i,s){var a,o,l,c,h,u,p=i.length;for(o=0;o<p;o+=1)if("ks"in(a=i[o])&&!a.completed){if(a.completed=!0,a.hasMask){var f=a.masksProperties;for(c=f.length,l=0;l<c;l+=1)if(f[l].pt.k.i)n(f[l].pt.k);else for(u=f[l].pt.k.length,h=0;h<u;h+=1)f[l].pt.k[h].s&&n(f[l].pt.k[h].s[0]),f[l].pt.k[h].e&&n(f[l].pt.k[h].e[0])}0===a.ty?(a.layers=t(a.refId,s),e(a.layers,s)):4===a.ty?r(a.shapes):5===a.ty&&d(a)}}function t(e,t){var r=function(e,t){for(var r=0,n=t.length;r<n;){if(t[r].id===e)return t[r];r+=1}return null}(e,t);return r?r.layers.__used?JSON.parse(JSON.stringify(r.layers)):(r.layers.__used=!0,r.layers):null}function r(e){var t,i,s;for(t=e.length-1;t>=0;t-=1)if("sh"===e[t].ty)if(e[t].ks.k.i)n(e[t].ks.k);else for(s=e[t].ks.k.length,i=0;i<s;i+=1)e[t].ks.k[i].s&&n(e[t].ks.k[i].s[0]),e[t].ks.k[i].e&&n(e[t].ks.k[i].e[0]);else"gr"===e[t].ty&&r(e[t].it)}function n(e){var t,r=e.i.length;for(t=0;t<r;t+=1)e.i[t][0]+=e.v[t][0],e.i[t][1]+=e.v[t][1],e.o[t][0]+=e.v[t][0],e.o[t][1]+=e.v[t][1]}function i(e,t){var r=t?t.split("."):[100,100,100];return e[0]>r[0]||!(r[0]>e[0])&&(e[1]>r[1]||!(r[1]>e[1])&&(e[2]>r[2]||!(r[2]>e[2])&&null))}var s,a=function(){var e=[4,4,14];function t(e){var t,r,n,i=e.length;for(t=0;t<i;t+=1)5===e[t].ty&&(n=void 0,n=(r=e[t]).t.d,r.t.d={k:[{s:n,t:0}]})}return function(r){if(i(e,r.v)&&(t(r.layers),r.assets)){var n,s=r.assets.length;for(n=0;n<s;n+=1)r.assets[n].layers&&t(r.assets[n].layers)}}}(),o=(s=[4,7,99],function(e){if(e.chars&&!i(s,e.v)){var t,n=e.chars.length;for(t=0;t<n;t+=1){var a=e.chars[t];a.data&&a.data.shapes&&(r(a.data.shapes),a.data.ip=0,a.data.op=99999,a.data.st=0,a.data.sr=1,a.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},e.chars[t].t||(a.data.shapes.push({ty:"no"}),a.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),l=function(){var e=[5,7,15];function t(e){var t,r,n=e.length;for(t=0;t<n;t+=1)5===e[t].ty&&(r=void 0,"number"==typeof(r=e[t].t.p).a&&(r.a={a:0,k:r.a}),"number"==typeof r.p&&(r.p={a:0,k:r.p}),"number"==typeof r.r&&(r.r={a:0,k:r.r}))}return function(r){if(i(e,r.v)&&(t(r.layers),r.assets)){var n,s=r.assets.length;for(n=0;n<s;n+=1)r.assets[n].layers&&t(r.assets[n].layers)}}}(),c=function(){var e=[4,1,9];function t(e){var r,n,i,s=e.length;for(r=0;r<s;r+=1)if("gr"===e[r].ty)t(e[r].it);else if("fl"===e[r].ty||"st"===e[r].ty)if(e[r].c.k&&e[r].c.k[0].i)for(i=e[r].c.k.length,n=0;n<i;n+=1)e[r].c.k[n].s&&(e[r].c.k[n].s[0]/=255,e[r].c.k[n].s[1]/=255,e[r].c.k[n].s[2]/=255,e[r].c.k[n].s[3]/=255),e[r].c.k[n].e&&(e[r].c.k[n].e[0]/=255,e[r].c.k[n].e[1]/=255,e[r].c.k[n].e[2]/=255,e[r].c.k[n].e[3]/=255);else e[r].c.k[0]/=255,e[r].c.k[1]/=255,e[r].c.k[2]/=255,e[r].c.k[3]/=255}function r(e){var r,n=e.length;for(r=0;r<n;r+=1)4===e[r].ty&&t(e[r].shapes)}return function(t){if(i(e,t.v)&&(r(t.layers),t.assets)){var n,s=t.assets.length;for(n=0;n<s;n+=1)t.assets[n].layers&&r(t.assets[n].layers)}}}(),h=function(){var e=[4,4,18];function t(e){var r,n,i;for(r=e.length-1;r>=0;r-=1)if("sh"===e[r].ty)if(e[r].ks.k.i)e[r].ks.k.c=e[r].closed;else for(i=e[r].ks.k.length,n=0;n<i;n+=1)e[r].ks.k[n].s&&(e[r].ks.k[n].s[0].c=e[r].closed),e[r].ks.k[n].e&&(e[r].ks.k[n].e[0].c=e[r].closed);else"gr"===e[r].ty&&t(e[r].it)}function r(e){var r,n,i,s,a,o,l=e.length;for(n=0;n<l;n+=1){if((r=e[n]).hasMask){var c=r.masksProperties;for(s=c.length,i=0;i<s;i+=1)if(c[i].pt.k.i)c[i].pt.k.c=c[i].cl;else for(o=c[i].pt.k.length,a=0;a<o;a+=1)c[i].pt.k[a].s&&(c[i].pt.k[a].s[0].c=c[i].cl),c[i].pt.k[a].e&&(c[i].pt.k[a].e[0].c=c[i].cl)}4===r.ty&&t(r.shapes)}}return function(t){if(i(e,t.v)&&(r(t.layers),t.assets)){var n,s=t.assets.length;for(n=0;n<s;n+=1)t.assets[n].layers&&r(t.assets[n].layers)}}}();function d(e){0===e.t.a.length&&e.t.p}var u={completeData:function(r){r.__complete||(c(r),a(r),o(r),l(r),h(r),e(r.layers,r.assets),function(r,n){if(r){var i=0,s=r.length;for(i=0;i<s;i+=1)1===r[i].t&&(r[i].data.layers=t(r[i].data.refId,n),e(r[i].data.layers,n))}}(r.chars,r.assets),r.__complete=!0)}};return u.checkColors=c,u.checkChars=o,u.checkPathProperties=l,u.checkShapes=h,u.completeLayers=e,u}()),s.assetLoader||(s.assetLoader=function(){function e(e){var t=e.getResponseHeader("content-type");return t&&"json"===e.responseType&&-1!==t.indexOf("json")||e.response&&"object"===_typeof$5(e.response)?e.response:e.response&&"string"==typeof e.response?JSON.parse(e.response):e.responseText?JSON.parse(e.responseText):null}return{load:function(t,r,n,i){var s,a=new XMLHttpRequest;try{a.responseType="json"}catch(e){}a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)s=e(a),n(s);else try{s=e(a),n(s)}catch(e){i&&i(e)}};try{a.open(["G","E","T"].join(""),t,!0)}catch(e){a.open(["G","E","T"].join(""),r+"/"+t,!0)}a.send()}}}()),"loadAnimation"===e.data.type)s.assetLoader.load(e.data.path,e.data.fullPath,(function(t){s.dataManager.completeData(t),s.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){s.postMessage({id:e.data.id,status:"error"})}));else if("complete"===e.data.type){var t=e.data.animation;s.dataManager.completeData(t),s.postMessage({id:e.data.id,payload:t,status:"success"})}else"loadData"===e.data.type&&s.assetLoader.load(e.data.path,e.data.fullPath,(function(t){s.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){s.postMessage({id:e.data.id,status:"error"})}))})),t.onmessage=function(e){var t=e.data,r=t.id,i=n[r];n[r]=null,"success"===t.status?i.onComplete(t.payload):i.onError&&i.onError()})}function o(e,t){var i="processId_"+(r+=1);return n[i]={onComplete:e,onError:t},i}return{loadAnimation:function(e,r,n){a();var i=o(r,n);t.postMessage({type:"loadAnimation",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},loadData:function(e,r,n){a();var i=o(r,n);t.postMessage({type:"loadData",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},completeAnimation:function(e,r,n){a();var i=o(r,n);t.postMessage({type:"complete",animation:e,id:i})}}}(),ImagePreloader=function(){var e=function(){var e=createTag("canvas");e.width=1,e.height=1;var t=e.getContext("2d");return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),e}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(e,t,r){var n="";if(e.e)n=e.p;else if(t){var i=e.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),n=t+i}else n=r,n+=e.u?e.u:"",n+=e.p;return n}function i(e){var t=0,r=setInterval(function(){(e.getBBox().width||t>500)&&(this._imageLoaded(),clearInterval(r)),t+=1}.bind(this),50)}function s(e){var t={assetData:e},r=n(e,this.assetsPath,this.path);return dataManager.loadData(r,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function a(){this._imageLoaded=t.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=i.bind(this),this.createFootageData=s.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return a.prototype={loadAssets:function(e,t){var r;this.imagesLoadedCb=t;var n=e.length;for(r=0;r<n;r+=1)e[r].layers||(e[r].t&&"seq"!==e[r].t?3===e[r].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(e[r]))):(this.totalImages+=1,this.images.push(this._createImageData(e[r]))))},setAssetsPath:function(e){this.assetsPath=e||""},setPath:function(e){this.path=e||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(e){for(var t=0,r=this.images.length;t<r;){if(this.images[t].assetData===e)return this.images[t].img;t+=1}return null},createImgData:function(t){var r=n(t,this.assetsPath,this.path),i=createTag("img");i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){s.img=e,this._imageLoaded()}.bind(this),!1),i.src=r;var s={img:i,assetData:t};return s},createImageData:function(t){var r=n(t,this.assetsPath,this.path),i=createNS("image");isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){s.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",r),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var s={img:i,assetData:t};return s},imageLoaded:t,footageLoaded:r,setCacheType:function(e,t){"svg"===e?(this._elementHelper=t,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},a}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var r=this._cbs[e],n=0;n<r.length;n+=1)r[n](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),function(){this.removeEventListener(e,t)}.bind(this)},removeEventListener:function(e,t){if(t){if(this._cbs[e]){for(var r=0,n=this._cbs[e].length;r<n;)this._cbs[e][r]===t&&(this._cbs[e].splice(r,1),r-=1,n-=1),r+=1;this._cbs[e].length||(this._cbs[e]=null)}}else this._cbs[e]=null}};var markerParser=function(){function e(e){for(var t,r=e.split("\r\n"),n={},i=0,s=0;s<r.length;s+=1)2===(t=r[s].split(":")).length&&(n[t[0]]=t[1].trim(),i+=1);if(0===i)throw new Error;return n}return function(t){for(var r=[],n=0;n<t.length;n+=1){var i=t[n],s={time:i.tm,duration:i.dr};try{s.payload=JSON.parse(t[n].cm)}catch(r){try{s.payload=e(t[n].cm)}catch(e){s.payload={name:t[n].cm}}}r.push(s)}return r}}(),ProjectInterface=function(){function e(e){this.compositions.push(e)}return function(){function t(e){for(var t=0,r=this.compositions.length;t<r;){if(this.compositions[t].data&&this.compositions[t].data.nm===e)return this.compositions[t].prepareFrame&&this.compositions[t].data.xt&&this.compositions[t].prepareFrame(this.currentFrame),this.compositions[t].compInterface;t+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),renderers={},registerRenderer=function(e,t){renderers[e]=t};function getRenderer(e){return renderers[e]}function _typeof$4(e){return _typeof$4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(e)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0)};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(e){(e.wrapper||e.container)&&(this.wrapper=e.wrapper||e.container);var t="svg";e.animType?t=e.animType:e.renderer&&(t=e.renderer);var r=getRenderer(t);this.renderer=new r(this,e.rendererSettings),this.imagePreloader.setCacheType(t,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=t,""===e.loop||null===e.loop||void 0===e.loop||!0===e.loop?this.loop=!0:!1===e.loop?this.loop=!1:this.loop=parseInt(e.loop,10),this.autoplay=!("autoplay"in e)||e.autoplay,this.name=e.name?e.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(e,"autoloadSegments")||e.autoloadSegments,this.assetsPath=e.assetsPath,this.initialSegment=e.initialSegment,e.audioFactory&&this.audioController.setAudioFactory(e.audioFactory),e.animationData?this.setupAnimation(e.animationData):e.path&&(-1!==e.path.lastIndexOf("\\")?this.path=e.path.substr(0,e.path.lastIndexOf("\\")+1):this.path=e.path.substr(0,e.path.lastIndexOf("/")+1),this.fileName=e.path.substr(e.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(e.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(e){dataManager.completeAnimation(e,this.configAnimation)},AnimationItem.prototype.setData=function(e,t){t&&"object"!==_typeof$4(t)&&(t=JSON.parse(t));var r={wrapper:e,animationData:t},n=e.attributes;r.path=n.getNamedItem("data-animation-path")?n.getNamedItem("data-animation-path").value:n.getNamedItem("data-bm-path")?n.getNamedItem("data-bm-path").value:n.getNamedItem("bm-path")?n.getNamedItem("bm-path").value:"",r.animType=n.getNamedItem("data-anim-type")?n.getNamedItem("data-anim-type").value:n.getNamedItem("data-bm-type")?n.getNamedItem("data-bm-type").value:n.getNamedItem("bm-type")?n.getNamedItem("bm-type").value:n.getNamedItem("data-bm-renderer")?n.getNamedItem("data-bm-renderer").value:n.getNamedItem("bm-renderer")?n.getNamedItem("bm-renderer").value:"canvas";var i=n.getNamedItem("data-anim-loop")?n.getNamedItem("data-anim-loop").value:n.getNamedItem("data-bm-loop")?n.getNamedItem("data-bm-loop").value:n.getNamedItem("bm-loop")?n.getNamedItem("bm-loop").value:"";"false"===i?r.loop=!1:"true"===i?r.loop=!0:""!==i&&(r.loop=parseInt(i,10));var s=n.getNamedItem("data-anim-autoplay")?n.getNamedItem("data-anim-autoplay").value:n.getNamedItem("data-bm-autoplay")?n.getNamedItem("data-bm-autoplay").value:!n.getNamedItem("bm-autoplay")||n.getNamedItem("bm-autoplay").value;r.autoplay="false"!==s,r.name=n.getNamedItem("data-name")?n.getNamedItem("data-name").value:n.getNamedItem("data-bm-name")?n.getNamedItem("data-bm-name").value:n.getNamedItem("bm-name")?n.getNamedItem("bm-name").value:"","false"===(n.getNamedItem("data-anim-prerender")?n.getNamedItem("data-anim-prerender").value:n.getNamedItem("data-bm-prerender")?n.getNamedItem("data-bm-prerender").value:n.getNamedItem("bm-prerender")?n.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),this.setParams(r)},AnimationItem.prototype.includeLayers=function(e){e.op>this.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,r,n=this.animationData.layers,i=n.length,s=e.layers,a=s.length;for(r=0;r<a;r+=1)for(t=0;t<i;){if(n[t].id===s[r].id){n[t]=s[r];break}t+=1}if((e.chars||e.fonts)&&(this.renderer.globalData.fontManager.addChars(e.chars),this.renderer.globalData.fontManager.addFonts(e.fonts,this.renderer.globalData.defs)),e.assets)for(i=e.assets.length,t=0;t<i;t+=1)this.animationData.assets.push(e.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(e){this.animationData=e;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var e=this.animationData.segments;if(!e||0===e.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var t=e.shift();this.timeCompleted=t.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(e){if(this.renderer)try{this.animationData=e,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(e),e.assets||(e.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(e.assets),this.markers=markerParser(e.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(e,t){var r="number"==typeof e?e:void 0,n="number"==typeof t?t:void 0;this.renderer.updateContainerSize(r,n)},AnimationItem.prototype.setSubframe=function(e){this.isSubframeEnabled=!!e},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_pause"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_play"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,r=0;r<this.markers.length;r+=1)if((t=this.markers[r]).payload&&t.payload.name===e)return t;return null},AnimationItem.prototype.goToAndStop=function(e,t,r){if(!r||this.name===r){var n=Number(e);if(isNaN(n)){var i=this.getMarkerData(e);i&&this.goToAndStop(i.time,!0)}else t?this.setCurrentRawFrameValue(e):this.setCurrentRawFrameValue(e*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(e,t,r){if(!r||this.name===r){var n=Number(e);if(isNaN(n)){var i=this.getMarkerData(e);i&&(i.duration?this.playSegments([i.time,i.time+i.duration],!0):this.goToAndStop(i.time,!0))}else this.goToAndStop(n,t,r);this.play()}},AnimationItem.prototype.advanceTime=function(e){if(!0!==this.isPaused&&!1!==this.isLoaded){var t=this.currentRawFrame+e*this.frameModifier,r=!1;t>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(r=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),r&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]<e[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<e?r=e:this.currentRawFrame+this.firstFrame>t&&(r=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"===_typeof$4(e[0])){var r,n=e.length;for(r=0;r<n;r+=1)this.segments.push(e[r])}else this.segments.push(e);this.segments.length&&t&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(e){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),e&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(e){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),e),!0)},AnimationItem.prototype.destroy=function(e){e&&this.name!==e||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.renderer=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(e){this.currentRawFrame=e,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(e){this.playSpeed=e,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(e){this.playDirection=e<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(e){this.loop=e},AnimationItem.prototype.setVolume=function(e,t){t&&this.name!==t||this.audioController.setVolume(e)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(e){e&&this.name!==e||this.audioController.mute()},AnimationItem.prototype.unmute=function(e){e&&this.name!==e||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(e){var t="";if(e.e)t=e.p;else if(this.assetsPath){var r=e.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),t=this.assetsPath+r}else t=this.path,t+=e.u?e.u:"",t+=e.p;return t},AnimationItem.prototype.getAssetData=function(e){for(var t=0,r=this.assets.length;t<r;){if(e===this.assets[t].id)return this.assets[t];t+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(e){return e?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(e,t,r){try{this.renderer.getElementByPath(e).updateDocumentData(t,r)}catch(e){}},AnimationItem.prototype.trigger=function(e){if(this._cbs&&this._cbs[e])switch(e){case"enterFrame":this.triggerEvent(e,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(e,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(e,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(e,new BMCompleteEvent(e,this.frameMult));break;case"segmentStart":this.triggerEvent(e,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(e,new BMDestroyEvent(e,this));break;default:this.triggerEvent(e)}"enterFrame"===e&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===e&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult)),"complete"===e&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(e,this.frameMult)),"segmentStart"===e&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames)),"destroy"===e&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(e,this))},AnimationItem.prototype.triggerRenderFrameError=function(e){var t=new BMRenderFrameErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},AnimationItem.prototype.triggerConfigError=function(e){var t=new BMConfigErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)};var animationManager=function(){var e={},t=[],r=0,n=0,i=0,s=!0,a=!1;function o(e){for(var r=0,i=e.target;r<n;)t[r].animation===i&&(t.splice(r,1),r-=1,n-=1,i.isPaused||h()),r+=1}function l(e,r){if(!e)return null;for(var i=0;i<n;){if(t[i].elem===e&&null!==t[i].elem)return t[i].animation;i+=1}var s=new AnimationItem;return d(s,e),s.setData(e,r),s}function c(){i+=1,f()}function h(){i-=1}function d(e,r){e.addEventListener("destroy",o),e.addEventListener("_active",c),e.addEventListener("_idle",h),t.push({elem:r,animation:e}),n+=1}function u(e){var o,l=e-r;for(o=0;o<n;o+=1)t[o].animation.advanceTime(l);r=e,i&&!a?window.requestAnimationFrame(u):s=!0}function p(e){r=e,window.requestAnimationFrame(u)}function f(){!a&&i&&s&&(window.requestAnimationFrame(p),s=!1)}return e.registerAnimation=l,e.loadAnimation=function(e){var t=new AnimationItem;return d(t,null),t.setParams(e),t},e.setSpeed=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setSpeed(e,r)},e.setDirection=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setDirection(e,r)},e.play=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.play(e)},e.pause=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.pause(e)},e.stop=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.stop(e)},e.togglePause=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.togglePause(e)},e.searchAnimations=function(e,t,r){var n,i=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),s=i.length;for(n=0;n<s;n+=1)r&&i[n].setAttribute("data-bm-type",r),l(i[n],e);if(t&&0===s){r||(r="svg");var a=document.getElementsByTagName("body")[0];a.innerText="";var o=createTag("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",r),a.appendChild(o),l(o,e)}},e.resize=function(){var e;for(e=0;e<n;e+=1)t[e].animation.resize()},e.goToAndStop=function(e,r,i){var s;for(s=0;s<n;s+=1)t[s].animation.goToAndStop(e,r,i)},e.destroy=function(e){var r;for(r=n-1;r>=0;r-=1)t[r].animation.destroy(e)},e.freeze=function(){a=!0},e.unfreeze=function(){a=!1,f()},e.setVolume=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setVolume(e,r)},e.mute=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.mute(e)},e.unmute=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.unmute(e)},e.getRegisteredAnimations=function(){var e,r=t.length,n=[];for(e=0;e<r;e+=1)n.push(t[e].animation);return n},e}(),BezierFactory=function(){var e={getBezierEasing:function(e,r,n,i,s){var a=s||("bez_"+e+"_"+r+"_"+n+"_"+i).replace(/\./g,"p");if(t[a])return t[a];var o=new h([e,r,n,i]);return t[a]=o,o}},t={},r=11,n=1/(r-1),i="function"==typeof Float32Array;function s(e,t){return 1-3*t+3*e}function a(e,t){return 3*t-6*e}function o(e){return 3*e}function l(e,t,r){return((s(t,r)*e+a(t,r))*e+o(t))*e}function c(e,t,r){return 3*s(t,r)*e*e+2*a(t,r)*e+o(t)}function h(e){this._p=e,this._mSampleValues=i?new Float32Array(r):new Array(r),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(e){var t=this._p[0],r=this._p[1],n=this._p[2],i=this._p[3];return this._precomputed||this._precompute(),t===r&&n===i?e:0===e?0:1===e?1:l(this._getTForX(e),r,i)},_precompute:function(){var e=this._p[0],t=this._p[1],r=this._p[2],n=this._p[3];this._precomputed=!0,e===t&&r===n||this._calcSampleValues()},_calcSampleValues:function(){for(var e=this._p[0],t=this._p[2],i=0;i<r;++i)this._mSampleValues[i]=l(i*n,e,t)},_getTForX:function(e){for(var t=this._p[0],i=this._p[2],s=this._mSampleValues,a=0,o=1,h=r-1;o!==h&&s[o]<=e;++o)a+=n;var d=a+(e-s[--o])/(s[o+1]-s[o])*n,u=c(d,t,i);return u>=.001?function(e,t,r,n){for(var i=0;i<4;++i){var s=c(t,r,n);if(0===s)return t;t-=(l(t,r,n)-e)/s}return t}(e,d,t,i):0===u?d:function(e,t,r,n,i){var s,a,o=0;do{(s=l(a=t+(r-t)/2,n,i)-e)>0?r=a:t=a}while(Math.abs(s)>1e-7&&++o<10);return a}(e,a,a+n,t,i)}},e}(),pooling={double:function(e){return e.concat(createSizedArray(e.length))}},poolFactory=function(e,t,r){var n=0,i=e,s=createSizedArray(i);return{newElement:function(){return n?s[n-=1]:t()},release:function(e){n===i&&(s=pooling.double(s),i*=2),r&&r(e),s[n]=e,n+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(e){var t,r=e.lengths.length;for(t=0;t<r;t+=1)bezierLengthPool.release(e.lengths[t]);e.lengths.length=0}));function bezFunction(){var e=Math;function t(e,t,r,n,i,s){var a=e*n+t*i+r*s-i*n-s*e-r*t;return a>-.001&&a<.001}var r=function(e,t,r,n){var i,s,a,o,l,c,h=getDefaultCurveSegments(),d=0,u=[],p=[],f=bezierLengthPool.newElement();for(a=r.length,i=0;i<h;i+=1){for(l=i/(h-1),c=0,s=0;s<a;s+=1)o=bmPow(1-l,3)*e[s]+3*bmPow(1-l,2)*l*r[s]+3*(1-l)*bmPow(l,2)*n[s]+bmPow(l,3)*t[s],u[s]=o,null!==p[s]&&(c+=bmPow(u[s]-p[s],2)),p[s]=u[s];c&&(d+=c=bmSqrt(c)),f.percents[i]=l,f.lengths[i]=d}return f.addedLength=d,f};function n(e){this.segmentLength=0,this.points=new Array(e)}function i(e,t){this.partialLength=e,this.point=t}var s,a=(s={},function(e,r,a,o){var l=(e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+a[0]+"_"+a[1]+"_"+o[0]+"_"+o[1]).replace(/\./g,"p");if(!s[l]){var c,h,d,u,p,f,m,g=getDefaultCurveSegments(),y=0,v=null;2===e.length&&(e[0]!==r[0]||e[1]!==r[1])&&t(e[0],e[1],r[0],r[1],e[0]+a[0],e[1]+a[1])&&t(e[0],e[1],r[0],r[1],r[0]+o[0],r[1]+o[1])&&(g=2);var b=new n(g);for(d=a.length,c=0;c<g;c+=1){for(m=createSizedArray(d),p=c/(g-1),f=0,h=0;h<d;h+=1)u=bmPow(1-p,3)*e[h]+3*bmPow(1-p,2)*p*(e[h]+a[h])+3*(1-p)*bmPow(p,2)*(r[h]+o[h])+bmPow(p,3)*r[h],m[h]=u,null!==v&&(f+=bmPow(m[h]-v[h],2));y+=f=bmSqrt(f),b.points[c]=new i(f,m),v=m}b.segmentLength=y,s[l]=b}return s[l]});function o(e,t){var r=t.percents,n=t.lengths,i=r.length,s=bmFloor((i-1)*e),a=e*t.addedLength,o=0;if(s===i-1||0===s||a===n[s])return r[s];for(var l=n[s]>a?-1:1,c=!0;c;)if(n[s]<=a&&n[s+1]>a?(o=(a-n[s])/(n[s+1]-n[s]),c=!1):s+=l,s<0||s>=i-1){if(s===i-1)return r[s];c=!1}return r[s]+(r[s+1]-r[s])*o}var l=createTypedArray("float32",8);return{getSegmentsLength:function(e){var t,n=segmentsLengthPool.newElement(),i=e.c,s=e.v,a=e.o,o=e.i,l=e._length,c=n.lengths,h=0;for(t=0;t<l-1;t+=1)c[t]=r(s[t],s[t+1],a[t],o[t+1]),h+=c[t].addedLength;return i&&l&&(c[t]=r(s[t],s[0],a[t],o[0]),h+=c[t].addedLength),n.totalLength=h,n},getNewSegment:function(t,r,n,i,s,a,c){s<0?s=0:s>1&&(s=1);var h,d=o(s,c),u=o(a=a>1?1:a,c),p=t.length,f=1-d,m=1-u,g=f*f*f,y=d*f*f*3,v=d*d*f*3,b=d*d*d,S=f*f*m,E=d*f*m+f*d*m+f*f*u,C=d*d*m+f*d*u+d*f*u,_=d*d*u,T=f*m*m,x=d*m*m+f*u*m+f*m*u,P=d*u*m+f*u*u+d*m*u,w=d*u*u,I=m*m*m,k=u*m*m+m*u*m+m*m*u,A=u*u*m+m*u*u+u*m*u,M=u*u*u;for(h=0;h<p;h+=1)l[4*h]=e.round(1e3*(g*t[h]+y*n[h]+v*i[h]+b*r[h]))/1e3,l[4*h+1]=e.round(1e3*(S*t[h]+E*n[h]+C*i[h]+_*r[h]))/1e3,l[4*h+2]=e.round(1e3*(T*t[h]+x*n[h]+P*i[h]+w*r[h]))/1e3,l[4*h+3]=e.round(1e3*(I*t[h]+k*n[h]+A*i[h]+M*r[h]))/1e3;return l},getPointInSegment:function(t,r,n,i,s,a){var l=o(s,a),c=1-l;return[e.round(1e3*(c*c*c*t[0]+(l*c*c+c*l*c+c*c*l)*n[0]+(l*l*c+c*l*l+l*c*l)*i[0]+l*l*l*r[0]))/1e3,e.round(1e3*(c*c*c*t[1]+(l*c*c+c*l*c+c*c*l)*n[1]+(l*l*c+c*l*l+l*c*l)*i[1]+l*l*l*r[1]))/1e3]},buildBezierData:a,pointOnLine2D:t,pointOnLine3D:function(r,n,i,s,a,o,l,c,h){if(0===i&&0===o&&0===h)return t(r,n,s,a,l,c);var d,u=e.sqrt(e.pow(s-r,2)+e.pow(a-n,2)+e.pow(o-i,2)),p=e.sqrt(e.pow(l-r,2)+e.pow(c-n,2)+e.pow(h-i,2)),f=e.sqrt(e.pow(l-s,2)+e.pow(c-a,2)+e.pow(h-o,2));return(d=u>p?u>f?u-p-f:f-p-u:f>p?f-p-u:p-u-f)>-1e-4&&d<1e-4}}}var bez=bezFunction(),PropertyFactory=function(){var e=initialDefaultFrame,t=Math.abs;function r(e,t){var r,i=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var s,a,o,l,c,h,d,u,p,f=t.lastIndex,m=f,g=this.keyframes.length-1,y=!0;y;){if(s=this.keyframes[m],a=this.keyframes[m+1],m===g-1&&e>=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>e){f=m;break}m<g-1?m+=1:(f=0,y=!1)}o=this.keyframesMetadata[m]||{};var v,b,S,E,C,_,T,x,P,w,I=a.t-i,k=s.t-i;if(s.to){o.bezierData||(o.bezierData=bez.buildBezierData(s.s,a.s||s.e,s.to,s.ti));var A=o.bezierData;if(e>=I||e<k){var M=e>=I?A.points.length-1:0;for(c=A.points[M].point.length,l=0;l<c;l+=1)r[l]=A.points[M].point[l]}else{o.__fnct?p=o.__fnct:(p=BezierFactory.getBezierEasing(s.o.x,s.o.y,s.i.x,s.i.y,s.n).get,o.__fnct=p),h=p((e-k)/(I-k));var R,O=A.segmentLength*h,$=t.lastFrame<e&&t._lastKeyframeIndex===m?t._lastAddedLength:0;for(u=t.lastFrame<e&&t._lastKeyframeIndex===m?t._lastPoint:0,y=!0,d=A.points.length;y;){if($+=A.points[u].partialLength,0===O||0===h||u===A.points.length-1){for(c=A.points[u].point.length,l=0;l<c;l+=1)r[l]=A.points[u].point[l];break}if(O>=$&&O<$+A.points[u+1].partialLength){for(R=(O-$)/A.points[u+1].partialLength,c=A.points[u].point.length,l=0;l<c;l+=1)r[l]=A.points[u].point[l]+(A.points[u+1].point[l]-A.points[u].point[l])*R;break}u<d-1?u+=1:y=!1}t._lastPoint=u,t._lastAddedLength=$-A.points[u].partialLength,t._lastKeyframeIndex=m}}else{var D,L,F,N,B;if(g=s.s.length,v=a.s||s.e,this.sh&&1!==s.h)if(e>=I)r[0]=v[0],r[1]=v[1],r[2]=v[2];else if(e<=k)r[0]=s.s[0],r[1]=s.s[1],r[2]=s.s[2];else{var V=n(s.s),U=n(v);b=r,S=function(e,t,r){var n,i,s,a,o,l=[],c=e[0],h=e[1],d=e[2],u=e[3],p=t[0],f=t[1],m=t[2],g=t[3];return(i=c*p+h*f+d*m+u*g)<0&&(i=-i,p=-p,f=-f,m=-m,g=-g),1-i>1e-6?(n=Math.acos(i),s=Math.sin(n),a=Math.sin((1-r)*n)/s,o=Math.sin(r*n)/s):(a=1-r,o=r),l[0]=a*c+o*p,l[1]=a*h+o*f,l[2]=a*d+o*m,l[3]=a*u+o*g,l}(V,U,(e-k)/(I-k)),E=S[0],C=S[1],_=S[2],T=S[3],x=Math.atan2(2*C*T-2*E*_,1-2*C*C-2*_*_),P=Math.asin(2*E*C+2*_*T),w=Math.atan2(2*E*T-2*C*_,1-2*E*E-2*_*_),b[0]=x/degToRads,b[1]=P/degToRads,b[2]=w/degToRads}else for(m=0;m<g;m+=1)1!==s.h&&(e>=I?h=1:e<k?h=0:(s.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[m]?p=o.__fnct[m]:(D=void 0===s.o.x[m]?s.o.x[0]:s.o.x[m],L=void 0===s.o.y[m]?s.o.y[0]:s.o.y[m],F=void 0===s.i.x[m]?s.i.x[0]:s.i.x[m],N=void 0===s.i.y[m]?s.i.y[0]:s.i.y[m],p=BezierFactory.getBezierEasing(D,L,F,N).get,o.__fnct[m]=p)):o.__fnct?p=o.__fnct:(D=s.o.x,L=s.o.y,F=s.i.x,N=s.i.y,p=BezierFactory.getBezierEasing(D,L,F,N).get,s.keyframeMetadata=p),h=p((e-k)/(I-k)))),v=a.s||s.e,B=1===s.h?s.s[m]:s.s[m]+(v[m]-s.s[m])*h,"multidimensional"===this.propType?r[m]=B:r=B}return t.lastIndex=f,r}function n(e){var t=e[0]*degToRads,r=e[1]*degToRads,n=e[2]*degToRads,i=Math.cos(t/2),s=Math.cos(r/2),a=Math.cos(n/2),o=Math.sin(t/2),l=Math.sin(r/2),c=Math.sin(n/2);return[o*l*a+i*s*c,o*s*a+i*l*c,i*l*a-o*s*c,i*s*a-o*l*c]}function i(){var t=this.comp.renderedFrame-this.offsetTime,r=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==e&&(this._caching.lastFrame>=n&&t>=n||this._caching.lastFrame<r&&t<r))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function s(e){var r;if("unidimensional"===this.propType)r=e*this.mult,t(this.v-r)>1e-5&&(this.v=r,this._mdf=!0);else for(var n=0,i=this.v.length;n<i;)r=e[n]*this.mult,t(this.v[n]-r)>1e-5&&(this.v[n]=r,this._mdf=!0),n+=1}function a(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e;this.lock=!0,this._mdf=this._isFirstFrame;var t=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(e=0;e<t;e+=1)r=this.effectsSequence[e](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function o(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(e,t,r,n){this.propType="unidimensional",this.mult=r||1,this.data=t,this.v=r?t.k*r:t.k,this.pv=t.k,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=a,this.setVValue=s,this.addEffect=o}function c(e,t,r,n){var i;this.propType="multidimensional",this.mult=r||1,this.data=t,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.frameId=-1;var l=t.k.length;for(this.v=createTypedArray("float32",l),this.pv=createTypedArray("float32",l),this.vel=createTypedArray("float32",l),i=0;i<l;i+=1)this.v[i]=t.k[i]*this.mult,this.pv[i]=t.k[i];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=a,this.setVValue=s,this.addEffect=o}function h(t,n,l,c){this.propType="unidimensional",this.keyframes=n.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:e,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=n,this.mult=l||1,this.elem=t,this.container=c,this.comp=t.comp,this.v=e,this.pv=e,this._isFirstFrame=!0,this.getValue=a,this.setVValue=s,this.interpolateValue=r,this.effectsSequence=[i.bind(this)],this.addEffect=o}function d(t,n,l,c){var h;this.propType="multidimensional";var d,u,p,f,m=n.k.length;for(h=0;h<m-1;h+=1)n.k[h].to&&n.k[h].s&&n.k[h+1]&&n.k[h+1].s&&(d=n.k[h].s,u=n.k[h+1].s,p=n.k[h].to,f=n.k[h].ti,(2===d.length&&(d[0]!==u[0]||d[1]!==u[1])&&bez.pointOnLine2D(d[0],d[1],u[0],u[1],d[0]+p[0],d[1]+p[1])&&bez.pointOnLine2D(d[0],d[1],u[0],u[1],u[0]+f[0],u[1]+f[1])||3===d.length&&(d[0]!==u[0]||d[1]!==u[1]||d[2]!==u[2])&&bez.pointOnLine3D(d[0],d[1],d[2],u[0],u[1],u[2],d[0]+p[0],d[1]+p[1],d[2]+p[2])&&bez.pointOnLine3D(d[0],d[1],d[2],u[0],u[1],u[2],u[0]+f[0],u[1]+f[1],u[2]+f[2]))&&(n.k[h].to=null,n.k[h].ti=null),d[0]===u[0]&&d[1]===u[1]&&0===p[0]&&0===p[1]&&0===f[0]&&0===f[1]&&(2===d.length||d[2]===u[2]&&0===p[2]&&0===f[2])&&(n.k[h].to=null,n.k[h].ti=null));this.effectsSequence=[i.bind(this)],this.data=n,this.keyframes=n.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=l||1,this.elem=t,this.container=c,this.comp=t.comp,this.getValue=a,this.setVValue=s,this.interpolateValue=r,this.frameId=-1;var g=n.k[0].s.length;for(this.v=createTypedArray("float32",g),this.pv=createTypedArray("float32",g),h=0;h<g;h+=1)this.v[h]=e,this.pv[h]=e;this._caching={lastFrame:e,lastIndex:0,value:createTypedArray("float32",g)},this.addEffect=o}var u={getProp:function(e,t,r,n,i){var s;if(t.k.length)if("number"==typeof t.k[0])s=new c(e,t,n,i);else switch(r){case 0:s=new h(e,t,n,i);break;case 1:s=new d(e,t,n,i)}else s=new l(e,t,n,i);return s.effectsSequence.length&&i.addDynamicProperty(s),s}};return u}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var e;this._mdf=!1;var t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=poolFactory(8,(function(){return createTypedArray("float32",2)}));function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(e,t){this.c=e,this.setLength(t);for(var r=0;r<t;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(e){for(;this._maxLength<e;)this.doubleArrayLength();this._length=e},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(e,t,r,n,i){var s;switch(this._length=Math.max(this._length,n+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":s=this.v;break;case"i":s=this.i;break;case"o":s=this.o;break;default:s=[]}(!s[n]||s[n]&&!i)&&(s[n]=pointPool.newElement()),s[n][0]=e,s[n][1]=t},ShapePath.prototype.setTripleAt=function(e,t,r,n,i,s,a,o){this.setXYAt(e,t,"v",a,o),this.setXYAt(r,n,"o",a,o),this.setXYAt(i,s,"i",a,o)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,r=this.o,n=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],n[0][0],n[0][1],r[0][0],r[0][1],0,!1),i=1);var s,a=this._length-1,o=this._length;for(s=i;s<o;s+=1)e.setTripleAt(t[a][0],t[a][1],n[a][0],n[a][1],r[a][0],r[a][1],s,!1),a-=1;return e},ShapePath.prototype.length=function(){return this._length};var shapePool=(factory=poolFactory(4,(function(){return new ShapePath}),(function(e){var t,r=e._length;for(t=0;t<r;t+=1)pointPool.release(e.v[t]),pointPool.release(e.i[t]),pointPool.release(e.o[t]),e.v[t]=null,e.i[t]=null,e.o[t]=null;e._length=0,e.c=!1})),factory.clone=function(e){var t,r=factory.newElement(),n=void 0===e._length?e.v.length:e._length;for(r.setLength(n),r.c=e.c,t=0;t<n;t+=1)r.setTripleAt(e.v[t][0],e.v[t][1],e.o[t][0],e.o[t][1],e.i[t][0],e.i[t][1],t);return r},factory),factory;function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(e){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=e,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var e;for(e=0;e<this._length;e+=1)shapePool.release(this.shapes[e]);this._length=0};var shapeCollectionPool=(ob={newShapeCollection:function(){return _length?pool[_length-=1]:new ShapeCollection},release:function(e){var t,r=e._length;for(t=0;t<r;t+=1)shapePool.release(e.shapes[t]);e._length=0,_length===_maxLength&&(pool=pooling.double(pool),_maxLength*=2),pool[_length]=e,_length+=1}},_length=0,_maxLength=4,pool=createSizedArray(_maxLength),ob),ob,_length,_maxLength,pool,ShapePropertyFactory=function(){var e=-999999;function t(e,t,r){var n,i,s,a,o,l,c,h,d,u=r.lastIndex,p=this.keyframes;if(e<p[0].t-this.offsetTime)n=p[0].s[0],s=!0,u=0;else if(e>=p[p.length-1].t-this.offsetTime)n=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],s=!0;else{for(var f,m,g,y=u,v=p.length-1,b=!0;b&&(f=p[y],!((m=p[y+1]).t-this.offsetTime>e));)y<v-1?y+=1:b=!1;if(g=this.keyframesMetadata[y]||{},u=y,!(s=1===f.h)){if(e>=m.t-this.offsetTime)h=1;else if(e<f.t-this.offsetTime)h=0;else{var S;g.__fnct?S=g.__fnct:(S=BezierFactory.getBezierEasing(f.o.x,f.o.y,f.i.x,f.i.y).get,g.__fnct=S),h=S((e-(f.t-this.offsetTime))/(m.t-this.offsetTime-(f.t-this.offsetTime)))}i=m.s?m.s[0]:f.e[0]}n=f.s[0]}for(l=t._length,c=n.i[0].length,r.lastIndex=u,a=0;a<l;a+=1)for(o=0;o<c;o+=1)d=s?n.i[a][o]:n.i[a][o]+(i.i[a][o]-n.i[a][o])*h,t.i[a][o]=d,d=s?n.o[a][o]:n.o[a][o]+(i.o[a][o]-n.o[a][o])*h,t.o[a][o]=d,d=s?n.v[a][o]:n.v[a][o]+(i.v[a][o]-n.v[a][o])*h,t.v[a][o]=d}function r(){var t=this.comp.renderedFrame-this.offsetTime,r=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==e&&(i<r&&t<r||i>n&&t>n)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function n(){this.paths=this.localShapeCollection}function i(e){(function(e,t){if(e._length!==t._length||e.c!==t.c)return!1;var r,n=e._length;for(r=0;r<n;r+=1)if(e.v[r][0]!==t.v[r][0]||e.v[r][1]!==t.v[r][1]||e.o[r][0]!==t.o[r][0]||e.o[r][1]!==t.o[r][1]||e.i[r][0]!==t.i[r][0]||e.i[r][1]!==t.i[r][1])return!1;return!0})(this.v,e)||(this.v=shapePool.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function s(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e,t;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(t=0;t<r;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function a(e,t,r){this.propType="shape",this.comp=e.comp,this.container=e,this.elem=e,this.data=t,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?t.pt.k:t.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=n,this.effectsSequence=[]}function o(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(t,i,s){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===s?i.pt.k:i.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var a=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,a),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=e,this.reset=n,this._caching={lastFrame:e,lastIndex:0},this.effectsSequence=[r.bind(this)]}a.prototype.interpolateShape=t,a.prototype.getValue=s,a.prototype.setVValue=i,a.prototype.addEffect=o,l.prototype.getValue=s,l.prototype.interpolateShape=t,l.prototype.setVValue=i,l.prototype.addEffect=o;var c=function(){var e=roundCorner;function t(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=t.d,this.elem=e,this.comp=e.comp,this.frameId=-1,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],r=this.p.v[1],n=this.s.v[0]/2,i=this.s.v[1]/2,s=3!==this.d,a=this.v;a.v[0][0]=t,a.v[0][1]=r-i,a.v[1][0]=s?t+n:t-n,a.v[1][1]=r,a.v[2][0]=t,a.v[2][1]=r+i,a.v[3][0]=s?t-n:t+n,a.v[3][1]=r,a.i[0][0]=s?t-n*e:t+n*e,a.i[0][1]=r-i,a.i[1][0]=s?t+n:t-n,a.i[1][1]=r-i*e,a.i[2][0]=s?t+n*e:t-n*e,a.i[2][1]=r+i,a.i[3][0]=s?t-n:t+n,a.i[3][1]=r+i*e,a.o[0][0]=s?t+n*e:t-n*e,a.o[0][1]=r-i,a.o[1][0]=s?t+n:t-n,a.o[1][1]=r+i*e,a.o[2][0]=s?t-n*e:t+n*e,a.o[2][1]=r+i,a.o[3][0]=s?t-n:t+n,a.o[3][1]=r-i*e}},extendPrototype([DynamicPropertyContainer],t),t}(),h=function(){function e(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=e,this.comp=e.comp,this.data=t,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),1===t.sy?(this.ir=PropertyFactory.getProp(e,t.ir,0,0,this),this.is=PropertyFactory.getProp(e,t.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(e,t.pt,0,0,this),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,degToRads,this),this.or=PropertyFactory.getProp(e,t.or,0,0,this),this.os=PropertyFactory.getProp(e,t.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return e.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var e,t,r,n,i=2*Math.floor(this.pt.v),s=2*Math.PI/i,a=!0,o=this.or.v,l=this.ir.v,c=this.os.v,h=this.is.v,d=2*Math.PI*o/(2*i),u=2*Math.PI*l/(2*i),p=-Math.PI/2;p+=this.r.v;var f=3===this.data.d?-1:1;for(this.v._length=0,e=0;e<i;e+=1){r=a?c:h,n=a?d:u;var m=(t=a?o:l)*Math.cos(p),g=t*Math.sin(p),y=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),v=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-y*n*r*f,g-v*n*r*f,m+y*n*r*f,g+v*n*r*f,e,!0),a=!a,p+=s*f}},convertPolygonToPath:function(){var e,t=Math.floor(this.pt.v),r=2*Math.PI/t,n=this.or.v,i=this.os.v,s=2*Math.PI*n/(4*t),a=.5*-Math.PI,o=3===this.data.d?-1:1;for(a+=this.r.v,this.v._length=0,e=0;e<t;e+=1){var l=n*Math.cos(a),c=n*Math.sin(a),h=0===l&&0===c?0:c/Math.sqrt(l*l+c*c),d=0===l&&0===c?0:-l/Math.sqrt(l*l+c*c);l+=+this.p.v[0],c+=+this.p.v[1],this.v.setTripleAt(l,c,l-h*s*i*o,c-d*s*i*o,l+h*s*i*o,c+d*s*i*o,e,!0),a+=r*o}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],e),e}(),d=function(){function e(e,t){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=e,this.comp=e.comp,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return e.prototype={convertRectToPath:function(){var e=this.p.v[0],t=this.p.v[1],r=this.s.v[0]/2,n=this.s.v[1]/2,i=bmMin(r,n,this.r.v),s=i*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(e+r,t-n+i,e+r,t-n+i,e+r,t-n+s,0,!0),this.v.setTripleAt(e+r,t+n-i,e+r,t+n-s,e+r,t+n-i,1,!0),0!==i?(this.v.setTripleAt(e+r-i,t+n,e+r-i,t+n,e+r-s,t+n,2,!0),this.v.setTripleAt(e-r+i,t+n,e-r+s,t+n,e-r+i,t+n,3,!0),this.v.setTripleAt(e-r,t+n-i,e-r,t+n-i,e-r,t+n-s,4,!0),this.v.setTripleAt(e-r,t-n+i,e-r,t-n+s,e-r,t-n+i,5,!0),this.v.setTripleAt(e-r+i,t-n,e-r+i,t-n,e-r+s,t-n,6,!0),this.v.setTripleAt(e+r-i,t-n,e+r-s,t-n,e+r-i,t-n,7,!0)):(this.v.setTripleAt(e-r,t+n,e-r+s,t+n,e-r,t+n,2),this.v.setTripleAt(e-r,t-n,e-r,t-n+s,e-r,t-n,3))):(this.v.setTripleAt(e+r,t-n+i,e+r,t-n+s,e+r,t-n+i,0,!0),0!==i?(this.v.setTripleAt(e+r-i,t-n,e+r-i,t-n,e+r-s,t-n,1,!0),this.v.setTripleAt(e-r+i,t-n,e-r+s,t-n,e-r+i,t-n,2,!0),this.v.setTripleAt(e-r,t-n+i,e-r,t-n+i,e-r,t-n+s,3,!0),this.v.setTripleAt(e-r,t+n-i,e-r,t+n-s,e-r,t+n-i,4,!0),this.v.setTripleAt(e-r+i,t+n,e-r+i,t+n,e-r+s,t+n,5,!0),this.v.setTripleAt(e+r-i,t+n,e+r-s,t+n,e+r-i,t+n,6,!0),this.v.setTripleAt(e+r,t+n-i,e+r,t+n-i,e+r,t+n-s,7,!0)):(this.v.setTripleAt(e-r,t-n,e-r+s,t-n,e-r,t-n,1,!0),this.v.setTripleAt(e-r,t+n,e-r,t+n-s,e-r,t+n,2,!0),this.v.setTripleAt(e+r,t+n,e+r-s,t+n,e+r,t+n,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:n},extendPrototype([DynamicPropertyContainer],e),e}(),u={getShapeProp:function(e,t,r){var n;return 3===r||4===r?n=(3===r?t.pt:t.ks).k.length?new l(e,t,r):new a(e,t,r):5===r?n=new d(e,t):6===r?n=new c(e,t):7===r&&(n=new h(e,t)),n.k&&e.addDynamicProperty(n),n},getConstructorFunction:function(){return a},getKeyframedConstructorFunction:function(){return l}};return u}(),Matrix=function(){var e=Math.cos,t=Math.sin,r=Math.tan,n=Math.round;function i(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function s(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1)}function a(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1)}function o(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1)}function l(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1)}function c(e,t){return this._t(1,t,e,1,0,0)}function h(e,t){return this.shear(r(e),r(t))}function d(n,i){var s=e(i),a=t(i);return this._t(s,a,0,0,-a,s,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,r(n),1,0,0,0,0,1,0,0,0,0,1)._t(s,-a,0,0,a,s,0,0,0,0,1,0,0,0,0,1)}function u(e,t,r){return r||0===r||(r=1),1===e&&1===t&&1===r?this:this._t(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1)}function p(e,t,r,n,i,s,a,o,l,c,h,d,u,p,f,m){return this.props[0]=e,this.props[1]=t,this.props[2]=r,this.props[3]=n,this.props[4]=i,this.props[5]=s,this.props[6]=a,this.props[7]=o,this.props[8]=l,this.props[9]=c,this.props[10]=h,this.props[11]=d,this.props[12]=u,this.props[13]=p,this.props[14]=f,this.props[15]=m,this}function f(e,t,r){return r=r||0,0!==e||0!==t||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,e,t,r,1):this}function m(e,t,r,n,i,s,a,o,l,c,h,d,u,p,f,m){var g=this.props;if(1===e&&0===t&&0===r&&0===n&&0===i&&1===s&&0===a&&0===o&&0===l&&0===c&&1===h&&0===d)return g[12]=g[12]*e+g[15]*u,g[13]=g[13]*s+g[15]*p,g[14]=g[14]*h+g[15]*f,g[15]*=m,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],S=g[3],E=g[4],C=g[5],_=g[6],T=g[7],x=g[8],P=g[9],w=g[10],I=g[11],k=g[12],A=g[13],M=g[14],R=g[15];return g[0]=y*e+v*i+b*l+S*u,g[1]=y*t+v*s+b*c+S*p,g[2]=y*r+v*a+b*h+S*f,g[3]=y*n+v*o+b*d+S*m,g[4]=E*e+C*i+_*l+T*u,g[5]=E*t+C*s+_*c+T*p,g[6]=E*r+C*a+_*h+T*f,g[7]=E*n+C*o+_*d+T*m,g[8]=x*e+P*i+w*l+I*u,g[9]=x*t+P*s+w*c+I*p,g[10]=x*r+P*a+w*h+I*f,g[11]=x*n+P*o+w*d+I*m,g[12]=k*e+A*i+M*l+R*u,g[13]=k*t+A*s+M*c+R*p,g[14]=k*r+A*a+M*h+R*f,g[15]=k*n+A*o+M*d+R*m,this._identityCalculated=!1,this}function g(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(e){for(var t=0;t<16;){if(e.props[t]!==this.props[t])return!1;t+=1}return!0}function v(e){var t;for(t=0;t<16;t+=1)e.props[t]=this.props[t];return e}function b(e){var t;for(t=0;t<16;t+=1)this.props[t]=e[t]}function S(e,t,r){return{x:e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12],y:e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13],z:e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]}}function E(e,t,r){return e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12]}function C(e,t,r){return e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13]}function _(e,t,r){return e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]}function T(){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],t=this.props[5]/e,r=-this.props[1]/e,n=-this.props[4]/e,i=this.props[0]/e,s=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,a=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e,o=new Matrix;return o.props[0]=t,o.props[1]=r,o.props[4]=n,o.props[5]=i,o.props[12]=s,o.props[13]=a,o}function x(e){return this.getInverseMatrix().applyToPointArray(e[0],e[1],e[2]||0)}function P(e){var t,r=e.length,n=[];for(t=0;t<r;t+=1)n[t]=x(e[t]);return n}function w(e,t,r){var n=createTypedArray("float32",6);if(this.isIdentity())n[0]=e[0],n[1]=e[1],n[2]=t[0],n[3]=t[1],n[4]=r[0],n[5]=r[1];else{var i=this.props[0],s=this.props[1],a=this.props[4],o=this.props[5],l=this.props[12],c=this.props[13];n[0]=e[0]*i+e[1]*a+l,n[1]=e[0]*s+e[1]*o+c,n[2]=t[0]*i+t[1]*a+l,n[3]=t[0]*s+t[1]*o+c,n[4]=r[0]*i+r[1]*a+l,n[5]=r[0]*s+r[1]*o+c}return n}function I(e,t,r){return this.isIdentity()?[e,t,r]:[e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12],e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13],e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]]}function k(e,t){if(this.isIdentity())return e+","+t;var r=this.props;return Math.round(100*(e*r[0]+t*r[4]+r[12]))/100+","+Math.round(100*(e*r[1]+t*r[5]+r[13]))/100}function A(){for(var e=0,t=this.props,r="matrix3d(";e<16;)r+=n(1e4*t[e])/1e4,r+=15===e?")":",",e+=1;return r}function M(e){return e<1e-6&&e>0||e>-1e-6&&e<0?n(1e4*e)/1e4:e}function R(){var e=this.props;return"matrix("+M(e[0])+","+M(e[1])+","+M(e[4])+","+M(e[5])+","+M(e[12])+","+M(e[13])+")"}return function(){this.reset=i,this.rotate=s,this.rotateX=a,this.rotateY=o,this.rotateZ=l,this.skew=h,this.skewFromAxis=d,this.shear=c,this.scale=u,this.setTransform=p,this.translate=f,this.transform=m,this.applyToPoint=S,this.applyToX=E,this.applyToY=C,this.applyToZ=_,this.applyToPointArray=I,this.applyToTriplePoints=w,this.applyToPointStringified=k,this.toCSS=A,this.to2dCSS=R,this.clone=v,this.cloneFromProps=b,this.equals=y,this.inversePoints=P,this.inversePoint=x,this.getInverseMatrix=T,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(e){return _typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(e)}var lottie={};function setLocation(e){setLocationHref(e)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return animationManager.loadAnimation(e)}function setQuality(e){if("string"==typeof e)switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(e,t){"expressions"===e&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),r=0;r<t.length;r+=1){var n=t[r].split("=");if(decodeURIComponent(n[0])==e)return decodeURIComponent(n[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.10.2";var queryString="",scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer");var readyStateCheckInterval=setInterval(checkReady,100);try{"object"!==_typeof$3(exports)&&(window.bodymovin=lottie)}catch(e){}var ShapeModifiers=function(){var e={},t={};return e.registerModifier=function(e,r){t[e]||(t[e]=r)},e.getModifier=function(e,r,n){return new t[e](r,n)},e}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(e){if(!this.closed){e.sh.container.addDynamicProperty(e.sh);var t={shape:e.sh,data:e,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(t),this.addShapeToModifier(t),this._isAnimated&&e.setAsAnimated()}},ShapeModifier.prototype.init=function(e,t){this.shapes=[],this.elem=e,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(e,t){this.s=PropertyFactory.getProp(e,t.s,0,.01,this),this.e=PropertyFactory.getProp(e,t.e,0,.01,this),this.o=PropertyFactory.getProp(e,t.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=t.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(e){e.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(e,t,r,n,i){var s=[];t<=1?s.push({s:e,e:t}):e>=1?s.push({s:e-1,e:t-1}):(s.push({s:e,e:1}),s.push({s:0,e:t-1}));var a,o,l=[],c=s.length;for(a=0;a<c;a+=1){var h,d;(o=s[a]).e*i<n||o.s*i>n+r||(h=o.s*i<=n?0:(o.s*i-n)/r,d=o.e*i>=n+r?1:(o.e*i-n)/r,l.push([h,d]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,r=e.length;for(t=0;t<r;t+=1)segmentsLengthPool.release(e[t]);return e.length=0,e},TrimModifier.prototype.processShapes=function(e){var t,r,n,i;if(this._mdf||e){var s=this.o.v%360/360;if(s<0&&(s+=1),(t=this.s.v>1?1+s:this.s.v<0?0+s:this.s.v+s)>(r=this.e.v>1?1+s:this.e.v<0?0+s:this.e.v+s)){var a=t;t=r,r=a}t=1e-4*Math.round(1e4*t),r=1e-4*Math.round(1e4*r),this.sValue=t,this.eValue=r}else t=this.sValue,r=this.eValue;var o,l,c,h,d,u=this.shapes.length,p=0;if(r===t)for(i=0;i<u;i+=1)this.shapes[i].localShapeCollection.releaseShapes(),this.shapes[i].shape._mdf=!0,this.shapes[i].shape.paths=this.shapes[i].localShapeCollection,this._mdf&&(this.shapes[i].pathsData.length=0);else if(1===r&&0===t||0===r&&1===t){if(this._mdf)for(i=0;i<u;i+=1)this.shapes[i].pathsData.length=0,this.shapes[i].shape._mdf=!0}else{var f,m,g=[];for(i=0;i<u;i+=1)if((f=this.shapes[i]).shape._mdf||this._mdf||e||2===this.m){if(l=(n=f.shape.paths)._length,d=0,!f.shape._mdf&&f.pathsData.length)d=f.totalShapeLength;else{for(c=this.releasePathsData(f.pathsData),o=0;o<l;o+=1)h=bez.getSegmentsLength(n.shapes[o]),c.push(h),d+=h.totalLength;f.totalShapeLength=d,f.pathsData=c}p+=d,f.shape._mdf=!0}else f.shape.paths=f.localShapeCollection;var y,v=t,b=r,S=0;for(i=u-1;i>=0;i-=1)if((f=this.shapes[i]).shape._mdf){for((m=f.localShapeCollection).releaseShapes(),2===this.m&&u>1?(y=this.calculateShapeEdges(t,r,f.totalShapeLength,S,p),S+=f.totalShapeLength):y=[[v,b]],l=y.length,o=0;o<l;o+=1){v=y[o][0],b=y[o][1],g.length=0,b<=1?g.push({s:f.totalShapeLength*v,e:f.totalShapeLength*b}):v>=1?g.push({s:f.totalShapeLength*(v-1),e:f.totalShapeLength*(b-1)}):(g.push({s:f.totalShapeLength*v,e:f.totalShapeLength}),g.push({s:0,e:f.totalShapeLength*(b-1)}));var E=this.addShapes(f,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(f.shape.paths.shapes[f.shape.paths._length-1].c){var C=E.pop();this.addPaths(E,m),E=this.addShapes(f,g[1],C)}else this.addPaths(E,m),E=this.addShapes(f,g[1]);this.addPaths(E,m)}}f.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)t.addShape(e[r])},TrimModifier.prototype.addSegment=function(e,t,r,n,i,s,a){i.setXYAt(t[0],t[1],"o",s),i.setXYAt(r[0],r[1],"i",s+1),a&&i.setXYAt(e[0],e[1],"v",s),i.setXYAt(n[0],n[1],"v",s+1)},TrimModifier.prototype.addSegmentFromArray=function(e,t,r,n){t.setXYAt(e[1],e[5],"o",r),t.setXYAt(e[2],e[6],"i",r+1),n&&t.setXYAt(e[0],e[4],"v",r),t.setXYAt(e[3],e[7],"v",r+1)},TrimModifier.prototype.addShapes=function(e,t,r){var n,i,s,a,o,l,c,h,d=e.pathsData,u=e.shape.paths.shapes,p=e.shape.paths._length,f=0,m=[],g=!0;for(r?(o=r._length,h=r._length):(r=shapePool.newElement(),o=0,h=0),m.push(r),n=0;n<p;n+=1){for(l=d[n].lengths,r.c=u[n].c,s=u[n].c?l.length:l.length+1,i=1;i<s;i+=1)if(f+(a=l[i-1]).addedLength<t.s)f+=a.addedLength,r.c=!1;else{if(f>t.e){r.c=!1;break}t.s<=f&&t.e>=f+a.addedLength?(this.addSegment(u[n].v[i-1],u[n].o[i-1],u[n].i[i],u[n].v[i],r,o,g),g=!1):(c=bez.getNewSegment(u[n].v[i-1],u[n].v[i],u[n].o[i-1],u[n].i[i],(t.s-f)/a.addedLength,(t.e-f)/a.addedLength,l[i-1]),this.addSegmentFromArray(c,r,o,g),g=!1,r.c=!1),f+=a.addedLength,o+=1}if(u[n].c&&l.length){if(a=l[i-1],f<=t.e){var y=l[i-1].addedLength;t.s<=f&&t.e>=f+y?(this.addSegment(u[n].v[i-1],u[n].o[i-1],u[n].i[0],u[n].v[0],r,o,g),g=!1):(c=bez.getNewSegment(u[n].v[i-1],u[n].v[0],u[n].o[i-1],u[n].i[0],(t.s-f)/y,(t.e-f)/y,l[i-1]),this.addSegmentFromArray(c,r,o,g),g=!1,r.c=!1)}else r.c=!1;f+=a.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[h][0],r.v[h][1],"i",h),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),f>t.e)break;n<p-1&&(r=shapePool.newElement(),g=!0,m.push(r),o=0)}return m},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(e,t){var r=t/100,n=[0,0],i=e._length,s=0;for(s=0;s<i;s+=1)n[0]+=e.v[s][0],n[1]+=e.v[s][1];n[0]/=i,n[1]/=i;var a,o,l,c,h,d,u=shapePool.newElement();for(u.c=e.c,s=0;s<i;s+=1)a=e.v[s][0]+(n[0]-e.v[s][0])*r,o=e.v[s][1]+(n[1]-e.v[s][1])*r,l=e.o[s][0]+(n[0]-e.o[s][0])*-r,c=e.o[s][1]+(n[1]-e.o[s][1])*-r,h=e.i[s][0]+(n[0]-e.i[s][0])*-r,d=e.i[s][1]+(n[1]-e.i[s][1])*-r,u.setTripleAt(a,o,l,c,h,d,s);return u},PuckerAndBloatModifier.prototype.processShapes=function(e){var t,r,n,i,s,a,o=this.shapes.length,l=this.amount.v;if(0!==l)for(r=0;r<o;r+=1){if(a=(s=this.shapes[r]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,n=0;n<i;n+=1)a.addShape(this.processPath(t[n],l));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var e=[0,0];function t(e,t,r){if(this.elem=e,this.frameId=-1,this.propType="transform",this.data=t,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||e),t.p&&t.p.s?(this.px=PropertyFactory.getProp(e,t.p.x,0,0,this),this.py=PropertyFactory.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=PropertyFactory.getProp(e,t.p.z,0,0,this))):this.p=PropertyFactory.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=PropertyFactory.getProp(e,t.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(e,t.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(e,t.rz,0,degToRads,this),t.or.k[0].ti){var n,i=t.or.k.length;for(n=0;n<i;n+=1)t.or.k[n].to=null,t.or.k[n].ti=null}this.or=PropertyFactory.getProp(e,t.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(e,t.r||{k:0},0,degToRads,this);t.sk&&(this.sk=PropertyFactory.getProp(e,t.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(e,t.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(e,t.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(e,t.s||{k:[100,100,100]},1,.01,this),t.o?this.o=PropertyFactory.getProp(e,t.o,0,.01,e):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return t.prototype={applyToMatrix:function(e){var t=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||t,this.a&&e.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&e.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&e.skewFromAxis(-this.sk.v,this.sa.v),this.r?e.rotate(-this.r.v):e.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?e.translate(this.px.v,this.py.v,-this.pz.v):e.translate(this.px.v,this.py.v,0):e.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var r;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var n,i;if(r=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(n=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/r,0),i=this.p.getValueAtTime(this.p.keyframes[0].t/r,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(n=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/r,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/r,0)):(n=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/r,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){n=[],i=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(n[0]=s.getValueAtTime((s.keyframes[0].t+.01)/r,0),n[1]=a.getValueAtTime((a.keyframes[0].t+.01)/r,0),i[0]=s.getValueAtTime(s.keyframes[0].t/r,0),i[1]=a.getValueAtTime(a.keyframes[0].t/r,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(n[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/r,0),n[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/r,0),i[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/r,0),i[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/r,0)):(n=[s.pv,a.pv],i[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/r,s.offsetTime),i[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/r,a.offsetTime))}else n=i=e;this.v.rotate(-Math.atan2(n[1]-i[1],n[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,r,n){return new t(e,r,n)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(e,t){return 1e5*Math.abs(e-t)<=Math.min(Math.abs(e),Math.abs(t))}function floatZero(e){return Math.abs(e)<=1e-5}function lerp(e,t,r){return e*(1-r)+t*r}function lerpPoint(e,t,r){return[lerp(e[0],t[0],r),lerp(e[1],t[1],r)]}function quadRoots(e,t,r){if(0===e)return[];var n=t*t-4*e*r;if(n<0)return[];var i=-t/(2*e);if(0===n)return[i];var s=Math.sqrt(n)/(2*e);return[i-s,i+s]}function polynomialCoefficients(e,t,r,n){return[3*t-e-3*r+n,3*e-6*t+3*r,-3*e+3*t,e]}function singlePoint(e){return new PolynomialBezier(e,e,e,e,!1)}function PolynomialBezier(e,t,r,n,i){i&&pointEqual(e,t)&&(t=lerpPoint(e,n,1/3)),i&&pointEqual(r,n)&&(r=lerpPoint(e,n,2/3));var s=polynomialCoefficients(e[0],t[0],r[0],n[0]),a=polynomialCoefficients(e[1],t[1],r[1],n[1]);this.a=[s[0],a[0]],this.b=[s[1],a[1]],this.c=[s[2],a[2]],this.d=[s[3],a[3]],this.points=[e,t,r,n]}function extrema(e,t){var r=e.points[0][t],n=e.points[e.points.length-1][t];if(r>n){var i=n;n=r,r=i}for(var s=quadRoots(3*e.a[t],2*e.b[t],e.c[t]),a=0;a<s.length;a+=1)if(s[a]>0&&s[a]<1){var o=e.point(s[a])[t];o<r?r=o:o>n&&(n=o)}return{min:r,max:n}}function intersectData(e,t,r){var n=e.boundingBox();return{cx:n.cx,cy:n.cy,width:n.width,height:n.height,bez:e,t:(t+r)/2,t1:t,t2:r}}function splitData(e){var t=e.bez.split(.5);return[intersectData(t[0],e.t1,e.t),intersectData(t[1],e.t,e.t2)]}function boxIntersect(e,t){return 2*Math.abs(e.cx-t.cx)<e.width+t.width&&2*Math.abs(e.cy-t.cy)<e.height+t.height}function intersectsImpl(e,t,r,n,i,s){if(boxIntersect(e,t))if(r>=s||e.width<=n&&e.height<=n&&t.width<=n&&t.height<=n)i.push([e.t,t.t]);else{var a=splitData(e),o=splitData(t);intersectsImpl(a[0],o[0],r+1,n,i,s),intersectsImpl(a[0],o[1],r+1,n,i,s),intersectsImpl(a[1],o[0],r+1,n,i,s),intersectsImpl(a[1],o[1],r+1,n,i,s)}}function crossProduct(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function lineIntersection(e,t,r,n){var i=[e[0],e[1],1],s=[t[0],t[1],1],a=[r[0],r[1],1],o=[n[0],n[1],1],l=crossProduct(crossProduct(i,s),crossProduct(a,o));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(e,t,r){return[e[0]+Math.cos(t)*r,e[1]-Math.sin(t)*r]}function pointDistance(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function pointEqual(e,t){return floatEqual(e[0],t[0])&&floatEqual(e[1],t[1])}function ZigZagModifier(){}function setPoint(e,t,r,n,i,s,a){var o=r-Math.PI/2,l=r+Math.PI/2,c=t[0]+Math.cos(r)*n*i,h=t[1]-Math.sin(r)*n*i;e.setTripleAt(c,h,c+Math.cos(o)*s,h-Math.sin(o)*s,c+Math.cos(l)*a,h-Math.sin(l)*a,e.length())}function getPerpendicularVector(e,t){var r=[t[0]-e[0],t[1]-e[1]],n=.5*-Math.PI;return[Math.cos(n)*r[0]-Math.sin(n)*r[1],Math.sin(n)*r[0]+Math.cos(n)*r[1]]}function getProjectingAngle(e,t){var r=0===t?e.length()-1:t-1,n=(t+1)%e.length(),i=getPerpendicularVector(e.v[r],e.v[n]);return Math.atan2(0,1)-Math.atan2(i[1],i[0])}function zigZagCorner(e,t,r,n,i,s,a){var o=getProjectingAngle(t,r),l=t.v[r%t._length],c=t.v[0===r?t._length-1:r-1],h=t.v[(r+1)%t._length],d=2===s?Math.sqrt(Math.pow(l[0]-c[0],2)+Math.pow(l[1]-c[1],2)):0,u=2===s?Math.sqrt(Math.pow(l[0]-h[0],2)+Math.pow(l[1]-h[1],2)):0;setPoint(e,t.v[r%t._length],o,a,n,u/(2*(i+1)),d/(2*(i+1)))}function zigZagSegment(e,t,r,n,i,s){for(var a=0;a<n;a+=1){var o=(a+1)/(n+1),l=2===i?Math.sqrt(Math.pow(t.points[3][0]-t.points[0][0],2)+Math.pow(t.points[3][1]-t.points[0][1],2)):0,c=t.normalAngle(o);setPoint(e,t.point(o),c,s,r,l/(2*(n+1)),l/(2*(n+1))),s=-s}return s}function linearOffset(e,t,r){var n=Math.atan2(t[0]-e[0],t[1]-e[1]);return[polarOffset(e,n,r),polarOffset(t,n,r)]}function offsetSegment(e,t){var r,n,i,s,a,o,l;r=(l=linearOffset(e.points[0],e.points[1],t))[0],n=l[1],i=(l=linearOffset(e.points[1],e.points[2],t))[0],s=l[1],a=(l=linearOffset(e.points[2],e.points[3],t))[0],o=l[1];var c=lineIntersection(r,n,i,s);null===c&&(c=n);var h=lineIntersection(a,o,i,s);return null===h&&(h=a),new PolynomialBezier(r,c,h,o)}function joinLines(e,t,r,n,i){var s=t.points[3],a=r.points[0];if(3===n)return s;if(pointEqual(s,a))return s;if(2===n){var o=-t.tangentAngle(1),l=-r.tangentAngle(0)+Math.PI,c=lineIntersection(s,polarOffset(s,o+Math.PI/2,100),a,polarOffset(a,o+Math.PI/2,100)),h=c?pointDistance(c,s):pointDistance(s,a)/2,d=polarOffset(s,o,2*h*roundCorner);return e.setXYAt(d[0],d[1],"o",e.length()-1),d=polarOffset(a,l,2*h*roundCorner),e.setTripleAt(a[0],a[1],a[0],a[1],d[0],d[1],e.length()),a}var u=lineIntersection(pointEqual(s,t.points[2])?t.points[0]:t.points[2],s,a,pointEqual(a,r.points[1])?r.points[3]:r.points[1]);return u&&pointDistance(u,s)<i?(e.setTripleAt(u[0],u[1],u[0],u[1],u[0],u[1],e.length()),u):s}function getIntersection(e,t){var r=e.intersections(t);return r.length&&floatEqual(r[0][0],1)&&r.shift(),r.length?r[0]:null}function pruneSegmentIntersection(e,t){var r=e.slice(),n=t.slice(),i=getIntersection(e[e.length-1],t[0]);return i&&(r[e.length-1]=e[e.length-1].split(i[0])[0],n[0]=t[0].split(i[1])[1]),e.length>1&&t.length>1&&(i=getIntersection(e[0],t[t.length-1]))?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[r,n]}function pruneIntersections(e){for(var t,r=1;r<e.length;r+=1)t=pruneSegmentIntersection(e[r-1],e[r]),e[r-1]=t[0],e[r]=t[1];return e.length>1&&(t=pruneSegmentIntersection(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function offsetSegmentSplit(e,t){var r,n,i,s,a=e.inflectionPoints();if(0===a.length)return[offsetSegment(e,t)];if(1===a.length||floatEqual(a[1],1))return r=(i=e.split(a[0]))[0],n=i[1],[offsetSegment(r,t),offsetSegment(n,t)];r=(i=e.split(a[0]))[0];var o=(a[1]-a[0])/(1-a[0]);return s=(i=i[1].split(o))[0],n=i[1],[offsetSegment(r,t),offsetSegment(s,t),offsetSegment(n,t)]}function OffsetPathModifier(){}function getFontProperties(e){for(var t=e.fStyle?e.fStyle.split(" "):[],r="normal",n="normal",i=t.length,s=0;s<i;s+=1)switch(t[s].toLowerCase()){case"italic":n="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:n,weight:e.fWeight||r}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(e,t.c,0,null,this),this.o=PropertyFactory.getProp(e,t.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(e,t.tr,this),this.so=PropertyFactory.getProp(e,t.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(e,t.tr.eo,0,.01,this),this.data=t,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(e,t,r,n,i,s){var a=s?-1:1,o=n.s.v[0]+(1-n.s.v[0])*(1-i),l=n.s.v[1]+(1-n.s.v[1])*(1-i);e.translate(n.p.v[0]*a*i,n.p.v[1]*a*i,n.p.v[2]),t.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),t.rotate(-n.r.v*a*i),t.translate(n.a.v[0],n.a.v[1],n.a.v[2]),r.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),r.scale(s?1/o:o,s?1/l:l),r.translate(n.a.v[0],n.a.v[1],n.a.v[2])},RepeaterModifier.prototype.init=function(e,t,r,n){for(this.elem=e,this.arr=t,this.pos=r,this.elemsData=n,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t[r]);r>0;)r-=1,this._elements.unshift(t[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t]._processed=!1,"gr"===e[t].ty&&this.resetElements(e[t].it)},RepeaterModifier.prototype.cloneElements=function(e){var t=JSON.parse(JSON.stringify(e));return this.resetElements(t),t},RepeaterModifier.prototype.changeGroupRender=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)e[r]._render=t,"gr"===e[r].ty&&this.changeGroupRender(e[r].it,t)},RepeaterModifier.prototype.processShapes=function(e){var t,r,n,i,s,a=!1;if(this._mdf||e){var o,l=Math.ceil(this.c.v);if(this._groups.length<l){for(;this._groups.length<l;){var c={it:this.cloneElements(this._elements),ty:"gr"};c.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,c),this._groups.splice(0,0,c),this._currentCopies+=1}this.elem.reloadShapes(),a=!0}for(s=0,n=0;n<=this._groups.length-1;n+=1){if(o=s<l,this._groups[n]._render=o,this.changeGroupRender(this._groups[n].it,o),!o){var h=this.elemsData[n].it,d=h[h.length-1];0!==d.transform.op.v?(d.transform.op._mdf=!0,d.transform.op.v=0):d.transform.op._mdf=!1}s+=1}this._currentCopies=l;var u=this.o.v,p=u%1,f=u>0?Math.floor(u):Math.ceil(u),m=this.pMatrix.props,g=this.rMatrix.props,y=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,S=0;if(u>0){for(;S<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),S+=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,p,!1),S+=p)}else if(u<0){for(;S>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),S-=1;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),S-=p)}for(n=1===this.data.m?0:this._currentCopies-1,i=1===this.data.m?1:-1,s=this._currentCopies;s;){if(b=(r=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(n/(this._currentCopies-1)),0!==S){for((0!==n&&1===i||n!==this._currentCopies-1&&-1===i)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),v=0;v<b;v+=1)r[v]=this.matrix.props[v];this.matrix.reset()}else for(this.matrix.reset(),v=0;v<b;v+=1)r[v]=this.matrix.props[v];S+=1,s-=1,n+=i}}else for(s=this._currentCopies,n=0,i=1;s;)r=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props,t[t.length-1].transform.mProps._mdf=!1,t[t.length-1].transform.op._mdf=!1,s-=1,n+=i;return a},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(e,t.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(e,t){var r,n=shapePool.newElement();n.c=e.c;var i,s,a,o,l,c,h,d,u,p,f,m,g=e._length,y=0;for(r=0;r<g;r+=1)i=e.v[r],a=e.o[r],s=e.i[r],i[0]===a[0]&&i[1]===a[1]&&i[0]===s[0]&&i[1]===s[1]?0!==r&&r!==g-1||e.c?(o=0===r?e.v[g-1]:e.v[r-1],c=(l=Math.sqrt(Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)))?Math.min(l/2,t)/l:0,h=f=i[0]+(o[0]-i[0])*c,d=m=i[1]-(i[1]-o[1])*c,u=h-(h-i[0])*roundCorner,p=d-(d-i[1])*roundCorner,n.setTripleAt(h,d,u,p,f,m,y),y+=1,o=r===g-1?e.v[0]:e.v[r+1],c=(l=Math.sqrt(Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2)))?Math.min(l/2,t)/l:0,h=u=i[0]+(o[0]-i[0])*c,d=p=i[1]+(o[1]-i[1])*c,f=h-(h-i[0])*roundCorner,m=d-(d-i[1])*roundCorner,n.setTripleAt(h,d,u,p,f,m,y),y+=1):(n.setTripleAt(i[0],i[1],a[0],a[1],s[0],s[1],y),y+=1):(n.setTripleAt(e.v[r][0],e.v[r][1],e.o[r][0],e.o[r][1],e.i[r][0],e.i[r][1],y),y+=1);return n},RoundCornersModifier.prototype.processShapes=function(e){var t,r,n,i,s,a,o=this.shapes.length,l=this.rd.v;if(0!==l)for(r=0;r<o;r+=1){if(a=(s=this.shapes[r]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,n=0;n<i;n+=1)a.addShape(this.processPath(t[n],l));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},PolynomialBezier.prototype.point=function(e){return[((this.a[0]*e+this.b[0])*e+this.c[0])*e+this.d[0],((this.a[1]*e+this.b[1])*e+this.c[1])*e+this.d[1]]},PolynomialBezier.prototype.derivative=function(e){return[(3*e*this.a[0]+2*this.b[0])*e+this.c[0],(3*e*this.a[1]+2*this.b[1])*e+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(e){var t=this.derivative(e);return Math.atan2(t[1],t[0])},PolynomialBezier.prototype.normalAngle=function(e){var t=this.derivative(e);return Math.atan2(t[0],t[1])},PolynomialBezier.prototype.inflectionPoints=function(){var e=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(e))return[];var t=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/e,r=t*t-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/e;if(r<0)return[];var n=Math.sqrt(r);return floatZero(n)?n>0&&n<1?[t]:[]:[t-n,t+n].filter((function(e){return e>0&&e<1}))},PolynomialBezier.prototype.split=function(e){if(e<=0)return[singlePoint(this.points[0]),this];if(e>=1)return[this,singlePoint(this.points[this.points.length-1])];var t=lerpPoint(this.points[0],this.points[1],e),r=lerpPoint(this.points[1],this.points[2],e),n=lerpPoint(this.points[2],this.points[3],e),i=lerpPoint(t,r,e),s=lerpPoint(r,n,e),a=lerpPoint(i,s,e);return[new PolynomialBezier(this.points[0],t,i,a,!0),new PolynomialBezier(a,s,n,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}},PolynomialBezier.prototype.intersections=function(e,t,r){void 0===t&&(t=2),void 0===r&&(r=7);var n=[];return intersectsImpl(intersectData(this,0,1),intersectData(e,0,1),0,t,n,r),n},PolynomialBezier.shapeSegment=function(e,t){var r=(t+1)%e.length();return new PolynomialBezier(e.v[t],e.o[t],e.i[r],e.v[r],!0)},PolynomialBezier.shapeSegmentInverted=function(e,t){var r=(t+1)%e.length();return new PolynomialBezier(e.v[r],e.i[r],e.o[t],e.v[t],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(e,t.s,0,null,this),this.frequency=PropertyFactory.getProp(e,t.r,0,null,this),this.pointsType=PropertyFactory.getProp(e,t.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(e,t,r,n){var i=e._length,s=shapePool.newElement();if(s.c=e.c,e.c||(i-=1),0===i)return s;var a=-1,o=PolynomialBezier.shapeSegment(e,0);zigZagCorner(s,e,0,t,r,n,a);for(var l=0;l<i;l+=1)a=zigZagSegment(s,o,t,r,n,-a),o=l!==i-1||e.c?PolynomialBezier.shapeSegment(e,(l+1)%i):null,zigZagCorner(s,e,l+1,t,r,n,a);return s},ZigZagModifier.prototype.processShapes=function(e){var t,r,n,i,s,a,o=this.shapes.length,l=this.amplitude.v,c=Math.max(0,Math.round(this.frequency.v)),h=this.pointsType.v;if(0!==l)for(r=0;r<o;r+=1){if(a=(s=this.shapes[r]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,n=0;n<i;n+=1)a.addShape(this.processPath(t[n],l,c,h));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this.miterLimit=PropertyFactory.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=0!==this.amount.effectsSequence.length},OffsetPathModifier.prototype.processPath=function(e,t,r,n){var i=shapePool.newElement();i.c=e.c;var s,a,o,l=e.length();e.c||(l-=1);var c=[];for(s=0;s<l;s+=1)o=PolynomialBezier.shapeSegment(e,s),c.push(offsetSegmentSplit(o,t));if(!e.c)for(s=l-1;s>=0;s-=1)o=PolynomialBezier.shapeSegmentInverted(e,s),c.push(offsetSegmentSplit(o,t));c=pruneIntersections(c);var h=null,d=null;for(s=0;s<c.length;s+=1){var u=c[s];for(d&&(h=joinLines(i,d,u[0],r,n)),d=u[u.length-1],a=0;a<u.length;a+=1)o=u[a],h&&pointEqual(o.points[0],h)?i.setXYAt(o.points[1][0],o.points[1][1],"o",i.length()-1):i.setTripleAt(o.points[0][0],o.points[0][1],o.points[1][0],o.points[1][1],o.points[0][0],o.points[0][1],i.length()),i.setTripleAt(o.points[3][0],o.points[3][1],o.points[3][0],o.points[3][1],o.points[2][0],o.points[2][1],i.length()),h=o.points[3]}return c.length&&joinLines(i,d,c[0][0],r,n),i},OffsetPathModifier.prototype.processShapes=function(e){var t,r,n,i,s,a,o=this.shapes.length,l=this.amount.v,c=this.miterLimit.v,h=this.lineJoin;if(0!==l)for(r=0;r<o;r+=1){if(a=(s=this.shapes[r]).localShapeCollection,s.shape._mdf||this._mdf||e)for(a.releaseShapes(),s.shape._mdf=!0,t=s.shape.paths.shapes,i=s.shape.paths._length,n=0;n<i;n+=1)a.addShape(this.processPath(t[n],l,h,c));s.shape.paths=s.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var FontManager=function(){var e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var r=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"],n=[65039,8205];function i(e,t){var r=createTag("span");r.setAttribute("aria-hidden",!0),r.style.fontFamily=t;var n=createTag("span");n.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(n),document.body.appendChild(r);var i=n.offsetWidth;return n.style.fontFamily=function(e){var t,r=e.split(","),n=r.length,i=[];for(t=0;t<n;t+=1)"sans-serif"!==r[t]&&"monospace"!==r[t]&&i.push(r[t]);return i.join(",")}(e)+", "+t,{node:n,w:i,parent:r}}function s(e,t){var r,n=document.body&&t?"svg":"canvas",i=getFontProperties(e);if("svg"===n){var s=createNS("text");s.style.fontSize="100px",s.setAttribute("font-family",e.fFamily),s.setAttribute("font-style",i.style),s.setAttribute("font-weight",i.weight),s.textContent="1",e.fClass?(s.style.fontFamily="inherit",s.setAttribute("class",e.fClass)):s.style.fontFamily=e.fFamily,t.appendChild(s),r=s}else{var a=new OffscreenCanvas(500,500).getContext("2d");a.font=i.style+" "+i.weight+" 100px "+e.fFamily,r=a}return{measureText:function(e){return"svg"===n?(r.textContent=e,r.getComputedTextLength()):r.measureText(e).width}}}var a=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};a.isModifier=function(e,t){var n=e.toString(16)+t.toString(16);return-1!==r.indexOf(n)},a.isZeroWidthJoiner=function(e,t){return t?e===n[0]&&t===n[1]:e===n[1]},a.isCombinedCharacter=function(e){return-1!==t.indexOf(e)};var o={addChars:function(e){if(e){var t;this.chars||(this.chars=[]);var r,n,i=e.length,s=this.chars.length;for(t=0;t<i;t+=1){for(r=0,n=!1;r<s;)this.chars[r].style===e[t].style&&this.chars[r].fFamily===e[t].fFamily&&this.chars[r].ch===e[t].ch&&(n=!0),r+=1;n||(this.chars.push(e[t]),s+=1)}}},addFonts:function(e,t){if(e){if(this.chars)return this.isLoaded=!0,void(this.fonts=e.list);if(!document.body)return this.isLoaded=!0,e.list.forEach((function(e){e.helper=s(e),e.cache={}})),void(this.fonts=e.list);var r,n=e.list,a=n.length,o=a;for(r=0;r<a;r+=1){var l,c,h=!0;if(n[r].loaded=!1,n[r].monoCase=i(n[r].fFamily,"monospace"),n[r].sansCase=i(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){if((l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[r].fFamily+'"], style[f-origin="3"][f-family="'+n[r].fFamily+'"]')).length>0&&(h=!1),h){var d=createTag("style");d.setAttribute("f-forigin",n[r].fOrigin),d.setAttribute("f-origin",n[r].origin),d.setAttribute("f-family",n[r].fFamily),d.type="text/css",d.innerText="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",t.appendChild(d)}}else if("g"===n[r].fOrigin||1===n[r].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),c=0;c<l.length;c+=1)-1!==l[c].href.indexOf(n[r].fPath)&&(h=!1);if(h){var u=createTag("link");u.setAttribute("f-forigin",n[r].fOrigin),u.setAttribute("f-origin",n[r].origin),u.type="text/css",u.rel="stylesheet",u.href=n[r].fPath,document.body.appendChild(u)}}else if("t"===n[r].fOrigin||2===n[r].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),c=0;c<l.length;c+=1)n[r].fPath===l[c].src&&(h=!1);if(h){var p=createTag("link");p.setAttribute("f-forigin",n[r].fOrigin),p.setAttribute("f-origin",n[r].origin),p.setAttribute("rel","stylesheet"),p.setAttribute("href",n[r].fPath),t.appendChild(p)}}}else n[r].loaded=!0,o-=1;n[r].helper=s(n[r],t),n[r].cache={},this.fonts.push(n[r])}0===o?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,r,n){for(var i=0,s=this.chars.length;i<s;){if(this.chars[i].ch===t&&this.chars[i].style===r&&this.chars[i].fFamily===n)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,r,n)),e},getFontByName:function(e){for(var t=0,r=this.fonts.length;t<r;){if(this.fonts[t].fName===e)return this.fonts[t];t+=1}return this.fonts[0]},measureText:function(e,t,r){var n=this.getFontByName(t),i=e.charCodeAt(0);if(!n.cache[i+1]){var s=n.helper;if(" "===e){var a=s.measureText("|"+e+"|"),o=s.measureText("||");n.cache[i+1]=(a-o)/100}else n.cache[i+1]=s.measureText(e)/100}return n.cache[i+1]*r},checkLoadedFonts:function(){var e,t,r,n=this.fonts.length,i=n;for(e=0;e<n;e+=1)this.fonts[e].loaded?i-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(t=this.fonts[e].monoCase.node,r=this.fonts[e].monoCase.w,t.offsetWidth!==r?(i-=1,this.fonts[e].loaded=!0):(t=this.fonts[e].sansCase.node,r=this.fonts[e].sansCase.w,t.offsetWidth!==r&&(i-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==i&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}};return a.prototype=o,a}();function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){-1===this.renderableComponents.indexOf(e)&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){-1!==this.renderableComponents.indexOf(e)&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(e){return blendModeEnums[e]||""}),blendModeEnums;function SliderEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function AngleEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function ColorEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,1,0,r)}function PointEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,1,0,r)}function LayerIndexEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function MaskIndexEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function CheckboxEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(e,t){var r,n=e.ef||[];this.effectElements=[];var i,s=n.length;for(r=0;r<s;r+=1)i=new GroupEffect(n[r],t),this.effectElements.push(i)}function GroupEffect(e,t){this.init(e,t)}function BaseElement(){}function FrameElement(){}function FootageElement(e,t,r){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.footageData=t.imageLoader.getAsset(this.assetData),this.initBaseData(e,t,r)}function AudioElement(e,t,r){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.initBaseData(e,t,r),this._isPlaying=!1,this._canPlay=!1;var n=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(n),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,e.au&&e.au.lv?e.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}function TransformElement(){}function MaskElement(e,t,r){this.data=e,this.element=t,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var n,i,s=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(a),this.solidPath="";var o,l,c,h,d,u,p=this.masksProperties,f=0,m=[],g=createElementID(),y="clipPath",v="clip-path";for(n=0;n<a;n+=1)if(("a"!==p[n].mode&&"n"!==p[n].mode||p[n].inv||100!==p[n].o.k||p[n].o.x)&&(y="mask",v="mask"),"s"!==p[n].mode&&"i"!==p[n].mode||0!==f?c=null:((c=createNS("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),m.push(c)),i=createNS("path"),"n"===p[n].mode)this.viewData[n]={op:PropertyFactory.getProp(this.element,p[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[n],3),elem:i,lastPath:""},s.appendChild(i);else{var b;if(f+=1,i.setAttribute("fill","s"===p[n].mode?"#000000":"#ffffff"),i.setAttribute("clip-rule","nonzero"),0!==p[n].x.k?(y="mask",v="mask",u=PropertyFactory.getProp(this.element,p[n].x,0,null,this.element),b=createElementID(),(h=createNS("filter")).setAttribute("id",b),(d=createNS("feMorphology")).setAttribute("operator","erode"),d.setAttribute("in","SourceGraphic"),d.setAttribute("radius","0"),h.appendChild(d),s.appendChild(h),i.setAttribute("stroke","s"===p[n].mode?"#000000":"#ffffff")):(d=null,u=null),this.storedData[n]={elem:i,x:u,expan:d,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===p[n].mode){l=m.length;var S=createNS("g");for(o=0;o<l;o+=1)S.appendChild(m[o]);var E=createNS("mask");E.setAttribute("mask-type","alpha"),E.setAttribute("id",g+"_"+f),E.appendChild(i),s.appendChild(E),S.setAttribute("mask","url("+getLocationHref()+"#"+g+"_"+f+")"),m.length=0,m.push(S)}else m.push(i);p[n].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[n]={elem:i,lastPath:"",op:PropertyFactory.getProp(this.element,p[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,p[n],3),invRect:c},this.viewData[n].prop.k||this.drawPath(p[n],this.viewData[n].prop.v,this.viewData[n])}for(this.maskElement=createNS(y),a=m.length,n=0;n<a;n+=1)this.maskElement.appendChild(m[n]);f>0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(v,"url("+getLocationHref()+"#"+g+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(e,t){var r;this.data=e,this.effectElements=[],this.initDynamicPropertyContainer(t);var n,i=this.data.ef.length,s=this.data.ef;for(r=0;r<i;r+=1){switch(n=null,s[r].ty){case 0:n=new SliderEffect(s[r],t,this);break;case 1:n=new AngleEffect(s[r],t,this);break;case 2:n=new ColorEffect(s[r],t,this);break;case 3:n=new PointEffect(s[r],t,this);break;case 4:case 7:n=new CheckboxEffect(s[r],t,this);break;case 10:n=new LayerIndexEffect(s[r],t,this);break;case 11:n=new MaskIndexEffect(s[r],t,this);break;case 5:n=new EffectsManager(s[r],t);break;default:n=new NoValueEffect(s[r])}n&&this.effectElements.push(n)}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if("n"!==this.data.masksProperties[e].mode&&!1!==this.data.masksProperties[e].cl)return!0;e+=1}return!1},initExpressions:function(){var e=getExpressionInterfaces();if(e){var t=e("layer"),r=e("effects"),n=e("shape"),i=e("text"),s=e("comp");this.layerInterface=t(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var a=r.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(a),0===this.data.ty||this.data.xt?this.compInterface=s(this):4===this.data.ty?(this.layerInterface.shapeInterface=n(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=i(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var e=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=e},initBaseData:function(e,t,r){this.globalData=t,this.comp=r,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var r,n=this.dynamicProperties.length;for(r=0;r<n;r+=1)(t||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&this.dynamicProperties.push(e)}},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var e=getExpressionInterfaces();if(e){var t=e("footage");this.layerInterface=t(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(e){if(this.prepareRenderableFrame(e,!0),this.prepareProperties(e,!0),this.tm._placeholder)this._currentTime=e/this.data.sr;else{var t=this.tm.v;this._currentTime=t}this._volume=this.lv.v[0];var r=this._volume*this._volumeMultiplier;this._previousVolume!==r&&(this._previousVolume=r,this.audio.volume(r))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(e){var t,r,n=this.layers.length;for(this.completeLayers=!0,t=n-1;t>=0;t-=1)this.elements[t]||(r=this.layers[t]).ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:default:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.buildItem(e);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(e){var t;this.completeLayers=!1;var r,n=e.length,i=this.layers.length;for(t=0;t<n;t+=1)for(r=0;r<i;){if(this.layers[r].id===e[t].id){this.layers[r]=e[t];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(e){this.globalData.projectInterface=e},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(e,t,r){for(var n=this.elements,i=this.layers,s=0,a=i.length;s<a;)i[s].ind==t&&(n[s]&&!0!==n[s]?(r.push(n[s]),n[s].setAsParent(),void 0!==i[s].parent?this.buildElementParenting(e,i[s].parent,r):e.setHierarchy(r)):(this.buildItem(s),this.addPendingElement(e))),s+=1},BaseRenderer.prototype.addPendingElement=function(e){this.pendingElements.push(e)},BaseRenderer.prototype.searchExtraCompositions=function(e){var t,r=e.length;for(t=0;t<r;t+=1)if(e[t].xt){var n=this.createComp(e[t]);n.initExpressions(),this.globalData.projectInterface.registerComposition(n)}},BaseRenderer.prototype.getElementById=function(e){var t,r=this.elements.length;for(t=0;t<r;t+=1)if(this.elements[t].data.ind===e)return this.elements[t];return null},BaseRenderer.prototype.getElementByPath=function(e){var t,r=e.shift();if("number"==typeof r)t=this.elements[r];else{var n,i=this.elements.length;for(n=0;n<i;n+=1)if(this.elements[n].data.nm===r){t=this.elements[n];break}}return 0===e.length?t:t.getElementByPath(e)},BaseRenderer.prototype.setupGlobalData=function(e,t){this.globalData.fontManager=new FontManager,this.globalData.fontManager.addChars(e.chars),this.globalData.fontManager.addFonts(e.fonts,t),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=e.fr,this.globalData.nm=e.nm,this.globalData.compSize={w:e.w,h:e.h}},TransformElement.prototype={initTransform:function(){this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_opMdf:!1,mat:new Matrix},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,r=0,n=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<n;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),r=0;r<n;r+=1)e=this.hierarchy[r].finalTransform.mProp.v.props,t.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var r,n=!0,i=this.comp;n;)i.finalTransform?(i.data.hasMask&&t.splice(0,0,i.finalTransform),i=i.comp):n=!1;var s,a=t.length;for(r=0;r<a;r+=1)s=t[r].mat.applyToPointArray(0,0,0),e=[e[0]-s[0],e[1]-s[1],0];return e},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(e){return this.viewData[e].prop},MaskElement.prototype.renderFrame=function(e){var t,r=this.element.finalTransform.mat,n=this.masksProperties.length;for(t=0;t<n;t+=1)if((this.viewData[t].prop._mdf||e)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||e)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),"n"!==this.masksProperties[t].mode&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||e)&&this.viewData[t].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||e))){var i=this.storedData[t].expan;this.storedData[t].x.v<0?("erode"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),i.setAttribute("radius",-this.storedData[t].x.v)):("dilate"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",2*this.storedData[t].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var e="M0,0 ";return e+=" h"+this.globalData.compSize.w,e+=" v"+this.globalData.compSize.h,e+=" h-"+this.globalData.compSize.w,e+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(e,t,r){var n,i,s=" M"+t.v[0][0]+","+t.v[0][1];for(i=t._length,n=1;n<i;n+=1)s+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[n][0]+","+t.i[n][1]+" "+t.v[n][0]+","+t.v[n][1];if(t.c&&i>1&&(s+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),r.lastPath!==s){var a="";r.elem&&(t.c&&(a=e.inv?this.solidPath+s:s),r.elem.setAttribute("d",a)),r.lastPath=s}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var e={createFilter:function(e,t){var r=createNS("filter");return r.setAttribute("id",e),!0!==t&&(r.setAttribute("filterUnits","objectBoundingBox"),r.setAttribute("x","0%"),r.setAttribute("y","0%"),r.setAttribute("width","100%"),r.setAttribute("height","100%")),r},createAlphaToLuminanceFilter:function(){var e=createNS("feColorMatrix");return e.setAttribute("type","matrix"),e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),e}};return e}(),featureSupport=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),registeredEffects={},idPrefix="filter_result_";function SVGEffects(e){var t,r,n="SourceGraphic",i=e.data.ef?e.data.ef.length:0,s=createElementID(),a=filtersFactory.createFilter(s,!0),o=0;for(this.filters=[],t=0;t<i;t+=1){r=null;var l=e.data.ef[t].ty;registeredEffects[l]&&(r=new(0,registeredEffects[l].effect)(a,e.effectsManager.effectElements[t],e,idPrefix+o,n),n=idPrefix+o,registeredEffects[l].countsAsEffect&&(o+=1)),r&&this.filters.push(r)}o&&(e.globalData.defs.appendChild(a),e.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+s+")")),this.filters.length&&e.addRenderableComponent(this)}function registerEffect(e,t,r){registeredEffects[e]={effect:t,countsAsEffect:r}}function SVGBaseElement(){}function HierarchyElement(){}function RenderableDOMElement(){}function IImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(e,t){this.elem=e,this.pos=t}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(e){var t,r=this.filters.length;for(t=0;t<r;t+=1)this.filters[t].renderFrame(e)},SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e=null;if(this.data.td){this.matteMasks={};var t=createNS("g");t.setAttribute("id",this.layerId),t.appendChild(this.layerElement),e=t,this.globalData.defs.appendChild(t)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),e=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var r=createNS("clipPath"),n=createNS("path");n.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var i=createElementID();if(r.setAttribute("id",i),r.appendChild(n),this.globalData.defs.appendChild(r),this.checkMasks()){var s=createNS("g");s.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),s.appendChild(this.layerElement),this.transformedElement=s,e?e.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._matMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.mat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.mProp.o.v)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this)},getMatte:function(e){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[e]){var t,r,n,i,s=this.layerId+"_"+e;if(1===e||3===e){var a=createNS("mask");a.setAttribute("id",s),a.setAttribute("mask-type",3===e?"luminance":"alpha"),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),a.appendChild(n),this.globalData.defs.appendChild(a),featureSupport.maskType||1!==e||(a.setAttribute("mask-type","luminance"),t=createElementID(),r=filtersFactory.createFilter(t),this.globalData.defs.appendChild(r),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(i=createNS("g")).appendChild(n),a.appendChild(i),i.setAttribute("filter","url("+getLocationHref()+"#"+t+")"))}else if(2===e){var o=createNS("mask");o.setAttribute("id",s),o.setAttribute("mask-type","alpha");var l=createNS("g");o.appendChild(l),t=createElementID(),r=filtersFactory.createFilter(t);var c=createNS("feComponentTransfer");c.setAttribute("in","SourceGraphic"),r.appendChild(c);var h=createNS("feFuncA");h.setAttribute("type","table"),h.setAttribute("tableValues","1.0 0.0"),c.appendChild(h),this.globalData.defs.appendChild(r);var d=createNS("rect");d.setAttribute("width",this.comp.data.w),d.setAttribute("height",this.comp.data.h),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("fill","#ffffff"),d.setAttribute("opacity","0"),l.setAttribute("filter","url("+getLocationHref()+"#"+t+")"),l.appendChild(d),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(n),featureSupport.maskType||(o.setAttribute("mask-type","luminance"),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),l.appendChild(d),i.appendChild(this.layerElement),l.appendChild(i)),this.globalData.defs.appendChild(o)}this.matteMasks[e]=s}return this.matteMasks[e]},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initTransform(e,t,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function(e){var t,r=this.shapeModifiers.length;for(t=0;t<r;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=this.shapeModifiers.length;0<t;)if(this.shapeModifiers[0].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();for(e=(t=this.shapeModifiers.length)-1;e>=0&&!this.shapeModifiers[e].processShapes(this._isFirstFrame);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,r=0,n=t.length;r<n;){if(t[r].elem===e)return t[r].pos;r+=1}return 0},addProcessedElement:function(e,t){for(var r=this.processedElements,n=r.length;n;)if(r[n-=1].elem===e)return void(r[n].pos=t);r.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(e,t,r){this.caches=[],this.styles=[],this.transformers=e,this.lStr="",this.sh=r,this.lvl=t,this._isAnimated=!!r.k;for(var n=0,i=e.length;n<i;){if(e[n].mProps.dynamicProperties.length){this._isAnimated=!0;break}n+=1}}function SVGStyleData(e,t){this.data=e,this.type=e.ty,this.d="",this.lvl=t,this._mdf=!1,this.closed=!0===e.hd,this.pElem=createNS("path"),this.msElem=null}function DashProperty(e,t,r,n){var i;this.elem=e,this.frameId=-1,this.dataProps=createSizedArray(t.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",t.length?t.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(n);var s,a=t.length||0;for(i=0;i<a;i+=1)s=PropertyFactory.getProp(e,t[i].v,0,0,this),this.k=s.k||this.k,this.dataProps[i]={n:t[i].n,p:s};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=r}function SVGNoStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.style=r}function GradientProperty(e,t,r){this.data=t,this.c=createTypedArray("uint8c",4*t.p);var n=t.k.k[0].s?t.k.k[0].s.length-4*t.p:t.k.k.length-4*t.p;this.o=createTypedArray("float32",n),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=n,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(e,t.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.initGradientData(e,t,r)}function SVGGradientStrokeStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.initGradientData(e,t,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(e,t,r){this.transform={mProps:e,op:t,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(e){if((this.elem.globalData.frameId!==this.frameId||e)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||e,this._mdf)){var t=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),t=0;t<r;t+=1)"o"!==this.dataProps[t].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[t].p.v:this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(e,t){for(var r=0,n=this.o.length/2;r<n;){if(Math.abs(e[4*r]-e[4*t+2*r])>.01)return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e<t;){if(!this.comparePoints(this.data.k.k[e].s,this.data.p))return!1;e+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(e){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||e){var t,r,n,i=4*this.data.p;for(t=0;t<i;t+=1)r=t%4==0?100:255,n=Math.round(this.prop.v[t]*r),this.c[t]!==n&&(this.c[t]=n,this._cmdf=!e);if(this.o.length)for(i=this.prop.v.length,t=4*this.data.p;t<i;t+=1)r=t%2==0?100:1,n=t%2==0?Math.round(100*this.prop.v[t]):this.prop.v[t],this.o[t-4*this.data.p]!==n&&(this.o[t-4*this.data.p]=n,this._omdf=!e);this._mdf=!e}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(e,t,r){this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.s=PropertyFactory.getProp(e,t.s,1,null,this),this.e=PropertyFactory.getProp(e,t.e,1,null,this),this.h=PropertyFactory.getProp(e,t.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(e,t.a||{k:0},0,degToRads,this),this.g=new GradientProperty(e,t.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,t),this.setGradientOpacity(t,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(e,t){var r=createElementID(),n=createNS(1===t.t?"linearGradient":"radialGradient");n.setAttribute("id",r),n.setAttribute("spreadMethod","pad"),n.setAttribute("gradientUnits","userSpaceOnUse");var i,s,a,o=[];for(a=4*t.g.p,s=0;s<a;s+=4)i=createNS("stop"),n.appendChild(i),o.push(i);e.setAttribute("gf"===t.ty?"fill":"stroke","url("+getLocationHref()+"#"+r+")"),this.gf=n,this.cst=o},SVGGradientFillStyleData.prototype.setGradientOpacity=function(e,t){if(this.g._hasOpacity&&!this.g._collapsable){var r,n,i,s=createNS("mask"),a=createNS("path");s.appendChild(a);var o=createElementID(),l=createElementID();s.setAttribute("id",l);var c=createNS(1===e.t?"linearGradient":"radialGradient");c.setAttribute("id",o),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),i=e.g.k.k[0].s?e.g.k.k[0].s.length:e.g.k.k.length;var h=this.stops;for(n=4*e.g.p;n<i;n+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(r),h.push(r);a.setAttribute("gf"===e.ty?"fill":"stroke","url("+getLocationHref()+"#"+o+")"),"gs"===e.ty&&(a.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),a.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),1===e.lj&&a.setAttribute("stroke-miterlimit",e.ml)),this.of=c,this.ms=s,this.ost=h,this.maskId=l,t.msElem=a}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var buildShapeString=function(e,t,r,n){if(0===t)return"";var i,s=e.o,a=e.i,o=e.v,l=" M"+n.applyToPointStringified(o[0][0],o[0][1]);for(i=1;i<t;i+=1)l+=" C"+n.applyToPointStringified(s[i-1][0],s[i-1][1])+" "+n.applyToPointStringified(a[i][0],a[i][1])+" "+n.applyToPointStringified(o[i][0],o[i][1]);return r&&t&&(l+=" C"+n.applyToPointStringified(s[i-1][0],s[i-1][1])+" "+n.applyToPointStringified(a[0][0],a[0][1])+" "+n.applyToPointStringified(o[0][0],o[0][1]),l+="z"),l},SVGElementsRenderer=function(){var e=new Matrix,t=new Matrix,r={createRenderFunction:function(e){switch(e.ty){case"fl":return a;case"gf":return l;case"gs":return o;case"st":return c;case"sh":case"el":case"rc":case"sr":return s;case"tr":return n;case"no":return i;default:return null}}};function n(e,t,r){(r||t.transform.op._mdf)&&t.transform.container.setAttribute("opacity",t.transform.op.v),(r||t.transform.mProps._mdf)&&t.transform.container.setAttribute("transform",t.transform.mProps.v.to2dCSS())}function i(){}function s(r,n,i){var s,a,o,l,c,h,d,u,p,f,m,g=n.styles.length,y=n.lvl;for(h=0;h<g;h+=1){if(l=n.sh._mdf||i,n.styles[h].lvl<y){for(u=t.reset(),f=y-n.styles[h].lvl,m=n.transformers.length-1;!l&&f>0;)l=n.transformers[m].mProps._mdf||l,f-=1,m-=1;if(l)for(f=y-n.styles[h].lvl,m=n.transformers.length-1;f>0;)p=n.transformers[m].mProps.v.props,u.transform(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]),f-=1,m-=1}else u=e;if(a=(d=n.sh.paths)._length,l){for(o="",s=0;s<a;s+=1)(c=d.shapes[s])&&c._length&&(o+=buildShapeString(c,c._length,c.c,u));n.caches[h]=o}else o=n.caches[h];n.styles[h].d+=!0===r.hd?"":o,n.styles[h]._mdf=l||n.styles[h]._mdf}}function a(e,t,r){var n=t.style;(t.c._mdf||r)&&n.pElem.setAttribute("fill","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r)&&n.pElem.setAttribute("fill-opacity",t.o.v)}function o(e,t,r){l(e,t,r),c(0,t,r)}function l(e,t,r){var n,i,s,a,o,l=t.gf,c=t.g._hasOpacity,h=t.s.v,d=t.e.v;if(t.o._mdf||r){var u="gf"===e.ty?"fill-opacity":"stroke-opacity";t.style.pElem.setAttribute(u,t.o.v)}if(t.s._mdf||r){var p=1===e.t?"x1":"cx",f="x1"===p?"y1":"cy";l.setAttribute(p,h[0]),l.setAttribute(f,h[1]),c&&!t.g._collapsable&&(t.of.setAttribute(p,h[0]),t.of.setAttribute(f,h[1]))}if(t.g._cmdf||r){n=t.cst;var m=t.g.c;for(s=n.length,i=0;i<s;i+=1)(a=n[i]).setAttribute("offset",m[4*i]+"%"),a.setAttribute("stop-color","rgb("+m[4*i+1]+","+m[4*i+2]+","+m[4*i+3]+")")}if(c&&(t.g._omdf||r)){var g=t.g.o;for(s=(n=t.g._collapsable?t.cst:t.ost).length,i=0;i<s;i+=1)a=n[i],t.g._collapsable||a.setAttribute("offset",g[2*i]+"%"),a.setAttribute("stop-opacity",g[2*i+1])}if(1===e.t)(t.e._mdf||r)&&(l.setAttribute("x2",d[0]),l.setAttribute("y2",d[1]),c&&!t.g._collapsable&&(t.of.setAttribute("x2",d[0]),t.of.setAttribute("y2",d[1])));else if((t.s._mdf||t.e._mdf||r)&&(o=Math.sqrt(Math.pow(h[0]-d[0],2)+Math.pow(h[1]-d[1],2)),l.setAttribute("r",o),c&&!t.g._collapsable&&t.of.setAttribute("r",o)),t.e._mdf||t.h._mdf||t.a._mdf||r){o||(o=Math.sqrt(Math.pow(h[0]-d[0],2)+Math.pow(h[1]-d[1],2)));var y=Math.atan2(d[1]-h[1],d[0]-h[0]),v=t.h.v;v>=1?v=.99:v<=-1&&(v=-.99);var b=o*v,S=Math.cos(y+t.a.v)*b+h[0],E=Math.sin(y+t.a.v)*b+h[1];l.setAttribute("fx",S),l.setAttribute("fy",E),c&&!t.g._collapsable&&(t.of.setAttribute("fx",S),t.of.setAttribute("fy",E))}}function c(e,t,r){var n=t.style,i=t.d;i&&(i._mdf||r)&&i.dashStr&&(n.pElem.setAttribute("stroke-dasharray",i.dashStr),n.pElem.setAttribute("stroke-dashoffset",i.dashoffset[0])),t.c&&(t.c._mdf||r)&&n.pElem.setAttribute("stroke","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r)&&n.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||r)&&(n.pElem.setAttribute("stroke-width",t.w.v),n.msElem&&n.msElem.setAttribute("stroke-width",t.w.v))}return r}();function SVGShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,r),this.prevViewData=[]}function LetterProps(e,t,r,n,i,s){this.o=e,this.sw=t,this.sc=r,this.fc=n,this.m=i,this.p=s,this._mdf={o:!0,sw:!!t,sc:!!r,fc:!!n,m:!0,p:!0}}function TextProperty(e,t){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=t,this.elem=e,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t,r,n,i=this.shapes.length,s=this.stylesList.length,a=[],o=!1;for(r=0;r<s;r+=1){for(n=this.stylesList[r],o=!1,a.length=0,e=0;e<i;e+=1)-1!==(t=this.shapes[e]).styles.indexOf(n)&&(a.push(t),o=t._isAnimated||o);a.length>1&&o&&this.setShapesAsAnimated(a)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(e,t){var r,n=new SVGStyleData(e,t),i=n.pElem;return"st"===e.ty?r=new SVGStrokeStyleData(this,e,n):"fl"===e.ty?r=new SVGFillStyleData(this,e,n):"gf"===e.ty||"gs"===e.ty?(r=new("gf"===e.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,e,n),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),i.setAttribute("mask","url("+getLocationHref()+"#"+r.maskId+")"))):"no"===e.ty&&(r=new SVGNoStyleData(this,e,n)),"st"!==e.ty&&"gs"!==e.ty||(i.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),i.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),i.setAttribute("fill-opacity","0"),1===e.lj&&i.setAttribute("stroke-miterlimit",e.ml)),2===e.r&&i.setAttribute("fill-rule","evenodd"),e.ln&&i.setAttribute("id",e.ln),e.cl&&i.setAttribute("class",e.cl),e.bm&&(i.style["mix-blend-mode"]=getBlendMode(e.bm)),this.stylesList.push(n),this.addToAnimatedContents(e,r),r},SVGShapeElement.prototype.createGroupElement=function(e){var t=new ShapeGroupData;return e.ln&&t.gr.setAttribute("id",e.ln),e.cl&&t.gr.setAttribute("class",e.cl),e.bm&&(t.gr.style["mix-blend-mode"]=getBlendMode(e.bm)),t},SVGShapeElement.prototype.createTransformElement=function(e,t){var r=TransformPropertyFactory.getTransformProperty(this,e,this),n=new SVGTransformData(r,r.o,t);return this.addToAnimatedContents(e,n),n},SVGShapeElement.prototype.createShapeElement=function(e,t,r){var n=4;"rc"===e.ty?n=5:"el"===e.ty?n=6:"sr"===e.ty&&(n=7);var i=new SVGShapeData(t,r,ShapePropertyFactory.getShapeProp(this,e,n,this));return this.shapes.push(i),this.addShapeToModifiers(i),this.addToAnimatedContents(e,i),i},SVGShapeElement.prototype.addToAnimatedContents=function(e,t){for(var r=0,n=this.animatedContents.length;r<n;){if(this.animatedContents[r].element===t)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(e),element:t,data:e})},SVGShapeElement.prototype.setElementStyles=function(e){var t,r=e.styles,n=this.stylesList.length;for(t=0;t<n;t+=1)this.stylesList[t].closed||r.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(e,t,r,n,i,s,a){var o,l,c,h,d,u,p=[].concat(s),f=e.length-1,m=[],g=[];for(o=f;o>=0;o-=1){if((u=this.searchProcessedElement(e[o]))?t[o]=r[u-1]:e[o]._render=a,"fl"===e[o].ty||"st"===e[o].ty||"gf"===e[o].ty||"gs"===e[o].ty||"no"===e[o].ty)u?t[o].style.closed=!1:t[o]=this.createStyleElement(e[o],i),e[o]._render&&t[o].style.pElem.parentNode!==n&&n.appendChild(t[o].style.pElem),m.push(t[o].style);else if("gr"===e[o].ty){if(u)for(c=t[o].it.length,l=0;l<c;l+=1)t[o].prevViewData[l]=t[o].it[l];else t[o]=this.createGroupElement(e[o]);this.searchShapes(e[o].it,t[o].it,t[o].prevViewData,t[o].gr,i+1,p,a),e[o]._render&&t[o].gr.parentNode!==n&&n.appendChild(t[o].gr)}else"tr"===e[o].ty?(u||(t[o]=this.createTransformElement(e[o],n)),h=t[o].transform,p.push(h)):"sh"===e[o].ty||"rc"===e[o].ty||"el"===e[o].ty||"sr"===e[o].ty?(u||(t[o]=this.createShapeElement(e[o],p,i)),this.setElementStyles(t[o])):"tm"===e[o].ty||"rd"===e[o].ty||"ms"===e[o].ty||"pb"===e[o].ty||"zz"===e[o].ty||"op"===e[o].ty?(u?(d=t[o]).closed=!1:((d=ShapeModifiers.getModifier(e[o].ty)).init(this,e[o]),t[o]=d,this.shapeModifiers.push(d)),g.push(d)):"rp"===e[o].ty&&(u?(d=t[o]).closed=!0:(d=ShapeModifiers.getModifier(e[o].ty),t[o]=d,d.init(this,e,o,t),this.shapeModifiers.push(d),a=!1),g.push(d));this.addProcessedElement(e[o],o+1)}for(f=m.length,o=0;o<f;o+=1)m[o].closed=!0;for(f=g.length,o=0;o<f;o+=1)g[o].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var e;this.renderModifiers();var t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].reset();for(this.renderShape(),e=0;e<t;e+=1)(this.stylesList[e]._mdf||this._isFirstFrame)&&(this.stylesList[e].msElem&&(this.stylesList[e].msElem.setAttribute("d",this.stylesList[e].d),this.stylesList[e].d="M0 0"+this.stylesList[e].d),this.stylesList[e].pElem.setAttribute("d",this.stylesList[e].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var e,t,r=this.animatedContents.length;for(e=0;e<r;e+=1)t=this.animatedContents[e],(this._isFirstFrame||t.element._isAnimated)&&!0!==t.data&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(e,t,r,n,i,s){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var a=!1;return this.o!==e&&(this.o=e,this._mdf.o=!0,a=!0),this.sw!==t&&(this.sw=t,this._mdf.sw=!0,a=!0),this.sc!==r&&(this.sc=r,this._mdf.sc=!0,a=!0),this.fc!==n&&(this.fc=n,this._mdf.fc=!0,a=!0),this.m!==i&&(this.m=i,this._mdf.m=!0,a=!0),!s.length||this.p[0]===s[0]&&this.p[1]===s[1]&&this.p[4]===s[4]&&this.p[5]===s[5]&&this.p[12]===s[12]&&this.p[13]===s[13]||(this.p=s,this._mdf.p=!0,a=!0),a},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},TextProperty.prototype.setCurrentData=function(e){e.__complete||this.completeTextData(e),this.currentData=e,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var n;this.lock=!0,this._mdf=!1;var i=this.effectsSequence.length,s=e||this.data.d.k[this.keysIndex].s;for(n=0;n<i;n+=1)s=r!==this.keysIndex?this.effectsSequence[n](s,s.t):this.effectsSequence[n](this.currentData,s.t);t!==s&&this.setCurrentData(s),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var e=this.data.d.k,t=this.elem.comp.renderedFrame,r=0,n=e.length;r<=n-1&&!(r===n-1||e[r+1].t>t);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,r,n=[],i=0,s=e.length,a=!1;i<s;)t=e.charCodeAt(i),FontManager.isCombinedCharacter(t)?n[n.length-1]+=e.charAt(i):t>=55296&&t<=56319?(r=e.charCodeAt(i+1))>=56320&&r<=57343?(a||FontManager.isModifier(t,r)?(n[n.length-1]+=e.substr(i,2),a=!1):n.push(e.substr(i,2)),i+=1):n.push(e.charAt(i)):t>56319?(r=e.charCodeAt(i+1),FontManager.isZeroWidthJoiner(t,r)?(a=!0,n[n.length-1]+=e.substr(i,2),i+=1):n.push(e.charAt(i))):FontManager.isZeroWidthJoiner(t)?(n[n.length-1]+=e.charAt(i),a=!0):n.push(e.charAt(i)),i+=1;return n},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,r,n,i,s,a,o,l=this.elem.globalData.fontManager,c=this.data,h=[],d=0,u=c.m.g,p=0,f=0,m=0,g=[],y=0,v=0,b=l.getFontByName(e.f),S=0,E=getFontProperties(b);e.fWeight=E.weight,e.fStyle=E.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),r=e.finalText.length,e.finalLineHeight=e.lh;var C,_=e.tr/1e3*e.finalSize;if(e.sz)for(var T,x,P=!0,w=e.sz[0],I=e.sz[1];P;){T=0,y=0,r=(x=this.buildFinalText(e.t)).length,_=e.tr/1e3*e.finalSize;var k=-1;for(t=0;t<r;t+=1)C=x[t].charCodeAt(0),n=!1," "===x[t]?k=t:13!==C&&3!==C||(y=0,n=!0,T+=e.finalLineHeight||1.2*e.finalSize),l.chars?(o=l.getCharData(x[t],b.fStyle,b.fFamily),S=n?0:o.w*e.finalSize/100):S=l.measureText(x[t],e.f,e.finalSize),y+S>w&&" "!==x[t]?(-1===k?r+=1:t=k,T+=e.finalLineHeight||1.2*e.finalSize,x.splice(t,k===t?1:0,"\r"),k=-1,y=0):(y+=S,y+=_);T+=b.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&I<T?(e.finalSize-=1,e.finalLineHeight=e.finalSize*e.lh/e.s):(e.finalText=x,r=e.finalText.length,P=!1)}y=-_,S=0;var A,M=0;for(t=0;t<r;t+=1)if(n=!1,13===(C=(A=e.finalText[t]).charCodeAt(0))||3===C?(M=0,g.push(y),v=y>v?y:v,y=-2*_,i="",n=!0,m+=1):i=A,l.chars?(o=l.getCharData(A,b.fStyle,l.getFontByName(e.f).fFamily),S=n?0:o.w*e.finalSize/100):S=l.measureText(i,e.f,e.finalSize)," "===A?M+=S+_:(y+=S+_+M,M=0),h.push({l:S,an:S,add:p,n:n,anIndexes:[],val:i,line:m,animatorJustifyOffset:0}),2==u){if(p+=S,""===i||" "===i||t===r-1){for(""!==i&&" "!==i||(p-=S);f<=t;)h[f].an=p,h[f].ind=d,h[f].extra=S,f+=1;d+=1,p=0}}else if(3==u){if(p+=S,""===i||t===r-1){for(""===i&&(p-=S);f<=t;)h[f].an=p,h[f].ind=d,h[f].extra=S,f+=1;p=0,d+=1}}else h[d].ind=d,h[d].extra=0,d+=1;if(e.l=h,v=y>v?y:v,g.push(y),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=v,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=g;var R,O,$,D,L=c.a;a=L.length;var F=[];for(s=0;s<a;s+=1){for((R=L[s]).a.sc&&(e.strokeColorAnim=!0),R.a.sw&&(e.strokeWidthAnim=!0),(R.a.fc||R.a.fh||R.a.fs||R.a.fb)&&(e.fillColorAnim=!0),D=0,$=R.s.b,t=0;t<r;t+=1)(O=h[t]).anIndexes[s]=D,(1==$&&""!==O.val||2==$&&""!==O.val&&" "!==O.val||3==$&&(O.n||" "==O.val||t==r-1)||4==$&&(O.n||t==r-1))&&(1===R.s.rn&&F.push(D),D+=1);c.a[s].s.totalChars=D;var N,B=-1;if(1===R.s.rn)for(t=0;t<r;t+=1)B!=(O=h[t]).anIndexes[s]&&(B=O.anIndexes[s],N=F.splice(Math.floor(Math.random()*F.length),1)[0]),O.anIndexes[s]=N}e.yOffset=e.finalLineHeight||1.2*e.finalSize,e.ls=e.ls||0,e.ascent=b.ascent*e.finalSize/100},TextProperty.prototype.updateDocumentData=function(e,t){t=void 0===t?this.keysIndex:t;var r=this.copyData({},this.data.d.k[t].s);r=this.copyData(r,e),this.data.d.k[t].s=r,this.recalculate(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(e){var t=this.data.d.k[e].s;t.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(t)},TextProperty.prototype.canResizeFont=function(e){this.canResize=e,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(e){this.minimumFontSize=Math.floor(e)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var e=Math.max,t=Math.min,r=Math.floor;function n(e,t){this._currentTextLength=-1,this.k=!1,this.data=t,this.elem=e,this.comp=e.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(e),this.s=PropertyFactory.getProp(e,t.s||{k:0},0,0,this),this.e="e"in t?PropertyFactory.getProp(e,t.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(e,t.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(e,t.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(e,t.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(e,t.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(e,t.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return n.prototype={getMult:function(n){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var i=0,s=0,a=1,o=1;this.ne.v>0?i=this.ne.v/100:s=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:o=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(i,s,a,o).get,c=0,h=this.finalS,d=this.finalE,u=this.data.sh;if(2===u)c=l(c=d===h?n>=d?1:0:e(0,t(.5/(d-h)+(n-h)/(d-h),1)));else if(3===u)c=l(c=d===h?n>=d?0:1:1-e(0,t(.5/(d-h)+(n-h)/(d-h),1)));else if(4===u)d===h?c=0:(c=e(0,t(.5/(d-h)+(n-h)/(d-h),1)))<.5?c*=2:c=1-2*(c-.5),c=l(c);else if(5===u){if(d===h)c=0;else{var p=d-h,f=-p/2+(n=t(e(0,n+.5-h),d-h)),m=p/2;c=Math.sqrt(1-f*f/(m*m))}c=l(c)}else 6===u?(d===h?c=0:(n=t(e(0,n+.5-h),d-h),c=(1+Math.cos(Math.PI+2*Math.PI*n/(d-h)))/2),c=l(c)):(n>=r(h)&&(c=e(0,t(n-h<0?t(d,1)-(h-n):d-n,1))),c=l(c));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var y=.5-.5*g;c<y?c=0:(c=(c-y)/g)>1&&(c=1)}return c*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/t,n=this.s.v/t+r,i=this.e.v/t+r;if(n>i){var s=n;n=i,i=s}this.finalS=n,this.finalE=i}},extendPrototype([DynamicPropertyContainer],n),{getTextSelectorProp:function(e,t,r){return new n(e,t)}}}();function TextAnimatorDataProperty(e,t,r){var n={propType:!1},i=PropertyFactory.getProp,s=t.a;this.a={r:s.r?i(e,s.r,0,degToRads,r):n,rx:s.rx?i(e,s.rx,0,degToRads,r):n,ry:s.ry?i(e,s.ry,0,degToRads,r):n,sk:s.sk?i(e,s.sk,0,degToRads,r):n,sa:s.sa?i(e,s.sa,0,degToRads,r):n,s:s.s?i(e,s.s,1,.01,r):n,a:s.a?i(e,s.a,1,0,r):n,o:s.o?i(e,s.o,0,.01,r):n,p:s.p?i(e,s.p,1,0,r):n,sw:s.sw?i(e,s.sw,0,0,r):n,sc:s.sc?i(e,s.sc,1,0,r):n,fc:s.fc?i(e,s.fc,1,0,r):n,fh:s.fh?i(e,s.fh,0,0,r):n,fs:s.fs?i(e,s.fs,0,.01,r):n,fb:s.fb?i(e,s.fb,0,.01,r):n,t:s.t?i(e,s.t,0,0,r):n},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,r),this.s.t=t.s.t}function TextAnimatorProperty(e,t,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var e,t,r=this._textData.a.length,n=PropertyFactory.getProp;for(e=0;e<r;e+=1)t=this._textData.a[e],this._animatorsData[e]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:n(this._elem,this._textData.p.a,0,0,this),f:n(this._elem,this._textData.p.f,0,0,this),l:n(this._elem,this._textData.p.l,0,0,this),r:n(this._elem,this._textData.p.r,0,0,this),p:n(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=n(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(e,t){if(this.lettersChangedFlag=t,this._mdf||this._isFirstFrame||t||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,n,i,s,a,o,l,c,h,d,u,p,f,m,g,y,v,b,S,E=this._moreOptions.alignment.v,C=this._animatorsData,_=this._textData,T=this.mHelper,x=this._renderType,P=this.renderedLetters.length,w=e.l;if(this._hasMaskedPath){if(S=this._pathData.m,!this._pathData.n||this._pathData._mdf){var I,k=S.v;for(this._pathData.r.v&&(k=k.reverse()),a={tLength:0,segments:[]},s=k._length-1,y=0,i=0;i<s;i+=1)I=bez.buildBezierData(k.v[i],k.v[i+1],[k.o[i][0]-k.v[i][0],k.o[i][1]-k.v[i][1]],[k.i[i+1][0]-k.v[i+1][0],k.i[i+1][1]-k.v[i+1][1]]),a.tLength+=I.segmentLength,a.segments.push(I),y+=I.segmentLength;i=s,S.v.c&&(I=bez.buildBezierData(k.v[i],k.v[0],[k.o[i][0]-k.v[i][0],k.o[i][1]-k.v[i][1]],[k.i[0][0]-k.v[0][0],k.i[0][1]-k.v[0][1]]),a.tLength+=I.segmentLength,a.segments.push(I),y+=I.segmentLength),this._pathData.pi=a}if(a=this._pathData.pi,o=this._pathData.f.v,u=0,d=1,c=0,h=!0,m=a.segments,o<0&&S.v.c)for(a.tLength<Math.abs(o)&&(o=-Math.abs(o)%a.tLength),d=(f=m[u=m.length-1].points).length-1;o<0;)o+=f[d].partialLength,(d-=1)<0&&(d=(f=m[u-=1].points).length-1);p=(f=m[u].points)[d-1],g=(l=f[d]).partialLength}s=w.length,r=0,n=0;var A,M,R,O,$,D=1.2*e.finalSize*.714,L=!0;R=C.length;var F,N,B,V,U,z,j,G,H,Z,W,K,Y=-1,q=o,Q=u,X=d,J=-1,ee="",te=this.defaultPropsArray;if(2===e.j||1===e.j){var re=0,ne=0,ie=2===e.j?-.5:-1,se=0,ae=!0;for(i=0;i<s;i+=1)if(w[i].n){for(re&&(re+=ne);se<i;)w[se].animatorJustifyOffset=re,se+=1;re=0,ae=!0}else{for(M=0;M<R;M+=1)(A=C[M].a).t.propType&&(ae&&2===e.j&&(ne+=A.t.v*ie),($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?re+=A.t.v*$[0]*ie:re+=A.t.v*$*ie);ae=!1}for(re&&(re+=ne);se<i;)w[se].animatorJustifyOffset=re,se+=1}for(i=0;i<s;i+=1){if(T.reset(),V=1,w[i].n)r=0,n+=e.yOffset,n+=L?1:0,o=q,L=!1,this._hasMaskedPath&&(d=X,p=(f=m[u=Q].points)[d-1],g=(l=f[d]).partialLength,c=0),ee="",W="",H="",K="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if(J!==w[i].line){switch(e.j){case 1:o+=y-e.lineWidths[w[i].line];break;case 2:o+=(y-e.lineWidths[w[i].line])/2}J=w[i].line}Y!==w[i].ind&&(w[Y]&&(o+=w[Y].extra),o+=w[i].an/2,Y=w[i].ind),o+=E[0]*w[i].an*.005;var oe=0;for(M=0;M<R;M+=1)(A=C[M].a).p.propType&&(($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?oe+=A.p.v[0]*$[0]:oe+=A.p.v[0]*$),A.a.propType&&(($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?oe+=A.a.v[0]*$[0]:oe+=A.a.v[0]*$);for(h=!0,this._pathData.a.v&&(o=.5*w[0].an+(y-this._pathData.f.v-.5*w[0].an-.5*w[w.length-1].an)*Y/(s-1),o+=this._pathData.f.v);h;)c+g>=o+oe||!f?(v=(o+oe-c)/l.partialLength,N=p.point[0]+(l.point[0]-p.point[0])*v,B=p.point[1]+(l.point[1]-p.point[1])*v,T.translate(-E[0]*w[i].an*.005,-E[1]*D*.01),h=!1):f&&(c+=l.partialLength,(d+=1)>=f.length&&(d=0,m[u+=1]?f=m[u].points:S.v.c?(d=0,f=m[u=0].points):(c-=l.partialLength,f=null)),f&&(p=l,g=(l=f[d]).partialLength));F=w[i].an/2-w[i].add,T.translate(-F,0,0)}else F=w[i].an/2-w[i].add,T.translate(-F,0,0),T.translate(-E[0]*w[i].an*.005,-E[1]*D*.01,0);for(M=0;M<R;M+=1)(A=C[M].a).t.propType&&($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars),0===r&&0===e.j||(this._hasMaskedPath?$.length?o+=A.t.v*$[0]:o+=A.t.v*$:$.length?r+=A.t.v*$[0]:r+=A.t.v*$));for(e.strokeWidthAnim&&(z=e.sw||0),e.strokeColorAnim&&(U=e.sc?[e.sc[0],e.sc[1],e.sc[2]]:[0,0,0]),e.fillColorAnim&&e.fc&&(j=[e.fc[0],e.fc[1],e.fc[2]]),M=0;M<R;M+=1)(A=C[M].a).a.propType&&(($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?T.translate(-A.a.v[0]*$[0],-A.a.v[1]*$[1],A.a.v[2]*$[2]):T.translate(-A.a.v[0]*$,-A.a.v[1]*$,A.a.v[2]*$));for(M=0;M<R;M+=1)(A=C[M].a).s.propType&&(($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars)).length?T.scale(1+(A.s.v[0]-1)*$[0],1+(A.s.v[1]-1)*$[1],1):T.scale(1+(A.s.v[0]-1)*$,1+(A.s.v[1]-1)*$,1));for(M=0;M<R;M+=1){if(A=C[M].a,$=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars),A.sk.propType&&($.length?T.skewFromAxis(-A.sk.v*$[0],A.sa.v*$[1]):T.skewFromAxis(-A.sk.v*$,A.sa.v*$)),A.r.propType&&($.length?T.rotateZ(-A.r.v*$[2]):T.rotateZ(-A.r.v*$)),A.ry.propType&&($.length?T.rotateY(A.ry.v*$[1]):T.rotateY(A.ry.v*$)),A.rx.propType&&($.length?T.rotateX(A.rx.v*$[0]):T.rotateX(A.rx.v*$)),A.o.propType&&($.length?V+=(A.o.v*$[0]-V)*$[0]:V+=(A.o.v*$-V)*$),e.strokeWidthAnim&&A.sw.propType&&($.length?z+=A.sw.v*$[0]:z+=A.sw.v*$),e.strokeColorAnim&&A.sc.propType)for(G=0;G<3;G+=1)$.length?U[G]+=(A.sc.v[G]-U[G])*$[0]:U[G]+=(A.sc.v[G]-U[G])*$;if(e.fillColorAnim&&e.fc){if(A.fc.propType)for(G=0;G<3;G+=1)$.length?j[G]+=(A.fc.v[G]-j[G])*$[0]:j[G]+=(A.fc.v[G]-j[G])*$;A.fh.propType&&(j=$.length?addHueToRGB(j,A.fh.v*$[0]):addHueToRGB(j,A.fh.v*$)),A.fs.propType&&(j=$.length?addSaturationToRGB(j,A.fs.v*$[0]):addSaturationToRGB(j,A.fs.v*$)),A.fb.propType&&(j=$.length?addBrightnessToRGB(j,A.fb.v*$[0]):addBrightnessToRGB(j,A.fb.v*$))}}for(M=0;M<R;M+=1)(A=C[M].a).p.propType&&($=C[M].s.getMult(w[i].anIndexes[M],_.a[M].s.totalChars),this._hasMaskedPath?$.length?T.translate(0,A.p.v[1]*$[0],-A.p.v[2]*$[1]):T.translate(0,A.p.v[1]*$,-A.p.v[2]*$):$.length?T.translate(A.p.v[0]*$[0],A.p.v[1]*$[1],-A.p.v[2]*$[2]):T.translate(A.p.v[0]*$,A.p.v[1]*$,-A.p.v[2]*$));if(e.strokeWidthAnim&&(H=z<0?0:z),e.strokeColorAnim&&(Z="rgb("+Math.round(255*U[0])+","+Math.round(255*U[1])+","+Math.round(255*U[2])+")"),e.fillColorAnim&&e.fc&&(W="rgb("+Math.round(255*j[0])+","+Math.round(255*j[1])+","+Math.round(255*j[2])+")"),this._hasMaskedPath){if(T.translate(0,-e.ls),T.translate(0,E[1]*D*.01+n,0),this._pathData.p.v){b=(l.point[1]-p.point[1])/(l.point[0]-p.point[0]);var le=180*Math.atan(b)/Math.PI;l.point[0]<p.point[0]&&(le+=180),T.rotate(-le*Math.PI/180)}T.translate(N,B,0),o-=E[0]*w[i].an*.005,w[i+1]&&Y!==w[i+1].ind&&(o+=w[i].an/2,o+=.001*e.tr*e.finalSize)}else{switch(T.translate(r,n,0),e.ps&&T.translate(e.ps[0],e.ps[1]+e.ascent,0),e.j){case 1:T.translate(w[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[w[i].line]),0,0);break;case 2:T.translate(w[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[w[i].line])/2,0,0)}T.translate(0,-e.ls),T.translate(F,0,0),T.translate(E[0]*w[i].an*.005,E[1]*D*.01,0),r+=w[i].l+.001*e.tr*e.finalSize}"html"===x?ee=T.toCSS():"svg"===x?ee=T.to2dCSS():te=[T.props[0],T.props[1],T.props[2],T.props[3],T.props[4],T.props[5],T.props[6],T.props[7],T.props[8],T.props[9],T.props[10],T.props[11],T.props[12],T.props[13],T.props[14],T.props[15]],K=V}P<=i?(O=new LetterProps(K,H,Z,W,ee,te),this.renderedLetters.push(O),P+=1,this.lettersChangedFlag=!0):(O=this.renderedLetters[i],this.lettersChangedFlag=O.update(K,H,Z,W,ee,te)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(e,t,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(e,t,r),this.textProperty=new TextProperty(this,e.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(e.t,this.renderType,this),this.initTransform(e,t,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)},ITextElement.prototype.createPathShape=function(e,t){var r,n,i=t.length,s="";for(r=0;r<i;r+=1)"sh"===t[r].ty&&(n=t[r].ks.k,s+=buildShapeString(n,n.i.length,!0,e));return s},ITextElement.prototype.updateDocumentData=function(e,t){this.textProperty.updateDocumentData(e,t)},ITextElement.prototype.canResizeFont=function(e){this.textProperty.canResizeFont(e)},ITextElement.prototype.setMinimumFontSize=function(e){this.textProperty.setMinimumFontSize(e)},ITextElement.prototype.applyTextPropertiesToMatrix=function(e,t,r,n,i){switch(e.ps&&t.translate(e.ps[0],e.ps[1]+e.ascent,0),t.translate(0,-e.ls,0),e.j){case 1:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[r]),0,0);break;case 2:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[r])/2,0,0)}t.translate(n,i,0)},ITextElement.prototype.buildColor=function(e){return"rgb("+Math.round(255*e[0])+","+Math.round(255*e[1])+","+Math.round(255*e[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){};var emptyShapeData={shapes:[]};function SVGTextLottieElement(e,t,r){this.textSpans=[],this.renderType="svg",this.initElement(e,t,r)}function ISolidElement(e,t,r){this.initElement(e,t,r)}function NullElement(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initFrame(),this.initTransform(e,t,r),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(e,t,r){this.layers=e.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function SVGRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(t&&t.title){var n=createNS("title"),i=createElementID();n.setAttribute("id",i),n.textContent=t.title,this.svgElement.appendChild(n),r+=i}if(t&&t.description){var s=createNS("desc"),a=createElementID();s.setAttribute("id",a),s.textContent=t.description,this.svgElement.appendChild(s),r+=" "+a}r&&this.svgElement.setAttribute("aria-labelledby",r);var o=createNS("defs");this.svgElement.appendChild(o);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",progressiveLoad:t&&t.progressiveLoad||!1,hideOnTransparent:!(t&&!1===t.hideOnTransparent),viewBoxOnly:t&&t.viewBoxOnly||!1,viewBoxSize:t&&t.viewBoxSize||!1,className:t&&t.className||"",id:t&&t.id||"",focusable:t&&t.focusable,filterSize:{width:t&&t.filterSize&&t.filterSize.width||"100%",height:t&&t.filterSize&&t.filterSize.height||"100%",x:t&&t.filterSize&&t.filterSize.x||"0%",y:t&&t.filterSize&&t.filterSize.y||"0%"},width:t&&t.width,height:t&&t.height,runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function CVContextData(){var e;for(this.saved=[],this.cArrPos=0,this.cTr=new Matrix,this.cO=1,this.savedOp=createTypedArray("float32",15),e=0;e<15;e+=1)this.saved[e]=createTypedArray("float32",16);this._length=15}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(e){for(var t=0,r=e.length,n=[],i="";t<r;)e[t]===String.fromCharCode(13)||e[t]===String.fromCharCode(3)?(n.push(i),i=""):i+=e[t],t+=1;return n.push(i),n},SVGTextLottieElement.prototype.buildShapeData=function(e,t){if(e.shapes&&e.shapes.length){var r=e.shapes[0];if(r.it){var n=r.it[r.it.length-1];n.s&&(n.s.k[0]=t,n.s.k[1]=t)}}return e},SVGTextLottieElement.prototype.buildNewText=function(){var e,t;this.addDynamicProperty(this);var r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var n=this.globalData.fontManager.getFontByName(r.f);if(n.fClass)this.layerElement.setAttribute("class",n.fClass);else{this.layerElement.setAttribute("font-family",n.fFamily);var i=r.fWeight,s=r.fStyle;this.layerElement.setAttribute("font-style",s),this.layerElement.setAttribute("font-weight",i)}this.layerElement.setAttribute("aria-label",r.t);var a,o=r.l||[],l=!!this.globalData.fontManager.chars;t=o.length;var c=this.mHelper,h=this.data.singleShape,d=0,u=0,p=!0,f=.001*r.tr*r.finalSize;if(!h||l||r.sz){var m,g=this.textSpans.length;for(e=0;e<t;e+=1){if(this.textSpans[e]||(this.textSpans[e]={span:null,childSpan:null,glyph:null}),!l||!h||0===e){if(a=g>e?this.textSpans[e].span:createNS(l?"g":"text"),g<=e){if(a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=a,l){var y=createNS("g");a.appendChild(y),this.textSpans[e].childSpan=y}this.textSpans[e].span=a,this.layerElement.appendChild(a)}a.style.display="inherit"}if(c.reset(),h&&(o[e].n&&(d=-f,u+=r.yOffset,u+=p?1:0,p=!1),this.applyTextPropertiesToMatrix(r,c,o[e].line,d,u),d+=o[e].l||0,d+=f),l){var v;if(1===(m=this.globalData.fontManager.getCharData(r.finalText[e],n.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily)).t)v=new SVGCompElement(m.data,this.globalData,this);else{var b=emptyShapeData;m.data&&m.data.shapes&&(b=this.buildShapeData(m.data,r.finalSize)),v=new SVGShapeElement(b,this.globalData,this)}if(this.textSpans[e].glyph){var S=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(S.layerElement),S.destroy()}this.textSpans[e].glyph=v,v._debug=!0,v.prepareFrame(0),v.renderFrame(),this.textSpans[e].childSpan.appendChild(v.layerElement),1===m.t&&this.textSpans[e].childSpan.setAttribute("transform","scale("+r.finalSize/100+","+r.finalSize/100+")")}else h&&a.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),a.textContent=o[e].val,a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}h&&a&&a.setAttribute("d","")}else{var E=this.textContainer,C="start";switch(r.j){case 1:C="end";break;case 2:C="middle";break;default:C="start"}E.setAttribute("text-anchor",C),E.setAttribute("letter-spacing",f);var _=this.buildTextContents(r.finalText);for(t=_.length,u=r.ps?r.ps[1]+r.ascent:0,e=0;e<t;e+=1)(a=this.textSpans[e].span||createNS("tspan")).textContent=_[e],a.setAttribute("x",0),a.setAttribute("y",u),a.style.display="inherit",E.appendChild(a),this.textSpans[e]||(this.textSpans[e]={span:null,glyph:null}),this.textSpans[e].span=a,u+=r.finalLineHeight;this.layerElement.appendChild(E)}for(;e<this.textSpans.length;)this.textSpans[e].span.style.display="none",e+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var e,t,r=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,e=0;e<r;e+=1)(t=this.textSpans[e].glyph)&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if((!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var e,t;this._sizeChanged=!0;var r,n,i,s=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(t=a.length,e=0;e<t;e+=1)a[e].n||(r=s[e],n=this.textSpans[e].span,(i=this.textSpans[e].glyph)&&i.renderFrame(),r._mdf.m&&n.setAttribute("transform",r.m),r._mdf.o&&n.setAttribute("opacity",r.o),r._mdf.sw&&n.setAttribute("stroke-width",r.sw),r._mdf.sc&&n.setAttribute("stroke",r.sc),r._mdf.fc&&n.setAttribute("fill",r.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var e=createNS("rect");e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.layerElement.appendChild(e)},NullElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(e){return new NullElement(e,this.globalData,this)},SVGRendererBase.prototype.createShape=function(e){return new SVGShapeElement(e,this.globalData,this)},SVGRendererBase.prototype.createText=function(e){return new SVGTextLottieElement(e,this.globalData,this)},SVGRendererBase.prototype.createImage=function(e){return new IImageElement(e,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(e){return new ISolidElement(e,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(e){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+e.w+" "+e.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",e.w),this.svgElement.setAttribute("height",e.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var t=this.globalData.defs;this.setupGlobalData(e,t),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=e;var r=createNS("clipPath"),n=createNS("rect");n.setAttribute("width",e.w),n.setAttribute("height",e.h),n.setAttribute("x",0),n.setAttribute("y",0);var i=createElementID();r.setAttribute("id",i),r.appendChild(n),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),t.appendChild(r),this.layers=e.layers,this.elements=createSizedArray(e.layers.length)},SVGRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(e){var t=0,r=this.layers.length;for(t=0;t<r;t+=1)if(this.layers[t].ind===e)return t;return-1},SVGRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){t[e]=!0;var r=this.createItem(this.layers[e]);if(t[e]=r,getExpressionsPlugin()&&(0===this.layers[e].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,e),this.layers[e].tt){var n="tp"in this.layers[e]?this.findIndexByInd(this.layers[e].tp):e-1;if(-1===n)return;if(this.elements[n]&&!0!==this.elements[n]){var i=t[n].getMatte(this.layers[e].tt);r.setMatte(i)}else this.buildItem(n),this.addPendingElement(r)}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var e=this.pendingElements.pop();if(e.checkParenting(),e.data.tt)for(var t=0,r=this.elements.length;t<r;){if(this.elements[t]===e){var n="tp"in e.data?this.findIndexByInd(e.data.tp):t-1,i=this.elements[n].getMatte(this.layers[t].tt);e.setMatte(i);break}t+=1}}},SVGRendererBase.prototype.renderFrame=function(e){if(this.renderedFrame!==e&&!this.destroyed){var t;null===e?e=this.renderedFrame:this.renderedFrame=e,this.globalData.frameNum=e,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=e,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(e),t=r-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t<r;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(e,t){var r=e.getBaseElement();if(r){for(var n,i=0;i<t;)this.elements[i]&&!0!==this.elements[i]&&this.elements[i].getBaseElement()&&(n=this.elements[i].getBaseElement()),i+=1;n?this.layerElement.insertBefore(r,n):this.layerElement.appendChild(r)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initTransform(e,t,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&t.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(e){if(this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=e/this.data.sr;else{var t=this.tm.v;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}var r,n=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},ICompElement.prototype.setElements=function(e){this.elements=e},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},CVContextData.prototype.duplicate=function(){var e=2*this._length,t=this.savedOp;this.savedOp=createTypedArray("float32",e),this.savedOp.set(t);var r=0;for(r=this._length;r<e;r+=1)this.saved[r]=createTypedArray("float32",16);this._length=e},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.cO=1},CVContextData.prototype.popTransform=function(){var e,t=this.saved[this.cArrPos],r=this.cTr.props;for(e=0;e<16;e+=1)r[e]=t[e];return t},CVContextData.prototype.popOpacity=function(){var e=this.savedOp[this.cArrPos];return this.cO=e,e},CVContextData.prototype.pop=function(){return this.cArrPos-=1,{transform:this.popTransform(),opacity:this.popOpacity()}},CVContextData.prototype.push=function(){var e,t=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var r=this.saved[this.cArrPos];for(e=0;e<16;e+=1)r[e]=t[e];this.savedOp[this.cArrPos]=this.cO,this.cArrPos+=1},CVContextData.prototype.getTransform=function(){return this.cTr},CVContextData.prototype.getOpacity=function(){return this.cO},CVContextData.prototype.setOpacity=function(e){this.cO=e},ShapeTransformManager.prototype={addTransformSequence:function(e){var t,r=e.length,n="_";for(t=0;t<r;t+=1)n+=e[t].transform.key+"_";var i=this.sequences[n];return i||(i={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[n]=i,this.sequenceList.push(i)),i},processSequence:function(e,t){for(var r,n=0,i=e.transforms.length,s=t;n<i&&!t;){if(e.transforms[n].transform.mProps._mdf){s=!0;break}n+=1}if(s)for(e.finalTransform.reset(),n=i-1;n>=0;n-=1)r=e.transforms[n].transform.mProps.v.props,e.finalTransform.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]);e._mdf=s},processSequences:function(e){var t,r=this.sequenceList.length;for(t=0;t<r;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var e="__lottie_element_luma_buffer",t=null,r=null,n=null;function i(){var i,s,a;t||(i=createNS("svg"),s=createNS("filter"),a=createNS("feColorMatrix"),s.setAttribute("id",e),a.setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),s.appendChild(a),i.appendChild(s),i.setAttribute("id",e+"_svg"),featureSupport.svgLumaHidden&&(i.style.display="none"),n=i,document.body.appendChild(n),t=createTag("canvas"),(r=t.getContext("2d")).filter="url(#"+e+")",r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1))}return{load:i,get:function(n){return t||i(),t.width=n.width,t.height=n.height,r.filter="url(#"+e+")",t}}};function createCanvas(e,t){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(e,t);var r=createTag("canvas");return r.width=e,r.height=t,r}var assetLoader={loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas:createCanvas};function CVEffects(){}function CVMaskElement(e,t){var r;this.data=e,this.element=t,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var n=this.masksProperties.length,i=!1;for(r=0;r<n;r+=1)"n"!==this.masksProperties[r].mode&&(i=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}function CVBaseElement(){}CVEffects.prototype.renderFrame=function(){},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var e,t,r,n,i=this.element.finalTransform.mat,s=this.element.canvasContext,a=this.masksProperties.length;for(s.beginPath(),e=0;e<a;e+=1)if("n"!==this.masksProperties[e].mode){var o;this.masksProperties[e].inv&&(s.moveTo(0,0),s.lineTo(this.element.globalData.compSize.w,0),s.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),s.lineTo(0,this.element.globalData.compSize.h),s.lineTo(0,0)),n=this.viewData[e].v,t=i.applyToPointArray(n.v[0][0],n.v[0][1],0),s.moveTo(t[0],t[1]);var l=n._length;for(o=1;o<l;o+=1)r=i.applyToTriplePoints(n.o[o-1],n.i[o],n.v[o]),s.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=i.applyToTriplePoints(n.o[o-1],n.i[0],n.v[0]),s.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),s.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};function CVShapeData(e,t,r,n){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i,s=4;"rc"===t.ty?s=5:"el"===t.ty?s=6:"sr"===t.ty&&(s=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,s,e);var a,o=r.length;for(i=0;i<o;i+=1)r[i].closed||(a={transforms:n.addTransformSequence(r[i].transforms),trNodes:[]},this.styledShapes.push(a),r[i].elements.push(a))}function CVShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(e,t,r)}function CVTextElement(e,t,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(e,t,r)}function CVImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.img=t.imageLoader.getAsset(this.assetData),this.initElement(e,t,r)}function CVSolidElement(e,t,r){this.initElement(e,t,r)}function CanvasRendererBase(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||""},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function CVCompElement(e,t,r){this.completeLayers=!1,this.layers=e.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function CanvasRenderer(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||"",runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}function HBaseElement(){}function HSolidElement(e,t,r){this.initElement(e,t,r)}function HShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(e,t,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(e,t,r){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(e,t,r)}function HCameraElement(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initHierarchy();var n=PropertyFactory.getProp;if(this.pe=n(this,e.pe,0,0,this),e.ks.p.s?(this.px=n(this,e.ks.p.x,1,0,this),this.py=n(this,e.ks.p.y,1,0,this),this.pz=n(this,e.ks.p.z,1,0,this)):this.p=n(this,e.ks.p,1,0,this),e.ks.a&&(this.a=n(this,e.ks.a,1,0,this)),e.ks.or.k.length&&e.ks.or.k[0].to){var i,s=e.ks.or.k.length;for(i=0;i<s;i+=1)e.ks.or.k[i].to=null,e.ks.or.k[i].ti=null}this.or=n(this,e.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=n(this,e.ks.rx,0,degToRads,this),this.ry=n(this,e.ks.ry,0,degToRads,this),this.rz=n(this,e.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,r)}function HybridRendererBase(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function HCompElement(e,t,r){this.layers=e.layers,this.supports3d=!e.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function HybridRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"},runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var e=this.globalData.canvasContext,t=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var r=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(r),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext("2d");if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var r=assetLoader.getLumaCanvas(this.canvasContext.canvas);r.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(r,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||e)){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var t=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(e,t){var r={data:e,type:e.ty,preTransforms:this.transformsManager.addTransformSequence(t),transforms:[],elements:[],closed:!0===e.hd},n={};if("fl"===e.ty||"st"===e.ty?(n.c=PropertyFactory.getProp(this,e.c,1,255,this),n.c.k||(r.co="rgb("+bmFloor(n.c.v[0])+","+bmFloor(n.c.v[1])+","+bmFloor(n.c.v[2])+")")):"gf"!==e.ty&&"gs"!==e.ty||(n.s=PropertyFactory.getProp(this,e.s,1,null,this),n.e=PropertyFactory.getProp(this,e.e,1,null,this),n.h=PropertyFactory.getProp(this,e.h||{k:0},0,.01,this),n.a=PropertyFactory.getProp(this,e.a||{k:0},0,degToRads,this),n.g=new GradientProperty(this,e.g,this)),n.o=PropertyFactory.getProp(this,e.o,0,.01,this),"st"===e.ty||"gs"===e.ty){if(r.lc=lineCapEnum[e.lc||2],r.lj=lineJoinEnum[e.lj||2],1==e.lj&&(r.ml=e.ml),n.w=PropertyFactory.getProp(this,e.w,0,null,this),n.w.k||(r.wi=n.w.v),e.d){var i=new DashProperty(this,e.d,"canvas",this);n.d=i,n.d.k||(r.da=n.d.dashArray,r.do=n.d.dashoffset[0])}}else r.r=2===e.r?"evenodd":"nonzero";return this.stylesList.push(r),n.style=r,n},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(e){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,e.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,e,this)}}},CVShapeElement.prototype.createShapeElement=function(e){var t=new CVShapeData(this,e,this.stylesList,this.transformsManager);return this.shapes.push(t),this.addShapeToModifiers(t),t},CVShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(e){var t,r=this.stylesList.length;for(t=0;t<r;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.push(e)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.pop()},CVShapeElement.prototype.closeStyles=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t].closed=!0},CVShapeElement.prototype.searchShapes=function(e,t,r,n,i){var s,a,o,l,c,h,d=e.length-1,u=[],p=[],f=[].concat(i);for(s=d;s>=0;s-=1){if((l=this.searchProcessedElement(e[s]))?t[s]=r[l-1]:e[s]._shouldRender=n,"fl"===e[s].ty||"st"===e[s].ty||"gf"===e[s].ty||"gs"===e[s].ty)l?t[s].style.closed=!1:t[s]=this.createStyleElement(e[s],f),u.push(t[s].style);else if("gr"===e[s].ty){if(l)for(o=t[s].it.length,a=0;a<o;a+=1)t[s].prevViewData[a]=t[s].it[a];else t[s]=this.createGroupElement(e[s]);this.searchShapes(e[s].it,t[s].it,t[s].prevViewData,n,f)}else"tr"===e[s].ty?(l||(h=this.createTransformElement(e[s]),t[s]=h),f.push(t[s]),this.addTransformToStyleList(t[s])):"sh"===e[s].ty||"rc"===e[s].ty||"el"===e[s].ty||"sr"===e[s].ty?l||(t[s]=this.createShapeElement(e[s])):"tm"===e[s].ty||"rd"===e[s].ty||"pb"===e[s].ty||"zz"===e[s].ty||"op"===e[s].ty?(l?(c=t[s]).closed=!1:((c=ShapeModifiers.getModifier(e[s].ty)).init(this,e[s]),t[s]=c,this.shapeModifiers.push(c)),p.push(c)):"rp"===e[s].ty&&(l?(c=t[s]).closed=!0:(c=ShapeModifiers.getModifier(e[s].ty),t[s]=c,c.init(this,e,s,t),this.shapeModifiers.push(c),n=!1),p.push(c));this.addProcessedElement(e[s],s+1)}for(this.removeTransformFromStyleList(),this.closeStyles(u),d=p.length,s=0;s<d;s+=1)p[s].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(e,t){(e._opMdf||t.op._mdf||this._isFirstFrame)&&(t.opacity=e.opacity,t.opacity*=t.op.v,t._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var e,t,r,n,i,s,a,o,l,c=this.stylesList.length,h=this.globalData.renderer,d=this.globalData.canvasContext;for(e=0;e<c;e+=1)if(("st"!==(o=(l=this.stylesList[e]).type)&&"gs"!==o||0!==l.wi)&&l.data._shouldRender&&0!==l.coOp&&0!==this.globalData.currentGlobalAlpha){for(h.save(),s=l.elements,"st"===o||"gs"===o?(d.strokeStyle="st"===o?l.co:l.grd,d.lineWidth=l.wi,d.lineCap=l.lc,d.lineJoin=l.lj,d.miterLimit=l.ml||0):d.fillStyle="fl"===o?l.co:l.grd,h.ctxOpacity(l.coOp),"st"!==o&&"gs"!==o&&d.beginPath(),h.ctxTransform(l.preTransforms.finalTransform.props),r=s.length,t=0;t<r;t+=1){for("st"!==o&&"gs"!==o||(d.beginPath(),l.da&&(d.setLineDash(l.da),d.lineDashOffset=l.do)),i=(a=s[t].trNodes).length,n=0;n<i;n+=1)"m"===a[n].t?d.moveTo(a[n].p[0],a[n].p[1]):"c"===a[n].t?d.bezierCurveTo(a[n].pts[0],a[n].pts[1],a[n].pts[2],a[n].pts[3],a[n].pts[4],a[n].pts[5]):d.closePath();"st"!==o&&"gs"!==o||(d.stroke(),l.da&&d.setLineDash(this.dashResetter))}"st"!==o&&"gs"!==o&&d.fill(l.r),h.restore()}},CVShapeElement.prototype.renderShape=function(e,t,r,n){var i,s;for(s=e,i=t.length-1;i>=0;i-=1)"tr"===t[i].ty?(s=r[i].transform,this.renderShapeTransform(e,s)):"sh"===t[i].ty||"el"===t[i].ty||"rc"===t[i].ty||"sr"===t[i].ty?this.renderPath(t[i],r[i]):"fl"===t[i].ty?this.renderFill(t[i],r[i],s):"st"===t[i].ty?this.renderStroke(t[i],r[i],s):"gf"===t[i].ty||"gs"===t[i].ty?this.renderGradientFill(t[i],r[i],s):"gr"===t[i].ty?this.renderShape(s,t[i].it,r[i].it):t[i].ty;n&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var r,n,i,s=e.trNodes,a=t.paths,o=a._length;s.length=0;var l=e.transforms.finalTransform;for(i=0;i<o;i+=1){var c=a.shapes[i];if(c&&c.v){for(n=c._length,r=1;r<n;r+=1)1===r&&s.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),s.push({t:"c",pts:l.applyToTriplePoints(c.o[r-1],c.i[r],c.v[r])});1===n&&s.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),c.c&&n&&(s.push({t:"c",pts:l.applyToTriplePoints(c.o[r-1],c.i[0],c.v[0])}),s.push({t:"z"}))}}e.trNodes=s}},CVShapeElement.prototype.renderPath=function(e,t){if(!0!==e.hd&&e._shouldRender){var r,n=t.styledShapes.length;for(r=0;r<n;r+=1)this.renderStyledShape(t.styledShapes[r],t.sh)}},CVShapeElement.prototype.renderFill=function(e,t,r){var n=t.style;(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(e,t,r){var n,i=t.style;if(!i.grd||t.g._mdf||t.s._mdf||t.e._mdf||1!==e.t&&(t.h._mdf||t.a._mdf)){var s,a=this.globalData.canvasContext,o=t.s.v,l=t.e.v;if(1===e.t)n=a.createLinearGradient(o[0],o[1],l[0],l[1]);else{var c=Math.sqrt(Math.pow(o[0]-l[0],2)+Math.pow(o[1]-l[1],2)),h=Math.atan2(l[1]-o[1],l[0]-o[0]),d=t.h.v;d>=1?d=.99:d<=-1&&(d=-.99);var u=c*d,p=Math.cos(h+t.a.v)*u+o[0],f=Math.sin(h+t.a.v)*u+o[1];n=a.createRadialGradient(p,f,0,o[0],o[1],c)}var m=e.g.p,g=t.g.c,y=1;for(s=0;s<m;s+=1)t.g._hasOpacity&&t.g._collapsable&&(y=t.g.o[2*s+1]),n.addColorStop(g[4*s]/100,"rgba("+g[4*s+1]+","+g[4*s+2]+","+g[4*s+3]+","+y+")");i.grd=n}i.coOp=t.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(e,t,r){var n=t.style,i=t.d;i&&(i._mdf||this._isFirstFrame)&&(n.da=i.dashArray,n.do=i.dashoffset[0]),(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*r.opacity),(t.w._mdf||this._isFirstFrame)&&(n.wi=t.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=!1;e.fc?(t=!0,this.values.fill=this.buildColor(e.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=t;var r=!1;e.sc&&(r=!0,this.values.stroke=this.buildColor(e.sc),this.values.sWidth=e.sw);var n,i,s,a,o,l,c,h,d,u,p,f,m=this.globalData.fontManager.getFontByName(e.f),g=e.l,y=this.mHelper;this.stroke=r,this.values.fValue=e.finalSize+"px "+this.globalData.fontManager.getFontByName(e.f).fFamily,i=e.finalText.length;var v=this.data.singleShape,b=.001*e.tr*e.finalSize,S=0,E=0,C=!0,_=0;for(n=0;n<i;n+=1){a=(s=this.globalData.fontManager.getCharData(e.finalText[n],m.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily))&&s.data||{},y.reset(),v&&g[n].n&&(S=-b,E+=e.yOffset,E+=C?1:0,C=!1),d=(c=a.shapes?a.shapes[0].it:[]).length,y.scale(e.finalSize/100,e.finalSize/100),v&&this.applyTextPropertiesToMatrix(e,y,g[n].line,S,E),p=createSizedArray(d-1);var T=0;for(h=0;h<d;h+=1)if("sh"===c[h].ty){for(l=c[h].ks.k.i.length,u=c[h].ks.k,f=[],o=1;o<l;o+=1)1===o&&f.push(y.applyToX(u.v[0][0],u.v[0][1],0),y.applyToY(u.v[0][0],u.v[0][1],0)),f.push(y.applyToX(u.o[o-1][0],u.o[o-1][1],0),y.applyToY(u.o[o-1][0],u.o[o-1][1],0),y.applyToX(u.i[o][0],u.i[o][1],0),y.applyToY(u.i[o][0],u.i[o][1],0),y.applyToX(u.v[o][0],u.v[o][1],0),y.applyToY(u.v[o][0],u.v[o][1],0));f.push(y.applyToX(u.o[o-1][0],u.o[o-1][1],0),y.applyToY(u.o[o-1][0],u.o[o-1][1],0),y.applyToX(u.i[0][0],u.i[0][1],0),y.applyToY(u.i[0][0],u.i[0][1],0),y.applyToX(u.v[0][0],u.v[0][1],0),y.applyToY(u.v[0][0],u.v[0][1],0)),p[T]=f,T+=1}v&&(S+=g[n].l,S+=b),this.textSpans[_]?this.textSpans[_].elem=p:this.textSpans[_]={elem:p},_+=1}},CVTextElement.prototype.renderInnerContent=function(){var e,t,r,n,i,s,a=this.canvasContext;a.font=this.values.fValue,a.lineCap="butt",a.lineJoin="miter",a.miterLimit=4,this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;t=c.length;var h,d,u=null,p=null,f=null;for(e=0;e<t;e+=1)if(!c[e].n){if((o=l[e])&&(this.globalData.renderer.save(),this.globalData.renderer.ctxTransform(o.p),this.globalData.renderer.ctxOpacity(o.o)),this.fill){for(o&&o.fc?u!==o.fc&&(u=o.fc,a.fillStyle=o.fc):u!==this.values.fill&&(u=this.values.fill,a.fillStyle=this.values.fill),n=(h=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<n;r+=1)for(s=(d=h[r]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<s;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.fill()}if(this.stroke){for(o&&o.sw?f!==o.sw&&(f=o.sw,a.lineWidth=o.sw):f!==this.values.sWidth&&(f=this.values.sWidth,a.lineWidth=this.values.sWidth),o&&o.sc?p!==o.sc&&(p=o.sc,a.strokeStyle=o.sc):p!==this.values.stroke&&(p=this.values.stroke,a.strokeStyle=this.values.stroke),n=(h=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<n;r+=1)for(s=(d=h[r]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<s;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),this.globalData.canvasContext.stroke()}o&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var e=createTag("canvas");e.width=this.assetData.w,e.height=this.assetData.h;var t,r,n=e.getContext("2d"),i=this.img.width,s=this.img.height,a=i/s,o=this.assetData.w/this.assetData.h,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;a>o&&"xMidYMid slice"===l||a<o&&"xMidYMid slice"!==l?t=(r=s)*o:r=(t=i)/o,n.drawImage(this.img,(i-t)/2,(s-r)/2,t,r,0,0,this.assetData.w,this.assetData.h),this.img=e}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){var e=this.canvasContext;e.fillStyle=this.data.sc,e.fillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(e){return new CVShapeElement(e,this.globalData,this)},CanvasRendererBase.prototype.createText=function(e){return new CVTextElement(e,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(e){return new CVImageElement(e,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(e){return new CVSolidElement(e,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(e){if(1!==e[0]||0!==e[1]||0!==e[4]||1!==e[5]||0!==e[12]||0!==e[13])if(this.renderConfig.clearCanvas){this.transformMat.cloneFromProps(e);var t=this.contextData.getTransform(),r=t.props;this.transformMat.transform(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15]),t.cloneFromProps(this.transformMat.props);var n=t.props;this.canvasContext.setTransform(n[0],n[1],n[4],n[5],n[12],n[13])}else this.canvasContext.transform(e[0],e[1],e[4],e[5],e[12],e[13])},CanvasRendererBase.prototype.ctxOpacity=function(e){var t=this.contextData.getOpacity();if(!this.renderConfig.clearCanvas)return this.canvasContext.globalAlpha*=e<0?0:e,void(this.globalData.currentGlobalAlpha=t);t*=e<0?0:e,this.contextData.setOpacity(t),this.globalData.currentGlobalAlpha!==t&&(this.canvasContext.globalAlpha=t,this.globalData.currentGlobalAlpha=t)},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(e){this.renderConfig.clearCanvas?(e&&this.canvasContext.save(),this.contextData.push()):this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(e){if(this.renderConfig.clearCanvas){e&&(this.canvasContext.restore(),this.globalData.blendMode="source-over");var t=this.contextData.pop(),r=t.transform,n=t.opacity;this.canvasContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13]),this.globalData.currentGlobalAlpha!==n&&(this.canvasContext.globalAlpha=n,this.globalData.currentGlobalAlpha=n)}else this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(e){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var t=this.animationItem.container.style;t.width="100%",t.height="100%";var r="0px 0px 0px";t.transformOrigin=r,t.mozTransformOrigin=r,t.webkitTransformOrigin=r,t["-webkit-transform"]=r,t.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.data=e,this.layers=e.layers,this.transformCanvas={w:e.w,h:e.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(e,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(e.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(e,t){var r,n,i,s;if(this.reset(),e?(r=e,n=t,this.canvasContext.canvas.width=r,this.canvasContext.canvas.height=n):(this.animationItem.wrapper&&this.animationItem.container?(r=this.animationItem.wrapper.offsetWidth,n=this.animationItem.wrapper.offsetHeight):(r=this.canvasContext.canvas.width,n=this.canvasContext.canvas.height),this.canvasContext.canvas.width=r*this.renderConfig.dpr,this.canvasContext.canvas.height=n*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var a=this.renderConfig.preserveAspectRatio.split(" "),o=a[1]||"meet",l=a[0]||"xMidYMid",c=l.substr(0,4),h=l.substr(4);i=r/n,(s=this.transformCanvas.w/this.transformCanvas.h)>i&&"meet"===o||s<i&&"slice"===o?(this.transformCanvas.sx=r/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=r/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===c&&(s<i&&"meet"===o||s>i&&"slice"===o)?(r-this.transformCanvas.w*(n/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===c&&(s<i&&"meet"===o||s>i&&"slice"===o)?(r-this.transformCanvas.w*(n/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===h&&(s>i&&"meet"===o||s<i&&"slice"===o)?(n-this.transformCanvas.h*(r/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===h&&(s>i&&"meet"===o||s<i&&"slice"===o)?(n-this.transformCanvas.h*(r/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=r/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var e;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),e=(this.layers?this.layers.length:0)-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(e,t){if((this.renderedFrame!==e||!0!==this.renderConfig.clearCanvas||t)&&!this.destroyed&&-1!==e){var r;this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n=this.layers.length;for(this.completeLayers||this.checkLayers(e),r=0;r<n;r+=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(e-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){var r=this.createItem(this.layers[e],this,this.globalData);t[e]=r,r.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var e,t=this.canvasContext;for(t.beginPath(),t.moveTo(0,0),t.lineTo(this.data.w,0),t.lineTo(this.data.w,this.data.h),t.lineTo(0,this.data.h),t.lineTo(0,0),t.clip(),e=this.layers.length-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects,this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var t=this.finalTransform.mat.toCSS();e.transform=t,e.webkitTransform=t}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var e;this.data.hasMask?((e=createNS("rect")).setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((e=createTag("div")).style.width=this.data.sw+"px",e.style.height=this.data.sh+"px",e.style.backgroundColor=this.data.sc),this.layerElement.appendChild(e)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var e;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),e=this.svgElement;else{e=createNS("svg");var t=this.comp.data?this.comp.data:this.globalData.compSize;e.setAttribute("width",t.w),e.setAttribute("height",t.h),e.appendChild(this.shapesContainer),this.layerElement.appendChild(e)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=e},HShapeElement.prototype.getTransformedPoint=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)t=e[r].mProps.v.applyToPointArray(t[0],t[1],0);return t},HShapeElement.prototype.calculateShapeBoundingBox=function(e,t){var r,n,i,s,a,o=e.sh.v,l=e.transformers,c=o._length;if(!(c<=1)){for(r=0;r<c-1;r+=1)n=this.getTransformedPoint(l,o.v[r]),i=this.getTransformedPoint(l,o.o[r]),s=this.getTransformedPoint(l,o.i[r+1]),a=this.getTransformedPoint(l,o.v[r+1]),this.checkBounds(n,i,s,a,t);o.c&&(n=this.getTransformedPoint(l,o.v[r]),i=this.getTransformedPoint(l,o.o[r]),s=this.getTransformedPoint(l,o.i[0]),a=this.getTransformedPoint(l,o.v[0]),this.checkBounds(n,i,s,a,t))}},HShapeElement.prototype.checkBounds=function(e,t,r,n,i){this.getBoundsOfCurve(e,t,r,n);var s=this.shapeBoundingBox;i.x=bmMin(s.left,i.x),i.xMax=bmMax(s.right,i.xMax),i.y=bmMin(s.top,i.y),i.yMax=bmMax(s.bottom,i.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(e,t,r,n){for(var i,s,a,o,l,c,h,d=[[e[0],n[0]],[e[1],n[1]]],u=0;u<2;++u)s=6*e[u]-12*t[u]+6*r[u],i=-3*e[u]+9*t[u]-9*r[u]+3*n[u],a=3*t[u]-3*e[u],s|=0,a|=0,0==(i|=0)&&0===s||(0===i?(o=-a/s)>0&&o<1&&d[u].push(this.calculateF(o,e,t,r,n,u)):(l=s*s-4*a*i)>=0&&((c=(-s+bmSqrt(l))/(2*i))>0&&c<1&&d[u].push(this.calculateF(c,e,t,r,n,u)),(h=(-s-bmSqrt(l))/(2*i))>0&&h<1&&d[u].push(this.calculateF(h,e,t,r,n,u))));this.shapeBoundingBox.left=bmMin.apply(null,d[0]),this.shapeBoundingBox.top=bmMin.apply(null,d[1]),this.shapeBoundingBox.right=bmMax.apply(null,d[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,d[1])},HShapeElement.prototype.calculateF=function(e,t,r,n,i,s){return bmPow(1-e,3)*t[s]+3*bmPow(1-e,2)*e*r[s]+3*(1-e)*bmPow(e,2)*n[s]+bmPow(e,3)*i[s]},HShapeElement.prototype.calculateBoundingBox=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)e[r]&&e[r].sh?this.calculateShapeBoundingBox(e[r],t):e[r]&&e[r].it?this.calculateBoundingBox(e[r].it,t):e[r]&&e[r].style&&e[r].w&&this.expandStrokeBoundingBox(e[r].w,t)},HShapeElement.prototype.expandStrokeBoundingBox=function(e,t){var r=0;if(e.keyframes){for(var n=0;n<e.keyframes.length;n+=1){var i=e.keyframes[n].s;i>r&&(r=i)}r*=e.mult}else r=e.v*e.mult;t.x-=r,t.xMax+=r,t.y-=r,t.yMax+=r},HShapeElement.prototype.currentBoxContains=function(e){return this.currentBBox.x<=e.x&&this.currentBBox.y<=e.y&&this.currentBBox.width+this.currentBBox.x>=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var e=this.tempBoundingBox,t=999999;if(e.x=t,e.xMax=-t,e.y=t,e.yMax=-t,this.calculateBoundingBox(this.itemsData,e),e.width=e.xMax<e.x?0:e.xMax-e.x,e.height=e.yMax<e.y?0:e.yMax-e.y,this.currentBoxContains(e))return;var r=!1;if(this.currentBBox.w!==e.width&&(this.currentBBox.w=e.width,this.shapeCont.setAttribute("width",e.width),r=!0),this.currentBBox.h!==e.height&&(this.currentBBox.h=e.height,this.shapeCont.setAttribute("height",e.height),r=!0),r||this.currentBBox.x!==e.x||this.currentBBox.y!==e.y){this.currentBBox.w=e.width,this.currentBBox.h=e.height,this.currentBBox.x=e.x,this.currentBBox.y=e.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var n=this.shapeCont.style,i="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";n.transform=i,n.webkitTransform=i}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var e=createNS("g");this.maskedElement.appendChild(e),this.innerElem=e}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=this.innerElem.style,r=e.fc?this.buildColor(e.fc):"rgba(0,0,0,0)";t.fill=r,t.color=r,e.sc&&(t.stroke=this.buildColor(e.sc),t.strokeWidth=e.sw+"px");var n,i,s=this.globalData.fontManager.getFontByName(e.f);if(!this.globalData.fontManager.chars)if(t.fontSize=e.finalSize+"px",t.lineHeight=e.finalSize+"px",s.fClass)this.innerElem.className=s.fClass;else{t.fontFamily=s.fFamily;var a=e.fWeight,o=e.fStyle;t.fontStyle=o,t.fontWeight=a}var l,c,h,d=e.l;i=d.length;var u,p=this.mHelper,f="",m=0;for(n=0;n<i;n+=1){if(this.globalData.fontManager.chars?(this.textPaths[m]?l=this.textPaths[m]:((l=createNS("path")).setAttribute("stroke-linecap",lineCapEnum[1]),l.setAttribute("stroke-linejoin",lineJoinEnum[2]),l.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[m]?h=(c=this.textSpans[m]).children[0]:((c=createTag("div")).style.lineHeight=0,(h=createNS("svg")).appendChild(l),styleDiv(c)))):this.isMasked?l=this.textPaths[m]?this.textPaths[m]:createNS("text"):this.textSpans[m]?(c=this.textSpans[m],l=this.textPaths[m]):(styleDiv(c=createTag("span")),styleDiv(l=createTag("span")),c.appendChild(l)),this.globalData.fontManager.chars){var g,y=this.globalData.fontManager.getCharData(e.finalText[n],s.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily);if(g=y?y.data:null,p.reset(),g&&g.shapes&&g.shapes.length&&(u=g.shapes[0].it,p.scale(e.finalSize/100,e.finalSize/100),f=this.createPathShape(p,u),l.setAttribute("d",f)),this.isMasked)this.innerElem.appendChild(l);else{if(this.innerElem.appendChild(c),g&&g.shapes){document.body.appendChild(h);var v=h.getBBox();h.setAttribute("width",v.width+2),h.setAttribute("height",v.height+2),h.setAttribute("viewBox",v.x-1+" "+(v.y-1)+" "+(v.width+2)+" "+(v.height+2));var b=h.style,S="translate("+(v.x-1)+"px,"+(v.y-1)+"px)";b.transform=S,b.webkitTransform=S,d[n].yOffset=v.y-1}else h.setAttribute("width",1),h.setAttribute("height",1);c.appendChild(h)}}else if(l.textContent=d[n].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(l);else{this.innerElem.appendChild(c);var E=l.style,C="translate3d(0,"+-e.finalSize/1.2+"px,0)";E.transform=C,E.webkitTransform=C}this.isMasked?this.textSpans[m]=l:this.textSpans[m]=c,this.textSpans[m].style.display="block",this.textPaths[m]=l,m+=1}for(;m<this.textSpans.length;)this.textSpans[m].style.display="none",m+=1},HTextElement.prototype.renderInnerContent=function(){var e;if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),e=this.svgElement.style;var t="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";e.transform=t,e.webkitTransform=t}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var r,n,i,s,a,o=0,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;for(n=c.length,r=0;r<n;r+=1)c[r].n?o+=1:(s=this.textSpans[r],a=this.textPaths[r],i=l[o],o+=1,i._mdf.m&&(this.isMasked?s.setAttribute("transform",i.m):(s.style.webkitTransform=i.m,s.style.transform=i.m)),s.style.opacity=i.o,i.sw&&i._mdf.sw&&a.setAttribute("stroke-width",i.sw),i.sc&&i._mdf.sc&&a.setAttribute("stroke",i.sc),i.fc&&i._mdf.fc&&(a.setAttribute("fill",i.fc),a.style.color=i.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var h=this.innerElem.getBBox();if(this.currentBBox.w!==h.width&&(this.currentBBox.w=h.width,this.svgElement.setAttribute("width",h.width)),this.currentBBox.h!==h.height&&(this.currentBBox.h=h.height,this.svgElement.setAttribute("height",h.height)),this.currentBBox.w!==h.width+2||this.currentBBox.h!==h.height+2||this.currentBBox.x!==h.x-1||this.currentBBox.y!==h.y-1){this.currentBBox.w=h.width+2,this.currentBBox.h=h.height+2,this.currentBBox.x=h.x-1,this.currentBBox.y=h.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),e=this.svgElement.style;var d="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";e.transform=d,e.webkitTransform=d}}}},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var e,t,r,n,i=this.comp.threeDElements.length;for(e=0;e<i;e+=1)if("3d"===(t=this.comp.threeDElements[e]).type){r=t.perspectiveElem.style,n=t.container.style;var s=this.pe.v+"px",a="0px 0px 0px",o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.perspective=s,r.webkitPerspective=s,n.transformOrigin=a,n.mozTransformOrigin=a,n.webkitTransformOrigin=a,r.transform=o,r.webkitTransform=o}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var e,t,r=this._isFirstFrame;if(this.hierarchy)for(t=this.hierarchy.length,e=0;e<t;e+=1)r=this.hierarchy[e].finalTransform.mProp._mdf||r;if(r||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(e=t=this.hierarchy.length-1;e>=0;e-=1){var n=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-n.p.v[0],-n.p.v[1],n.p.v[2]),this.mat.rotateX(-n.or.v[0]).rotateY(-n.or.v[1]).rotateZ(n.or.v[2]),this.mat.rotateX(-n.rx.v).rotateY(-n.ry.v).rotateZ(n.rz.v),this.mat.scale(1/n.s.v[0],1/n.s.v[1],1/n.s.v[2]),this.mat.translate(n.a.v[0],n.a.v[1],n.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var i;i=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var s=Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2)+Math.pow(i[2],2)),a=[i[0]/s,i[1]/s,i[2]/s],o=Math.sqrt(a[2]*a[2]+a[0]*a[0]),l=Math.atan2(a[1],o),c=Math.atan2(a[0],-a[2]);this.mat.rotateY(c).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var h=!this._prevMat.equals(this.mat);if((h||this.pe._mdf)&&this.comp.threeDElements){var d,u,p;for(t=this.comp.threeDElements.length,e=0;e<t;e+=1)if("3d"===(d=this.comp.threeDElements[e]).type){if(h){var f=this.mat.toCSS();(p=d.container.style).transform=f,p.webkitTransform=f}this.pe._mdf&&((u=d.perspectiveElem.style).perspective=this.pe.v+"px",u.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData),t=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(t),t.crossOrigin="anonymous",t.src=e,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRendererBase.prototype.appendElementInPos=function(e,t){var r=e.getBaseElement();if(r){var n=this.layers[t];if(n.ddd&&this.supports3d)this.addTo3dContainer(r,t);else if(this.threeDElements)this.addTo3dContainer(r,t);else{for(var i,s,a=0;a<t;)this.elements[a]&&!0!==this.elements[a]&&this.elements[a].getBaseElement&&(s=this.elements[a],i=(this.layers[a].ddd?this.getThreeDContainerByPos(a):s.getBaseElement())||i),a+=1;i?n.ddd&&this.supports3d||this.layerElement.insertBefore(r,i):n.ddd&&this.supports3d||this.layerElement.appendChild(r)}}},HybridRendererBase.prototype.createShape=function(e){return this.supports3d?new HShapeElement(e,this.globalData,this):new SVGShapeElement(e,this.globalData,this)},HybridRendererBase.prototype.createText=function(e){return this.supports3d?new HTextElement(e,this.globalData,this):new SVGTextLottieElement(e,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(e){return this.camera=new HCameraElement(e,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(e){return this.supports3d?new HImageElement(e,this.globalData,this):new IImageElement(e,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(e){return this.supports3d?new HSolidElement(e,this.globalData,this):new ISolidElement(e,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(e){for(var t=0,r=this.threeDElements.length;t<r;){if(this.threeDElements[t].startPos<=e&&this.threeDElements[t].endPos>=e)return this.threeDElements[t].perspectiveElem;t+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(e,t){var r,n,i=createTag("div");styleDiv(i);var s=createTag("div");if(styleDiv(s),"3d"===t){(r=i.style).width=this.globalData.compSize.w+"px",r.height=this.globalData.compSize.h+"px";var a="50% 50%";r.webkitTransformOrigin=a,r.mozTransformOrigin=a,r.transformOrigin=a;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(n=s.style).transform=o,n.webkitTransform=o}i.appendChild(s);var l={container:s,perspectiveElem:i,startPos:e,endPos:e,type:t};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var e,t,r=this.layers.length,n="";for(e=0;e<r;e+=1)this.layers[e].ddd&&3!==this.layers[e].ty?("3d"!==n&&(n="3d",t=this.createThreeDContainer(e,"3d")),t.endPos=Math.max(t.endPos,e)):("2d"!==n&&(n="2d",t=this.createThreeDContainer(e,"2d")),t.endPos=Math.max(t.endPos,e));for(e=(r=this.threeDElements.length)-1;e>=0;e-=1)this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(e,t){for(var r=0,n=this.threeDElements.length;r<n;){if(t<=this.threeDElements[r].endPos){for(var i,s=this.threeDElements[r].startPos;s<t;)this.elements[s]&&this.elements[s].getBaseElement&&(i=this.elements[s].getBaseElement()),s+=1;i?this.threeDElements[r].container.insertBefore(e,i):this.threeDElements[r].container.appendChild(e);break}r+=1}},HybridRendererBase.prototype.configAnimation=function(e){var t=createTag("div"),r=this.animationItem.wrapper,n=t.style;n.width=e.w+"px",n.height=e.h+"px",this.resizerElem=t,styleDiv(t),n.transformStyle="flat",n.mozTransformStyle="flat",n.webkitTransformStyle="flat",this.renderConfig.className&&t.setAttribute("class",this.renderConfig.className),r.appendChild(t),n.overflow="hidden";var i=createNS("svg");i.setAttribute("width","1"),i.setAttribute("height","1"),styleDiv(i),this.resizerElem.appendChild(i);var s=createNS("defs");i.appendChild(s),this.data=e,this.setupGlobalData(e,i),this.globalData.defs=s,this.layers=e.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var e,t,r,n,i=this.animationItem.wrapper.offsetWidth,s=this.animationItem.wrapper.offsetHeight,a=i/s;this.globalData.compSize.w/this.globalData.compSize.h>a?(e=i/this.globalData.compSize.w,t=i/this.globalData.compSize.w,r=0,n=(s-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(e=s/this.globalData.compSize.h,t=s/this.globalData.compSize.h,r=(i-this.globalData.compSize.w*(s/this.globalData.compSize.h))/2,n=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+e+",0,0,0,0,"+t+",0,0,0,0,1,0,"+r+","+n+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var e,t=this.globalData.compSize.w,r=this.globalData.compSize.h,n=this.threeDElements.length;for(e=0;e<n;e+=1){var i=this.threeDElements[e].perspectiveElem.style;i.webkitPerspective=Math.sqrt(Math.pow(t,2)+Math.pow(r,2))+"px",i.perspective=i.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(e){var t,r=e.length,n=createTag("div");for(t=0;t<r;t+=1)if(e[t].xt){var i=this.createComp(e[t],n,this.globalData.comp,null);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(e,t){for(var r,n=0;n<t;)this.elements[n]&&this.elements[n].getBaseElement&&(r=this.elements[n].getBaseElement()),n+=1;r?this.layerElement.insertBefore(e,r):this.layerElement.appendChild(e)},HCompElement.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)},extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)};var CompExpressionInterface=function(e){function t(t){for(var r=0,n=e.layers.length;r<n;){if(e.layers[r].nm===t||e.layers[r].ind===t)return e.elements[r].layerInterface;r+=1}return null}return Object.defineProperty(t,"_name",{value:e.data.nm}),t.layer=t,t.pixelAspect=1,t.height=e.data.h||e.globalData.compSize.h,t.width=e.data.w||e.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/e.globalData.frameRate,t.displayStartTime=0,t.numLayers=e.layers.length,t},Expressions=function(){var e={initExpressions:function(e){var t=0,r=[];e.renderer.compInterface=CompExpressionInterface(e.renderer),e.renderer.globalData.projectInterface.registerComposition(e.renderer),e.renderer.globalData.pushExpression=function(){t+=1},e.renderer.globalData.popExpression=function(){0==(t-=1)&&function(){var e,t=r.length;for(e=0;e<t;e+=1)r[e].release();r.length=0}()},e.renderer.globalData.registerExpressionProperty=function(e){-1===r.indexOf(e)&&r.push(e)}}};return e}(),MaskManagerInterface=function(){function e(e,t){this._mask=e,this._data=t}return Object.defineProperty(e.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}}),function(t){var r,n=createSizedArray(t.viewData.length),i=t.viewData.length;for(r=0;r<i;r+=1)n[r]=new e(t.viewData[r],t.masksProperties[r]);return function(e){for(r=0;r<i;){if(t.masksProperties[r].nm===e)return n[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var e={pv:0,v:0,mult:1},t={pv:[0,0,0],v:[0,0,0],mult:1};function r(e,t,r){Object.defineProperty(e,"velocity",{get:function(){return t.getVelocityAtTime(t.comp.currentFrame)}}),e.numKeys=t.keyframes?t.keyframes.length:0,e.key=function(n){if(!e.numKeys)return 0;var i="";i="s"in t.keyframes[n-1]?t.keyframes[n-1].s:"e"in t.keyframes[n-2]?t.keyframes[n-2].e:t.keyframes[n-2].s;var s="unidimensional"===r?new Number(i):Object.assign({},i);return s.time=t.keyframes[n-1].t/t.elem.comp.globalData.frameRate,s.value="unidimensional"===r?i[0]:i,s},e.valueAtTime=t.getValueAtTime,e.speedAtTime=t.getSpeedAtTime,e.velocityAtTime=t.getVelocityAtTime,e.propertyGroup=t.propertyGroup}function n(){return e}return function(i){return i?"unidimensional"===i.propType?function(t){t&&"pv"in t||(t=e);var n=1/t.mult,i=t.pv*n,s=new Number(i);return s.value=i,r(s,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*n,s.value!==i&&((s=new Number(i)).value=i,r(s,t,"unidimensional")),s}}(i):function(e){e&&"pv"in e||(e=t);var n=1/e.mult,i=e.data&&e.data.l||e.pv.length,s=createTypedArray("float32",i),a=createTypedArray("float32",i);return s.value=a,r(s,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)a[t]=e.v[t]*n,s[t]=a[t];return s}}(i):n}}(),TransformExpressionInterface=function(e){function t(e){switch(e){case"scale":case"Scale":case"ADBE Scale":case 6:return t.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return t.rotation;case"ADBE Rotate X":return t.xRotation;case"ADBE Rotate Y":return t.yRotation;case"position":case"Position":case"ADBE Position":case 2:return t.position;case"ADBE Position_0":return t.xPosition;case"ADBE Position_1":return t.yPosition;case"ADBE Position_2":return t.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return t.anchorPoint;case"opacity":case"Opacity":case 11:return t.opacity;default:return null}}var r,n,i,s;return Object.defineProperty(t,"rotation",{get:ExpressionPropertyInterface(e.r||e.rz)}),Object.defineProperty(t,"zRotation",{get:ExpressionPropertyInterface(e.rz||e.r)}),Object.defineProperty(t,"xRotation",{get:ExpressionPropertyInterface(e.rx)}),Object.defineProperty(t,"yRotation",{get:ExpressionPropertyInterface(e.ry)}),Object.defineProperty(t,"scale",{get:ExpressionPropertyInterface(e.s)}),e.p?s=ExpressionPropertyInterface(e.p):(r=ExpressionPropertyInterface(e.px),n=ExpressionPropertyInterface(e.py),e.pz&&(i=ExpressionPropertyInterface(e.pz))),Object.defineProperty(t,"position",{get:function(){return e.p?s():[r(),n(),i?i():0]}}),Object.defineProperty(t,"xPosition",{get:ExpressionPropertyInterface(e.px)}),Object.defineProperty(t,"yPosition",{get:ExpressionPropertyInterface(e.py)}),Object.defineProperty(t,"zPosition",{get:ExpressionPropertyInterface(e.pz)}),Object.defineProperty(t,"anchorPoint",{get:ExpressionPropertyInterface(e.a)}),Object.defineProperty(t,"opacity",{get:ExpressionPropertyInterface(e.o)}),Object.defineProperty(t,"skew",{get:ExpressionPropertyInterface(e.sk)}),Object.defineProperty(t,"skewAxis",{get:ExpressionPropertyInterface(e.sa)}),Object.defineProperty(t,"orientation",{get:ExpressionPropertyInterface(e.or)}),t},LayerExpressionInterface=function(){function e(e){var t=new Matrix;return void 0!==e?this._elem.finalTransform.mProp.getValueAtTime(e).clone(t):this._elem.finalTransform.mProp.applyToMatrix(t),t}function t(e,t){var r=this.getMatrix(t);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,e)}function r(e,t){var r=this.getMatrix(t);return this.applyPoint(r,e)}function n(e,t){var r=this.getMatrix(t);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,e)}function i(e,t){var r=this.getMatrix(t);return this.invertPoint(r,e)}function s(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)}return e.applyToPointArray(t[0],t[1],t[2]||0)}function a(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)}return e.inversePoint(t)}function o(e){var t=new Matrix;if(t.reset(),this._elem.finalTransform.mProp.applyToMatrix(t),this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t);return t.inversePoint(e)}return t.inversePoint(e)}function l(){return[1,1,1,1]}return function(c){var h;function d(e){switch(e){case"ADBE Root Vectors Group":case"Contents":case 2:return d.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return h;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return d.effect;case"ADBE Text Properties":return d.textInterface;default:return null}}d.getMatrix=e,d.invertPoint=a,d.applyPoint=s,d.toWorld=r,d.toWorldVec=t,d.fromWorld=i,d.fromWorldVec=n,d.toComp=r,d.fromComp=o,d.sampleImage=l,d.sourceRectAtTime=c.sourceRectAtTime.bind(c),d._elem=c;var u=getDescriptor(h=TransformExpressionInterface(c.finalTransform.mProp),"anchorPoint");return Object.defineProperties(d,{hasParent:{get:function(){return c.hierarchy.length}},parent:{get:function(){return c.hierarchy[0].layerInterface}},rotation:getDescriptor(h,"rotation"),scale:getDescriptor(h,"scale"),position:getDescriptor(h,"position"),opacity:getDescriptor(h,"opacity"),anchorPoint:u,anchor_point:u,transform:{get:function(){return h}},active:{get:function(){return c.isInRange}}}),d.startTime=c.data.st,d.index=c.data.ind,d.source=c.data.refId,d.height=0===c.data.ty?c.data.h:100,d.width=0===c.data.ty?c.data.w:100,d.inPoint=c.data.ip/c.comp.globalData.frameRate,d.outPoint=c.data.op/c.comp.globalData.frameRate,d._name=c.data.nm,d.registerMaskInterface=function(e){d.mask=new MaskManagerInterface(e,c)},d.registerEffectsInterface=function(e){d.effect=e},d}}(),propertyGroupFactory=function(e,t){return function(r){return(r=void 0===r?1:r)<=0?e:t(r-1)}},PropertyInterface=function(e,t){var r={_name:e};return function(e){return(e=void 0===e?1:e)<=0?r:t(e-1)}},EffectsExpressionInterface=function(){var e={createEffectsInterface:function(e,r){if(e.effectsManager){var n,i=[],s=e.data.ef,a=e.effectsManager.effectElements.length;for(n=0;n<a;n+=1)i.push(t(s[n],e.effectsManager.effectElements[n],r,e));var o=e.data.ef||[],l=function(e){for(n=0,a=o.length;n<a;){if(e===o[n].nm||e===o[n].mn||e===o[n].ix)return i[n];n+=1}return null};return Object.defineProperty(l,"numProperties",{get:function(){return o.length}}),l}return null}};function t(e,n,i,s){function a(t){for(var r=e.ef,n=0,i=r.length;n<i;){if(t===r[n].nm||t===r[n].mn||t===r[n].ix)return 5===r[n].ty?c[n]:c[n]();n+=1}throw new Error}var o,l=propertyGroupFactory(a,i),c=[],h=e.ef.length;for(o=0;o<h;o+=1)5===e.ef[o].ty?c.push(t(e.ef[o],n.effectElements[o],n.effectElements[o].propertyGroup,s)):c.push(r(n.effectElements[o],e.ef[o].ty,s,l));return"ADBE Color Control"===e.mn&&Object.defineProperty(a,"color",{get:function(){return c[0]()}}),Object.defineProperties(a,{numProperties:{get:function(){return e.np}},_name:{value:e.nm},propertyGroup:{value:l}}),a.enabled=0!==e.en,a.active=a.enabled,a}function r(e,t,r,n){var i=ExpressionPropertyInterface(e.p);return e.p.setGroupProperty&&e.p.setGroupProperty(PropertyInterface("",n)),function(){return 10===t?r.comp.compInterface(e.p.v):i()}}return e}(),ShapePathInterface=function(e,t,r){var n=t.sh;function i(e){return"Shape"===e||"shape"===e||"Path"===e||"path"===e||"ADBE Vector Shape"===e||2===e?i.path:null}var s=propertyGroupFactory(i,r);return n.setGroupProperty(PropertyInterface("Path",s)),Object.defineProperties(i,{path:{get:function(){return n.k&&n.getValue(),n}},shape:{get:function(){return n.k&&n.getValue(),n}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:r}}),i},ShapeExpressionInterface=function(){function e(e,a,u){var p,f=[],m=e?e.length:0;for(p=0;p<m;p+=1)"gr"===e[p].ty?f.push(t(e[p],a[p],u)):"fl"===e[p].ty?f.push(r(e[p],a[p],u)):"st"===e[p].ty?f.push(i(e[p],a[p],u)):"tm"===e[p].ty?f.push(s(e[p],a[p],u)):"tr"===e[p].ty||("el"===e[p].ty?f.push(o(e[p],a[p],u)):"sr"===e[p].ty?f.push(l(e[p],a[p],u)):"sh"===e[p].ty?f.push(ShapePathInterface(e[p],a[p],u)):"rc"===e[p].ty?f.push(c(e[p],a[p],u)):"rd"===e[p].ty?f.push(h(e[p],a[p],u)):"rp"===e[p].ty?f.push(d(e[p],a[p],u)):"gf"===e[p].ty?f.push(n(e[p],a[p],u)):f.push((e[p],a[p],function(){return null})));return f}function t(t,r,n){var i=function(e){switch(e){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,n);var s=function(t,r,n){var i,s=function(e){for(var t=0,r=i.length;t<r;){if(i[t]._name===e||i[t].mn===e||i[t].propertyIndex===e||i[t].ix===e||i[t].ind===e)return i[t];t+=1}return"number"==typeof e?i[e-1]:null};s.propertyGroup=propertyGroupFactory(s,n),i=e(t.it,r.it,s.propertyGroup),s.numProperties=i.length;var o=a(t.it[t.it.length-1],r.it[r.it.length-1],s.propertyGroup);return s.transform=o,s.propertyIndex=t.cix,s._name=t.nm,s}(t,r,i.propertyGroup),o=a(t.it[t.it.length-1],r.it[r.it.length-1],i.propertyGroup);return i.content=s,i.transform=o,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function r(e,t,r){function n(e){return"Color"===e||"color"===e?n.color:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),n}function n(e,t,r){function n(e){return"Start Point"===e||"start point"===e?n.startPoint:"End Point"===e||"end point"===e?n.endPoint:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{startPoint:{get:ExpressionPropertyInterface(t.s)},endPoint:{get:ExpressionPropertyInterface(t.e)},opacity:{get:ExpressionPropertyInterface(t.o)},type:{get:function(){return"a"}},_name:{value:e.nm},mn:{value:e.mn}}),t.s.setGroupProperty(PropertyInterface("Start Point",r)),t.e.setGroupProperty(PropertyInterface("End Point",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),n}function i(e,t,r){var n,i=propertyGroupFactory(c,r),s=propertyGroupFactory(l,i);function a(r){Object.defineProperty(l,e.d[r].nm,{get:ExpressionPropertyInterface(t.d.dataProps[r].p)})}var o=e.d?e.d.length:0,l={};for(n=0;n<o;n+=1)a(n),t.d.dataProps[n].p.setGroupProperty(s);function c(e){return"Color"===e||"color"===e?c.color:"Opacity"===e||"opacity"===e?c.opacity:"Stroke Width"===e||"stroke width"===e?c.strokeWidth:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},strokeWidth:{get:ExpressionPropertyInterface(t.w)},dash:{get:function(){return l}},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",i)),t.o.setGroupProperty(PropertyInterface("Opacity",i)),t.w.setGroupProperty(PropertyInterface("Stroke Width",i)),c}function s(e,t,r){function n(t){return t===e.e.ix||"End"===t||"end"===t?n.end:t===e.s.ix?n.start:t===e.o.ix?n.offset:null}var i=propertyGroupFactory(n,r);return n.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",i)),t.e.setGroupProperty(PropertyInterface("End",i)),t.o.setGroupProperty(PropertyInterface("Offset",i)),n.propertyIndex=e.ix,n.propertyGroup=r,Object.defineProperties(n,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),n.mn=e.mn,n}function a(e,t,r){function n(t){return e.a.ix===t||"Anchor Point"===t?n.anchorPoint:e.o.ix===t||"Opacity"===t?n.opacity:e.p.ix===t||"Position"===t?n.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?n.rotation:e.s.ix===t||"Scale"===t?n.scale:e.sk&&e.sk.ix===t||"Skew"===t?n.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?n.skewAxis:null}var i=propertyGroupFactory(n,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",i)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",i)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",i)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",i)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",i)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",i)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",i))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",i)),Object.defineProperties(n,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),n.ty="tr",n.mn=e.mn,n.propertyGroup=r,n}function o(e,t,r){function n(t){return e.p.ix===t?n.position:e.s.ix===t?n.size:null}var i=propertyGroupFactory(n,r);n.propertyIndex=e.ix;var s="tm"===t.sh.ty?t.sh.prop:t.sh;return s.s.setGroupProperty(PropertyInterface("Size",i)),s.p.setGroupProperty(PropertyInterface("Position",i)),Object.defineProperties(n,{size:{get:ExpressionPropertyInterface(s.s)},position:{get:ExpressionPropertyInterface(s.p)},_name:{value:e.nm}}),n.mn=e.mn,n}function l(e,t,r){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.rotation:e.pt.ix===t?n.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?n.outerRadius:e.os.ix===t?n.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?n.innerRoundness:null:n.innerRadius}var i=propertyGroupFactory(n,r),s="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,s.or.setGroupProperty(PropertyInterface("Outer Radius",i)),s.os.setGroupProperty(PropertyInterface("Outer Roundness",i)),s.pt.setGroupProperty(PropertyInterface("Points",i)),s.p.setGroupProperty(PropertyInterface("Position",i)),s.r.setGroupProperty(PropertyInterface("Rotation",i)),e.ir&&(s.ir.setGroupProperty(PropertyInterface("Inner Radius",i)),s.is.setGroupProperty(PropertyInterface("Inner Roundness",i))),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(s.p)},rotation:{get:ExpressionPropertyInterface(s.r)},points:{get:ExpressionPropertyInterface(s.pt)},outerRadius:{get:ExpressionPropertyInterface(s.or)},outerRoundness:{get:ExpressionPropertyInterface(s.os)},innerRadius:{get:ExpressionPropertyInterface(s.ir)},innerRoundness:{get:ExpressionPropertyInterface(s.is)},_name:{value:e.nm}}),n.mn=e.mn,n}function c(e,t,r){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?n.size:null}var i=propertyGroupFactory(n,r),s="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,s.p.setGroupProperty(PropertyInterface("Position",i)),s.s.setGroupProperty(PropertyInterface("Size",i)),s.r.setGroupProperty(PropertyInterface("Rotation",i)),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(s.p)},roundness:{get:ExpressionPropertyInterface(s.r)},size:{get:ExpressionPropertyInterface(s.s)},_name:{value:e.nm}}),n.mn=e.mn,n}function h(e,t,r){function n(t){return e.r.ix===t||"Round Corners 1"===t?n.radius:null}var i=propertyGroupFactory(n,r),s=t;return n.propertyIndex=e.ix,s.rd.setGroupProperty(PropertyInterface("Radius",i)),Object.defineProperties(n,{radius:{get:ExpressionPropertyInterface(s.rd)},_name:{value:e.nm}}),n.mn=e.mn,n}function d(e,t,r){function n(t){return e.c.ix===t||"Copies"===t?n.copies:e.o.ix===t||"Offset"===t?n.offset:null}var i=propertyGroupFactory(n,r),s=t;return n.propertyIndex=e.ix,s.c.setGroupProperty(PropertyInterface("Copies",i)),s.o.setGroupProperty(PropertyInterface("Offset",i)),Object.defineProperties(n,{copies:{get:ExpressionPropertyInterface(s.c)},offset:{get:ExpressionPropertyInterface(s.o)},_name:{value:e.nm}}),n.mn=e.mn,n}return function(t,r,n){var i;function s(e){if("number"==typeof e)return 0===(e=void 0===e?1:e)?n:i[e-1];for(var t=0,r=i.length;t<r;){if(i[t]._name===e)return i[t];t+=1}return null}return s.propertyGroup=propertyGroupFactory(s,(function(){return n})),i=e(t,r,s.propertyGroup),s.numProperties=i.length,s._name="Contents",s}}(),TextExpressionInterface=function(e){var t,r;function n(e){return"ADBE Text Document"===e?n.sourceText:null}return Object.defineProperty(n,"sourceText",{get:function(){e.textProperty.getValue();var n=e.textProperty.currentData.t;return n!==t&&(t=e.textProperty.currentData.t,(r=new String(n)).value=n||new String(n),Object.defineProperty(r,"style",{get:function(){return{fillColor:e.textProperty.currentData.fc}}})),r}}),n};function _typeof$2(e){return _typeof$2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(e)}var FootageInterface=(dataInterfaceFactory=function(e){function t(e){return"Outline"===e?t.outlineInterface():null}return t._name="Outline",t.outlineInterface=function(e){var t="",r=e.getFootageData();function n(e){if(r[e])return t=e,"object"===_typeof$2(r=r[e])?n:r;var i=e.indexOf(t);if(-1!==i){var s=parseInt(e.substr(i+t.length),10);return"object"===_typeof$2(r=r[s])?n:r}return""}return function(){return t="",r=e.getFootageData(),n}}(e),t},function(e){function t(e){return"Data"===e?t.dataInterface:null}return t._name="Data",t.dataInterface=dataInterfaceFactory(e),t}),dataInterfaceFactory,interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(e){return interfaces[e]||null}function _typeof$1(e){return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(e)}function seedRandom(e,t){var r=this,n=256,i="random",s=t.pow(n,6),a=t.pow(2,52),o=2*a,l=n-1;function c(e){var t,r=e.length,i=this,s=0,a=i.i=i.j=0,o=i.S=[];for(r||(e=[r++]);s<n;)o[s]=s++;for(s=0;s<n;s++)o[s]=o[a=l&a+e[s%r]+(t=o[s])],o[a]=t;i.g=function(e){for(var t,r=0,s=i.i,a=i.j,o=i.S;e--;)t=o[s=l&s+1],r=r*n+o[l&(o[s]=o[a=l&a+t])+(o[a]=t)];return i.i=s,i.j=a,r}}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function d(e,t){var r,n=[],i=_typeof$1(e);if(t&&"object"==i)for(r in e)try{n.push(d(e[r],t-1))}catch(e){}return n.length?n:"string"==i?e:e+"\0"}function u(e,t){for(var r,n=e+"",i=0;i<n.length;)t[l&i]=l&(r^=19*t[l&i])+n.charCodeAt(i++);return p(t)}function p(e){return String.fromCharCode.apply(0,e)}t["seed"+i]=function(l,f,m){var g=[],y=u(d((f=!0===f?{entropy:!0}:f||{}).entropy?[l,p(e)]:null===l?function(){try{var t=new Uint8Array(n);return(r.crypto||r.msCrypto).getRandomValues(t),p(t)}catch(t){var i=r.navigator,s=i&&i.plugins;return[+new Date,r,s,r.screen,p(e)]}}():l,3),g),v=new c(g),b=function(){for(var e=v.g(6),t=s,r=0;e<a;)e=(e+r)*n,t*=n,r=v.g(1);for(;e>=o;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|v.g(4)},b.quick=function(){return v.g(4)/4294967296},b.double=b,u(p(v.S),e),(f.pass||m||function(e,r,n,s){return s&&(s.S&&h(s,v),e.state=function(){return h(v,{})}),n?(t[i]=e,r):e})(b,y,"global"in f?f.global:this==t,f.state)},u(t.random(),e)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null;function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||"boolean"===e||"string"===e||t instanceof Number}function $bm_neg(e){var t=_typeof(e);if("number"===t||"boolean"===t||e instanceof Number)return-e;if($bm_isInstanceOfArray(e)){var r,n=e.length,i=[];for(r=0;r<n;r+=1)i[r]=-e[r];return i}return e.propType?e.v:-e}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(e,t){var r=_typeof(e),n=_typeof(t);if("string"===r||"string"===n)return e+t;if(isNumerable(r,e)&&isNumerable(n,t))return e+t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]+=t,e;if(isNumerable(r,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e+t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,s=e.length,a=t.length,o=[];i<s||i<a;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?o[i]=e[i]+t[i]:o[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return o}return 0}var add=sum;function sub(e,t){var r=_typeof(e),n=_typeof(t);if(isNumerable(r,e)&&isNumerable(n,t))return"string"===r&&(e=parseInt(e,10)),"string"===n&&(t=parseInt(t,10)),e-t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]-=t,e;if(isNumerable(r,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e-t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,s=e.length,a=t.length,o=[];i<s||i<a;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?o[i]=e[i]-t[i]:o[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return o}return 0}function mul(e,t){var r,n,i,s=_typeof(e),a=_typeof(t);if(isNumerable(s,e)&&isNumerable(a,t))return e*t;if($bm_isInstanceOfArray(e)&&isNumerable(a,t)){for(i=e.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e[n]*t;return r}if(isNumerable(s,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e*t[n];return r}return 0}function div(e,t){var r,n,i,s=_typeof(e),a=_typeof(t);if(isNumerable(s,e)&&isNumerable(a,t))return e/t;if($bm_isInstanceOfArray(e)&&isNumerable(a,t)){for(i=e.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e[n]/t;return r}if(isNumerable(s,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e/t[n];return r}return 0}function mod(e,t){return"string"==typeof e&&(e=parseInt(e,10)),"string"==typeof t&&(t=parseInt(t,10)),e%t}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(e,t,r){if(t>r){var n=r;r=t,t=n}return Math.min(Math.max(e,t),r)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if("number"==typeof e||e instanceof Number)return t=t||0,Math.abs(e-t);var r;t||(t=helperLengthArray);var n=Math.min(e.length,t.length),i=0;for(r=0;r<n;r+=1)i+=Math.pow(t[r]-e[r],2);return Math.sqrt(i)}function normalize(e){return div(e,length(e))}function rgbToHsl(e){var t,r,n=e[0],i=e[1],s=e[2],a=Math.max(n,i,s),o=Math.min(n,i,s),l=(a+o)/2;if(a===o)t=0,r=0;else{var c=a-o;switch(r=l>.5?c/(2-a-o):c/(a+o),a){case n:t=(i-s)/c+(i<s?6:0);break;case i:t=(s-n)/c+2;break;case s:t=(n-i)/c+4}t/=6}return[t,r,l,e[3]]}function hue2rgb(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function hslToRgb(e){var t,r,n,i=e[0],s=e[1],a=e[2];if(0===s)t=a,n=a,r=a;else{var o=a<.5?a*(1+s):a+s-a*s,l=2*a-o;t=hue2rgb(l,o,i+1/3),r=hue2rgb(l,o,i),n=hue2rgb(l,o,i-1/3)}return[t,r,n,e[3]]}function linear(e,t,r,n,i){if(void 0!==n&&void 0!==i||(n=t,i=r,t=0,r=1),r<t){var s=r;r=t,t=s}if(e<=t)return n;if(e>=r)return i;var a,o=r===t?0:(e-t)/(r-t);if(!n.length)return n+(i-n)*o;var l=n.length,c=createTypedArray("float32",l);for(a=0;a<l;a+=1)c[a]=n[a]+(i[a]-n[a])*o;return c}function random(e,t){if(void 0===t&&(void 0===e?(e=0,t=1):(t=e,e=void 0)),t.length){var r,n=t.length;e||(e=createTypedArray("float32",n));var i=createTypedArray("float32",n),s=BMMath.random();for(r=0;r<n;r+=1)i[r]=e[r]+s*(t[r]-e[r]);return i}return void 0===e&&(e=0),e+BMMath.random()*(t-e)}function createPath(e,t,r,n){var i,s=e.length,a=shapePool.newElement();a.setPathData(!!n,s);var o,l,c=[0,0];for(i=0;i<s;i+=1)o=t&&t[i]?t[i]:c,l=r&&r[i]?r[i]:c,a.setTripleAt(e[i][0],e[i][1],l[0]+e[i][0],l[1]+e[i][1],o[0]+e[i][0],o[1]+e[i][1],i,!0);return a}function initiateExpression(elem,data,property){function noOp(e){return e}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(e,t){var r,n,i=this.pv.length?this.pv.length:1,s=createTypedArray("float32",i),a=Math.floor(5*time);for(r=0,n=0;r<a;){for(n=0;n<i;n+=1)s[n]+=-t+2*t*BMMath.random();r+=1}var o=5*time,l=o-Math.floor(o),c=createTypedArray("float32",i);if(i>1){for(n=0;n<i;n+=1)c[n]=this.pv[n]+s[n]+(-t+2*t*BMMath.random())*l;return c}return this.pv+s[0]+(-t+2*t*BMMath.random())*l}.bind(this);function loopInDuration(e,t){return loopIn(e,t,!0)}function loopOutDuration(e,t){return loopOut(e,t,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(e,t){var r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],n=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,n,0]}function easeOut(e,t,r,n,i){return applyEase(easeOutBez,e,t,r,n,i)}function easeIn(e,t,r,n,i){return applyEase(easeInBez,e,t,r,n,i)}function ease(e,t,r,n,i){return applyEase(easeInOutBez,e,t,r,n,i)}function applyEase(e,t,r,n,i,s){void 0===i?(i=r,s=n):t=(t-r)/(n-r),t>1?t=1:t<0&&(t=0);var a=e(t);if($bm_isInstanceOfArray(i)){var o,l=i.length,c=createTypedArray("float32",l);for(o=0;o<l;o+=1)c[o]=(s[o]-i[o])*a+i[o];return c}return(s-i)*a+i}function nearestKey(e){var t,r,n,i=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(e*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,n=data.k[0].t;else{for(t=0;t<i-1;t+=1){if(e===data.k[t].t){r=t+1,n=data.k[t].t;break}if(e>data.k[t].t&&e<data.k[t+1].t){e-data.k[t].t>data.k[t+1].t-e?(r=t+2,n=data.k[t+1].t):(r=t+1,n=data.k[t].t);break}}-1===r&&(r=t+1,n=data.k[t].t)}else r=0,n=0;var s={};return s.index=r,s.time=n/elem.comp.globalData.frameRate,s}function key(e){var t,r,n;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var i=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(n=i.length,r=0;r<n;r+=1)t[r]=i[r],t.value[r]=i[r];return t}function framesToTime(e,t){return t||(t=elem.comp.globalData.frameRate),e/t}function timeToFrames(e,t){return e||0===e||(e=time),t||(t=elem.comp.globalData.frameRate),e*t}function seedRandom(e){BMMath.seedrandom(randSeed+e)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(e,t){return"string"==typeof value?void 0===t?value.substring(e):value.substring(e,t):""}function substr(e,t){return"string"==typeof value?void 0===t?value.substr(e):value.substr(e,t):""}function posterizeTime(e){time=0===e?0:Math.floor(time*e)/e,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(e){return value=e,this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath],ob}(),expressionHelpers={searchExpressions:function(e,t,r){t.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(e,t,r).bind(r)))},getSpeedAtTime:function(e){var t=this.getValueAtTime(e),r=this.getValueAtTime(e+-.01),n=0;if(t.length){var i;for(i=0;i<t.length;i+=1)n+=Math.pow(r[i]-t[i],2);n=100*Math.sqrt(n)}else n=0;return n},getVelocityAtTime:function(e){if(void 0!==this.vel)return this.vel;var t,r,n=-.001,i=this.getValueAtTime(e),s=this.getValueAtTime(e+n);if(i.length)for(t=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)t[r]=(s[r]-i[r])/n;else t=(s-i)/n;return t},getValueAtTime:function(e){return e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<e?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(e,this._cachingAtTime),this._cachingAtTime.lastFrame=e),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(e){this.propertyGroup=e}};function addPropertyDecorator(){function e(e,t,r){if(!this.k||!this.keyframes)return this.pv;e=e?e.toLowerCase():"";var n,i,s,a,o,l=this.comp.renderedFrame,c=this.keyframes,h=c[c.length-1].t;if(l<=h)return this.pv;if(r?i=h-(n=t?Math.abs(h-this.elem.comp.globalData.frameRate*t):Math.max(0,h-this.elem.data.ip)):((!t||t>c.length-1)&&(t=c.length-1),n=h-(i=c[c.length-1-t].t)),"pingpong"===e){if(Math.floor((l-i)/n)%2!=0)return this.getValueAtTime((n-(l-i)%n+i)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var d=this.getValueAtTime(i/this.comp.globalData.frameRate,0),u=this.getValueAtTime(h/this.comp.globalData.frameRate,0),p=this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0),f=Math.floor((l-i)/n);if(this.pv.length){for(a=(o=new Array(d.length)).length,s=0;s<a;s+=1)o[s]=(u[s]-d[s])*f+p[s];return o}return(u-d)*f+p}if("continue"===e){var m=this.getValueAtTime(h/this.comp.globalData.frameRate,0),g=this.getValueAtTime((h-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(a=(o=new Array(m.length)).length,s=0;s<a;s+=1)o[s]=m[s]+(m[s]-g[s])*((l-h)/this.comp.globalData.frameRate)/5e-4;return o}return m+(l-h)/.001*(m-g)}}return this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0)}function t(e,t,r){if(!this.k)return this.pv;e=e?e.toLowerCase():"";var n,i,s,a,o,l=this.comp.renderedFrame,c=this.keyframes,h=c[0].t;if(l>=h)return this.pv;if(r?i=h+(n=t?Math.abs(this.elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-h)):((!t||t>c.length-1)&&(t=c.length-1),n=(i=c[t].t)-h),"pingpong"===e){if(Math.floor((h-l)/n)%2==0)return this.getValueAtTime(((h-l)%n+h)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var d=this.getValueAtTime(h/this.comp.globalData.frameRate,0),u=this.getValueAtTime(i/this.comp.globalData.frameRate,0),p=this.getValueAtTime((n-(h-l)%n+h)/this.comp.globalData.frameRate,0),f=Math.floor((h-l)/n)+1;if(this.pv.length){for(a=(o=new Array(d.length)).length,s=0;s<a;s+=1)o[s]=p[s]-(u[s]-d[s])*f;return o}return p-(u-d)*f}if("continue"===e){var m=this.getValueAtTime(h/this.comp.globalData.frameRate,0),g=this.getValueAtTime((h+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(a=(o=new Array(m.length)).length,s=0;s<a;s+=1)o[s]=m[s]+(m[s]-g[s])*(h-l)/.001;return o}return m+(m-g)*(h-l)/.001}}return this.getValueAtTime((n-((h-l)%n+h))/this.comp.globalData.frameRate,0)}function r(e,t){if(!this.k)return this.pv;if(e=.5*(e||.4),(t=Math.floor(t||5))<=1)return this.pv;var r,n,i=this.comp.renderedFrame/this.comp.globalData.frameRate,s=i-e,a=t>1?(i+e-s)/(t-1):1,o=0,l=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;o<t;){if(n=this.getValueAtTime(s+o*a),this.pv.length)for(l=0;l<this.pv.length;l+=1)r[l]+=n[l];else r+=n;o+=1}if(this.pv.length)for(l=0;l<this.pv.length;l+=1)r[l]/=t;else r/=t;return r}function n(e){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var t=this._transformCachingAtTime.v;if(t.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(e);t.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var n=this.s.getValueAtTime(e);t.scale(n[0]*this.s.mult,n[1]*this.s.mult,n[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var i=this.sk.getValueAtTime(e),s=this.sa.getValueAtTime(e);t.skewFromAxis(-i*this.sk.mult,s*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var a=this.r.getValueAtTime(e);t.rotate(-a*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var o=this.rz.getValueAtTime(e),l=this.ry.getValueAtTime(e),c=this.rx.getValueAtTime(e),h=this.or.getValueAtTime(e);t.rotateZ(-o*this.rz.mult).rotateY(l*this.ry.mult).rotateX(c*this.rx.mult).rotateZ(-h[2]*this.or.mult).rotateY(h[1]*this.or.mult).rotateX(h[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var d=this.px.getValueAtTime(e),u=this.py.getValueAtTime(e);if(this.data.p.z){var p=this.pz.getValueAtTime(e);t.translate(d*this.px.mult,u*this.py.mult,-p*this.pz.mult)}else t.translate(d*this.px.mult,u*this.py.mult,0)}else{var f=this.p.getValueAtTime(e);t.translate(f[0]*this.p.mult,f[1]*this.p.mult,-f[2]*this.p.mult)}return t}function i(){return this.v.clone(new Matrix)}var s=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(e,t,r){var a=s(e,t,r);return a.dynamicProperties.length?a.getValueAtTime=n.bind(a):a.getValueAtTime=i.bind(a),a.setGroupProperty=expressionHelpers.setGroupProperty,a};var a=PropertyFactory.getProp;PropertyFactory.getProp=function(n,i,s,o,l){var c=a(n,i,s,o,l);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=e,c.loopIn=t,c.smooth=r,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=1===i.a?i.k.length:0,c.propertyIndex=i.ix;var h=0;return 0!==s&&(h=createTypedArray("float32",1===i.a?i.k[0].s.length:i.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:h},expressionHelpers.searchExpressions(n,i,c),c.k&&l.addDynamicProperty(c),c};var o=ShapePropertyFactory.getConstructorFunction(),l=ShapePropertyFactory.getKeyframedConstructorFunction();function c(){}c.prototype={vertices:function(e,t){this.k&&this.getValue();var r,n=this.v;void 0!==t&&(n=this.getValueAtTime(t,0));var i=n._length,s=n[e],a=n.v,o=createSizedArray(i);for(r=0;r<i;r+=1)o[r]="i"===e||"o"===e?[s[r][0]-a[r][0],s[r][1]-a[r][1]]:[s[r][0],s[r][1]];return o},points:function(e){return this.vertices("v",e)},inTangents:function(e){return this.vertices("i",e)},outTangents:function(e){return this.vertices("o",e)},isClosed:function(){return this.v.c},pointOnPath:function(e,t){var r=this.v;void 0!==t&&(r=this.getValueAtTime(t,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var n,i=this._segmentsLength,s=i.lengths,a=i.totalLength*e,o=0,l=s.length,c=0;o<l;){if(c+s[o].addedLength>a){var h=o,d=r.c&&o===l-1?0:o+1,u=(a-c)/s[o].addedLength;n=bez.getPointInSegment(r.v[h],r.v[d],r.o[h],r.i[d],u,s[o]);break}c+=s[o].addedLength,o+=1}return n||(n=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),n},vectorOnPath:function(e,t,r){1==e?e=this.v.c:0==e&&(e=.999);var n=this.pointOnPath(e,t),i=this.pointOnPath(e+.001,t),s=i[0]-n[0],a=i[1]-n[1],o=Math.sqrt(Math.pow(s,2)+Math.pow(a,2));return 0===o?[0,0]:"tangent"===r?[s/o,a/o]:[-a/o,s/o]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([c],o),extendPrototype([c],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<e?this._caching.lastIndex:0,this._cachingAtTime.lastTime=e,this.interpolateShape(e,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},l.prototype.initiateExpression=ExpressionManager.initiateExpression;var h=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(e,t,r,n,i){var s=h(e,t,r,n,i);return s.propertyIndex=t.ix,s.lock=!1,3===r?expressionHelpers.searchExpressions(e,t.pt,s):4===r&&expressionHelpers.searchExpressions(e,t.ks,s),s.k&&e.addDynamicProperty(s),s}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(e,t){var r=this.calculateExpression(t);if(e.t!==r){var n={};return this.copyData(n,e),n.t=r.toString(),n.__complete=!1,n}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function(e,t){var r,n,i=createNS("feMerge");for(i.setAttribute("result",e),n=0;n<t.length;n+=1)(r=createNS("feMergeNode")).setAttribute("in",t[n]),i.appendChild(r),i.appendChild(r);return i}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(e,t,r,n,i){this.filterManager=t;var s=createNS("feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","linearRGB"),s.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=s,s.setAttribute("result",n+"_tint_1"),e.appendChild(s),(s=createNS("feColorMatrix")).setAttribute("type","matrix"),s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),s.setAttribute("result",n+"_tint_2"),e.appendChild(s),this.matrixFilter=s;var a=this.createMergeNode(n,[i,n+"_tint_1",n+"_tint_2"]);e.appendChild(a)}function SVGFillFilter(e,t,r,n){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),i.setAttribute("result",n),e.appendChild(i),this.matrixFilter=i}function SVGStrokeEffect(e,t,r){this.initialized=!1,this.filterManager=t,this.elem=r,this.paths=[]}function SVGTritoneFilter(e,t,r,n){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),e.appendChild(i);var s=createNS("feComponentTransfer");s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",n),this.matrixFilter=s;var a=createNS("feFuncR");a.setAttribute("type","table"),s.appendChild(a),this.feFuncR=a;var o=createNS("feFuncG");o.setAttribute("type","table"),s.appendChild(o),this.feFuncG=o;var l=createNS("feFuncB");l.setAttribute("type","table"),s.appendChild(l),this.feFuncB=l,e.appendChild(s)}function SVGProLevelsFilter(e,t,r,n){this.filterManager=t;var i=this.filterManager.effectElements,s=createNS("feComponentTransfer");(i[10].p.k||0!==i[10].p.v||i[11].p.k||1!==i[11].p.v||i[12].p.k||1!==i[12].p.v||i[13].p.k||0!==i[13].p.v||i[14].p.k||1!==i[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",s)),(i[17].p.k||0!==i[17].p.v||i[18].p.k||1!==i[18].p.v||i[19].p.k||1!==i[19].p.v||i[20].p.k||0!==i[20].p.v||i[21].p.k||1!==i[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",s)),(i[24].p.k||0!==i[24].p.v||i[25].p.k||1!==i[25].p.v||i[26].p.k||1!==i[26].p.v||i[27].p.k||0!==i[27].p.v||i[28].p.k||1!==i[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",s)),(i[31].p.k||0!==i[31].p.v||i[32].p.k||1!==i[32].p.v||i[33].p.k||1!==i[33].p.v||i[34].p.k||0!==i[34].p.v||i[35].p.k||1!==i[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",s)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(s.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(s)),(i[3].p.k||0!==i[3].p.v||i[4].p.k||1!==i[4].p.v||i[5].p.k||1!==i[5].p.v||i[6].p.k||0!==i[6].p.v||i[7].p.k||1!==i[7].p.v)&&((s=createNS("feComponentTransfer")).setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("result",n),e.appendChild(s),this.feFuncRComposed=this.createFeFunc("feFuncR",s),this.feFuncGComposed=this.createFeFunc("feFuncG",s),this.feFuncBComposed=this.createFeFunc("feFuncB",s))}function SVGDropShadowEffect(e,t,r,n,i){var s=t.container.globalData.renderConfig.filterSize,a=t.data.fs||s;e.setAttribute("x",a.x||s.x),e.setAttribute("y",a.y||s.y),e.setAttribute("width",a.width||s.width),e.setAttribute("height",a.height||s.height),this.filterManager=t;var o=createNS("feGaussianBlur");o.setAttribute("in","SourceAlpha"),o.setAttribute("result",n+"_drop_shadow_1"),o.setAttribute("stdDeviation","0"),this.feGaussianBlur=o,e.appendChild(o);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",n+"_drop_shadow_1"),l.setAttribute("result",n+"_drop_shadow_2"),this.feOffset=l,e.appendChild(l);var c=createNS("feFlood");c.setAttribute("flood-color","#00ff00"),c.setAttribute("flood-opacity","1"),c.setAttribute("result",n+"_drop_shadow_3"),this.feFlood=c,e.appendChild(c);var h=createNS("feComposite");h.setAttribute("in",n+"_drop_shadow_3"),h.setAttribute("in2",n+"_drop_shadow_2"),h.setAttribute("operator","in"),h.setAttribute("result",n+"_drop_shadow_4"),e.appendChild(h);var d=this.createMergeNode(n,[n+"_drop_shadow_4",i]);e.appendChild(d)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+n+" 0"),this.matrixFilter.setAttribute("values",r[0]-t[0]+" 0 0 0 "+t[0]+" "+(r[1]-t[1])+" 0 0 0 "+t[1]+" "+(r[2]-t[2])+" 0 0 0 "+t[2]+" 0 0 0 1 0")}},SVGFillFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+t[0]+" 0 0 0 0 "+t[1]+" 0 0 0 0 "+t[2]+" 0 0 0 "+r+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var e,t,r,n,i=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(n=this.elem.maskManager.masksProperties.length,r=0):n=1+(r=this.filterManager.effectElements[0].p.v-1),(t=createNS("g")).setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1);r<n;r+=1)e=createNS("path"),t.appendChild(e),this.paths.push({p:e,m:r});if(3===this.filterManager.effectElements[10].p.v){var s=createNS("mask"),a=createElementID();s.setAttribute("id",a),s.setAttribute("mask-type","alpha"),s.appendChild(t),this.elem.globalData.defs.appendChild(s);var o=createNS("g");for(o.setAttribute("mask","url("+getLocationHref()+"#"+a+")");i[0];)o.appendChild(i[0]);this.elem.layerElement.appendChild(o),this.masker=s,t.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(i=this.elem.layerElement.children||this.elem.layerElement.childNodes;i.length;)this.elem.layerElement.removeChild(i[0]);this.elem.layerElement.appendChild(t),this.elem.layerElement.removeAttribute("mask"),t.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=t},SVGStrokeEffect.prototype.renderFrame=function(e){var t;this.initialized||this.initialize();var r,n,i=this.paths.length;for(t=0;t<i;t+=1)if(-1!==this.paths[t].m&&(r=this.elem.maskManager.viewData[this.paths[t].m],n=this.paths[t].p,(e||this.filterManager._mdf||r.prop._mdf)&&n.setAttribute("d",r.lastPath),e||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var s;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var a=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),o=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),l=n.getTotalLength();s="0 0 0 "+l*a+" ";var c,h=l*(o-a),d=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,u=Math.floor(h/d);for(c=0;c<u;c+=1)s+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";s+="0 "+10*l+" 0 0"}else s="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;n.setAttribute("stroke-dasharray",s)}if((e||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(e||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(e||this.filterManager.effectElements[3].p._mdf)){var p=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*p[0])+","+bmFloor(255*p[1])+","+bmFloor(255*p[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v,i=n[0]+" "+r[0]+" "+t[0],s=n[1]+" "+r[1]+" "+t[1],a=n[2]+" "+r[2]+" "+t[2];this.feFuncR.setAttribute("tableValues",i),this.feFuncG.setAttribute("tableValues",s),this.feFuncB.setAttribute("tableValues",a)}},SVGProLevelsFilter.prototype.createFeFunc=function(e,t){var r=createNS(e);return r.setAttribute("type","table"),t.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(e,t,r,n,i){for(var s,a,o=0,l=Math.min(e,t),c=Math.max(e,t),h=Array.call(null,{length:256}),d=0,u=i-n,p=t-e;o<=256;)a=(s=o/256)<=l?p<0?i:n:s>=c?p<0?n:i:n+u*Math.pow((s-e)/p,1/r),h[d]=a,d+=1,o+=256/255;return h.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,r=this.filterManager.effectElements;this.feFuncRComposed&&(e||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(t=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(t=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(t=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(t=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(t=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",t))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*t[0]),Math.round(255*t[1]),Math.round(255*t[2])))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,n=(this.filterManager.effectElements[2].p.v-90)*degToRads,i=r*Math.cos(n),s=r*Math.sin(n);this.feOffset.setAttribute("dx",i),this.feOffset.setAttribute("dy",s)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,r){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=r,r.matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGGaussianBlurEffect(e,t,r,n){e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width","300%"),e.setAttribute("height","300%"),this.filterManager=t;var i=createNS("feGaussianBlur");i.setAttribute("result",n),e.appendChild(i),this.feGaussianBlur=i}return SVGMatte3Effect.prototype.findSymbol=function(e){for(var t=0,r=_svgMatteSymbols.length;t<r;){if(_svgMatteSymbols[t]===e)return _svgMatteSymbols[t];t+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(e,t){var r=e.layerElement.parentNode;if(r){for(var n,i=r.children,s=0,a=i.length;s<a&&i[s]!==e.layerElement;)s+=1;s<=a-2&&(n=i[s+1]);var o=createNS("use");o.setAttribute("href","#"+t),n?r.insertBefore(o,n):r.appendChild(o)}},SVGMatte3Effect.prototype.setElementAsMask=function(e,t){if(!this.findSymbol(t)){var r=createElementID(),n=createNS("mask");n.setAttribute("id",t.layerId),n.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(t);var i=e.globalData.defs;i.appendChild(n);var s=createNS("symbol");s.setAttribute("id",r),this.replaceInParent(t,r),s.appendChild(t.layerElement),i.appendChild(s);var a=createNS("use");a.setAttribute("href","#"+r),n.appendChild(a),t.data.hd=!1,t.show()}e.setMatte(t.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var e=this.filterManager.effectElements[0].p.v,t=this.elem.comp.elements,r=0,n=t.length;r<n;)t[r]&&t[r].data.ind===e&&this.setElementAsMask(this.elem,t[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGGaussianBlurEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=3==r?0:t,i=2==r?0:t;this.feGaussianBlur.setAttribute("stdDeviation",n+" "+i);var s=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",s)}},registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect(20,SVGTintFilter,!0),registerEffect(21,SVGFillFilter,!0),registerEffect(22,SVGStrokeEffect,!1),registerEffect(23,SVGTritoneFilter,!0),registerEffect(24,SVGProLevelsFilter,!0),registerEffect(25,SVGDropShadowEffect,!0),registerEffect(28,SVGMatte3Effect,!1),registerEffect(29,SVGGaussianBlurEffect,!0),lottie},module.exports=factory())})(lottie$1,lottie$1.exports);var lottie=lottie$1.exports,v="5.7.4",fr=24,ip=0,op=24,w=1080,h=1080,nm="Loading animation",ddd=0,assets=[{id:"comp_0",layers:[{ddd:0,ind:1,ty:1,nm:"Light Gray Solid 1",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[540,541.688,0],ix:2,l:2},a:{a:0,k:[540,540,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,hasMask:!0,masksProperties:[{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:25,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[364.9,189.65],[296.6,189.65],[295.9,190.35],[295.9,455.55],[296.6,456.25],[364.9,456.25],[365.6,455.55],[365.6,190.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:34.417,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[364.9,249.65],[296.6,249.65],[295.9,250.35],[295.9,515.55],[296.6,516.25],[364.9,516.25],[365.6,515.55],[365.6,250.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:119.167,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[364.9,249.65],[296.6,249.65],[295.9,250.35],[295.9,515.55],[296.6,516.25],[364.9,516.25],[365.6,515.55],[365.6,250.35]],c:!0}]},{t:128.5830078125,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[364.9,189.65],[296.6,189.65],[295.9,190.35],[295.9,455.55],[296.6,456.25],[364.9,456.25],[365.6,455.55],[365.6,190.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 1"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:28.767,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[504.4,189.65],[436.1,189.65],[435.4,190.35],[435.4,581.05],[436.1,581.75],[504.4,581.75],[505.1,581.05],[505.1,190.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:38.184,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[504.4,124.087],[436.1,124.087],[435.4,124.788],[435.4,515.487],[436.1,516.188],[504.4,516.188],[505.1,515.487],[505.1,124.788]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:122.934,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[504.4,124.087],[436.1,124.087],[435.4,124.788],[435.4,515.487],[436.1,516.188],[504.4,516.188],[505.1,515.487],[505.1,124.788]],c:!0}]},{t:132.349609375,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[504.4,189.65],[436.1,189.65],[435.4,190.35],[435.4,581.05],[436.1,581.75],[504.4,581.75],[505.1,581.05],[505.1,190.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 2"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:34.417,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[643.9,189.65],[575.6,189.65],[574.9,190.35],[574.9,455.55],[575.6,456.25],[643.9,456.25],[644.6,455.55],[644.6,190.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:43.833,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[643.9,250.4],[575.6,250.4],[574.9,251.1],[574.9,516.3],[575.6,517],[643.9,517],[644.6,516.3],[644.6,251.1]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:128.583,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[643.9,250.4],[575.6,250.4],[574.9,251.1],[574.9,516.3],[575.6,517],[643.9,517],[644.6,516.3],[644.6,251.1]],c:!0}]},{t:138,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4]],v:[[643.9,189.65],[575.6,189.65],[574.9,190.35],[574.9,455.55],[575.6,456.25],[643.9,456.25],[644.6,455.55],[644.6,190.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 3"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:41.95,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[.1,-.4]],v:[[783.3,189.65],[715,189.65],[714.3,190.35],[714.3,455.55],[715,456.25],[783.3,456.25],[784,455.55],[784,190.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:51.366,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[.1,-.4]],v:[[783.3,250.025],[715,250.025],[714.3,250.725],[714.3,515.925],[715,516.625],[783.3,516.625],[784,515.925],[784,250.725]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:119.167,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[.1,-.4]],v:[[783.3,250.025],[715,250.025],[714.3,250.725],[714.3,515.925],[715,516.625],[783.3,516.625],[784,515.925],[784,250.725]],c:!0}]},{t:128.5830078125,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[.1,-.4]],v:[[783.3,189.65],[715,189.65],[714.3,190.35],[714.3,455.55],[715,456.25],[783.3,456.25],[784,455.55],[784,190.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 4"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:38.184,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.3]],v:[[643.9,623.65],[575.6,623.65],[574.9,624.35],[574.9,889.55],[575.6,890.25],[643.9,890.25],[644.6,889.55],[644.6,624.35]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:47.6,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.3]],v:[[643.9,559.963],[575.6,559.963],[574.9,560.662],[574.9,825.862],[575.6,826.562],[643.9,826.562],[644.6,825.862],[644.6,560.662]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:122.934,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.3]],v:[[643.9,559.963],[575.6,559.963],[574.9,560.662],[574.9,825.862],[575.6,826.562],[643.9,826.562],[644.6,825.862],[644.6,560.662]],c:!0}]},{t:132.349609375,s:[{i:[[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4],[0,0]],o:[[0,0],[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.3]],v:[[643.9,623.65],[575.6,623.65],[574.9,624.35],[574.9,889.55],[575.6,890.25],[643.9,890.25],[644.6,889.55],[644.6,624.35]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 5"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:38.184,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4]],v:[[715,890.35],[783.3,890.35],[784,889.65],[784,498.85],[783.3,498.15],[715,498.15],[714.3,498.85],[714.3,889.55]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:47.6,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4]],v:[[715,952.225],[783.3,952.225],[784,951.525],[784,560.725],[783.3,560.025],[715,560.025],[714.3,560.725],[714.3,951.425]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:122.934,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4]],v:[[715,952.225],[783.3,952.225],[784,951.525],[784,560.725],[783.3,560.025],[715,560.025],[714.3,560.725],[714.3,951.425]],c:!0}]},{t:132.349609375,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.4]],v:[[715,890.35],[783.3,890.35],[784,889.65],[784,498.85],[783.3,498.15],[715,498.15],[714.3,498.85],[714.3,889.55]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 6"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:34.417,s:[{i:[[-.3,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[436,890.35],[504.3,890.35],[505,889.65],[505,624.45],[504.3,623.75],[436,623.75],[435.3,624.45],[435.3,889.65]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:43.833,s:[{i:[[-.3,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[436,826.85],[504.3,826.85],[505,826.15],[505,560.95],[504.3,560.25],[436,560.25],[435.3,560.95],[435.3,826.15]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:119.167,s:[{i:[[-.3,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[436,826.85],[504.3,826.85],[505,826.15],[505,560.95],[504.3,560.25],[436,560.25],[435.3,560.95],[435.3,826.15]],c:!0}]},{t:128.5830078125,s:[{i:[[-.3,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[436,890.35],[504.3,890.35],[505,889.65],[505,624.45],[504.3,623.75],[436,623.75],[435.3,624.45],[435.3,889.65]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 7"},{inv:!1,mode:"f",pt:{a:1,k:[{i:{x:.667,y:1},o:{x:.333,y:0},t:28.767,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[296.6,890.35],[364.9,890.35],[365.6,889.65],[365.6,624.45],[364.9,623.75],[296.6,623.75],[295.9,624.45],[295.9,889.65]],c:!0}]},{i:{x:.667,y:1},o:{x:.167,y:0},t:38.184,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[296.6,826.538],[364.9,826.538],[365.6,825.838],[365.6,560.638],[364.9,559.938],[296.6,559.938],[295.9,560.638],[295.9,825.838]],c:!0}]},{i:{x:.667,y:1},o:{x:.333,y:0},t:122.934,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[296.6,826.538],[364.9,826.538],[365.6,825.838],[365.6,560.638],[364.9,559.938],[296.6,559.938],[295.9,560.638],[295.9,825.838]],c:!0}]},{t:132.349609375,s:[{i:[[-.4,0],[0,0],[0,.4],[0,0],[.4,0],[0,0],[0,-.4],[0,0]],o:[[0,0],[.4,0],[0,0],[0,-.4],[0,0],[-.4,0],[0,0],[0,.3]],v:[[296.6,890.35],[364.9,890.35],[365.6,889.65],[365.6,624.45],[364.9,623.75],[296.6,623.75],[295.9,624.45],[295.9,889.65]],c:!0}]}],ix:1},o:{a:0,k:100,ix:3},x:{a:0,k:0,ix:4},nm:"Mask 8"}],sw:1080,sh:1080,sc:"#d8d8d8",ip:0,op:169,st:0,bm:0}]}],layers=[{ddd:0,ind:1,ty:0,nm:"LogoTestAnim",refId:"comp_0",sr:.14201183431953,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[540,540,0],ix:2,l:2},a:{a:0,k:[540,540,0],ix:1,l:2},s:{a:0,k:[100,100,100],ix:6,l:2}},ao:0,w:1080,h:1080,ip:0,op:24,st:0,bm:0}],markers=[],animationData={v:v,fr:fr,ip:ip,op:op,w:w,h:h,nm:nm,ddd:ddd,assets:assets,layers:layers,markers:markers},WebsocketState;class ArcwareLogoLoader{constructor(){this.arcwareLogoLoader=this.createArcwareLogoLoader()}createArcwareLogoLoader(){var e;const t=document.createElement("div");return null===(e=null==t?void 0:t.classList)||void 0===e||e.add("arcware-logo-loader"),t&&(lottie.destroy(),lottie.loadAnimation({container:t,animationData:animationData})),t}}class MicrophoneOverlay{constructor(e){this.overlay=null,this.stream=e,this.micIcon=new MicIcon,this.parentElement=null==e?void 0:e.videoElementParent}createOverlay(){var e,t;if(this.parentElement){this.overlay&&(this.parentElement.removeChild(this.overlay),this.overlay=null),this.overlay=document.createElement("div"),this.overlay.id="microphoneOverlay",null===(t=null===(e=this.overlay)||void 0===e?void 0:e.classList)||void 0===t||t.add("hiddenState"),this.overlay.appendChild(this.micIcon.micIconUnmuted),this.overlay.appendChild(this.micIcon.micIconMuted),this.micIcon.micIconMuted.style.display="none";const r=document.createElement("div");r.className="title",r.textContent="Enabling microphone...";const n=document.createElement("p");n.textContent="Please check your browser's prompt to allow microphone access. You may also need to re-enable the sound.",this.overlay.appendChild(r),this.overlay.appendChild(n),this.parentElement.appendChild(this.overlay)}}toggleMessage(e){if(this.parentElement&&this.overlay){const t=this.overlay.querySelector(".title"),r=this.overlay.querySelector("p");this.micIcon.micIconMuted.style.display=e?"none":"block",this.micIcon.micIconUnmuted.style.display=e?"block":"none",t&&(t.textContent=e?"Enabling microphone":"Disabling microphone"),r&&(r.textContent=e?"Please check your browser's prompt to allow microphone access. You may also need to re-enable the sound.":"Please wait. You may need to re-enable the sound.")}}toggleVisibility(e){var t,r,n,i,s,a,o,l,c,h,d,u,p;if(this.parentElement){const f=null===(t=null==this?void 0:this.parentElement)||void 0===t?void 0:t.querySelector("#infoOverlay"),m=null===(r=null==this?void 0:this.parentElement)||void 0===r?void 0:r.querySelector("#disconnectOverlay"),g=null===(n=null==this?void 0:this.parentElement)||void 0===n?void 0:n.querySelector("#errorOverlay"),y="mic-overlay-is-visible";this.overlay&&f&&m&&g&&(e?(null===(i=null==f?void 0:f.classList)||void 0===i||i.add(y),null===(s=null==m?void 0:m.classList)||void 0===s||s.add(y),null===(a=null==g?void 0:g.classList)||void 0===a||a.add(y),null===(l=null===(o=null==this?void 0:this.overlay)||void 0===o?void 0:o.classList)||void 0===l||l.remove("hiddenState")):(null===(h=null===(c=null==this?void 0:this.overlay)||void 0===c?void 0:c.classList)||void 0===h||h.add("hiddenState"),null===(d=null==f?void 0:f.classList)||void 0===d||d.remove(y),null===(u=null==m?void 0:m.classList)||void 0===u||u.remove(y),null===(p=null==g?void 0:g.classList)||void 0===p||p.remove(y)))}}}!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(WebsocketState||(WebsocketState={}));class ConnectionIdentifier{static get Instance(){return this.instance||(this.instance=new ConnectionIdentifier),this.instance}get WebsocketStates(){return this.aps.map((e=>e.websocketState))}constructor(){this.aps=[],this.enabled=!0}register(e){var t;this.aps.includes(e)||(this.aps.push(e),(null===(t=e.config.settings)||void 0===t?void 0:t.connectionIdentifierLoggingDisabled)&&this.disable()),this.interval||(this.interval=setInterval(this.connectionWatcher.bind(this),1e4))}GetWebSocketStates(){return this.aps.map((e=>e.websocketState))}ActiveInstances(){return this.GetWebSocketStates().filter((e=>e<=WebsocketState.OPEN)).length}disable(){this.enabled=!1}connectionWatcher(){if(!this.enabled)return;const e=this.GetWebSocketStates().filter((e=>e<=WebsocketState.OPEN));1===e.length?console.log("PixelStreaming Instance is connected."):0!==e.length&&console.warn(`${e.length} PixelStreaming Instances are connected!`)}}class ArcwarePixelStreaming extends jt{get WebsocketStates(){return ConnectionIdentifier.Instance.GetWebSocketStates()}get ActiveInstances(){return ConnectionIdentifier.Instance.ActiveInstances}get websocketState(){var e;return null===(e=this.webSocketController.webSocket)||void 0===e?void 0:e.readyState}constructor(e,t){ApplyUrlHack(),super(e,t),this.loveLettersQueue=[],this.isProcessingQueue=!1,this.queueHandler=new EventHandler,this.errorHandler=new EventHandler,this.loveLetterHandler=new EventHandler,this.sessionIdHandler=new EventHandler,this.videoInitializedHandler=new EventHandler,this.websocketOnCloseHandler=new EventHandler,this.config=e,this.webRtcController=this._webRtcController,this.loveLettersList=[],this.microphoneOverlay=new MicrophoneOverlay(this),this.wrapWebSocketOnCloseHandler(),this.handleResolutionChange=this.handleResolutionChange.bind(this),this.addMessageHandler("letter",ZLoveLetter,this.onLoveLetter),this.addMessageHandler("streamInfo",ZStreamInfo,this.onStreamInfo),this.addMessageHandler("sessionId",ZSessionId,this.onSessionId),this.addMessageHandler("error",ZErrorMessage,this.onError),this.addMessageHandler("ping",ZPing,this.onPing),this.addMessageHandler("queue",ZQueue,this.onQueue),this.addMessageHandler("version",ZVersion,this.onVersion);const r=lodash.exports.debounce((()=>{this.handleResolutionChange()}),500);this.addEventListener("videoInitialized",this.onVideoInitialized.bind(this)),this.addEventListener("statsReceived",(e=>{this.sendStats(e.data.aggregatedStats)})),window.addEventListener("resize",r),this.webRtcController.streamMessageController.registerMessageHandler(0,"TextboxEntry",(e=>{console.error("Incomplete handler: ToStreamer.TextboxEntry",e)})),this.initLoveLettersContainer(),this.createMicrophoneOverlay(),this.config.settings.errorHandler&&this.errorHandler.add(this.config.settings.errorHandler),this.config.settings.queueHandler&&this.queueHandler.add(this.config.settings.queueHandler),this.config.settings.sessionIdHandler&&this.sessionIdHandler.add(this.config.settings.sessionIdHandler),this.config.settings.loveLetterHandler&&this.loveLetterHandler.add(this.config.settings.loveLetterHandler),ConnectionIdentifier.Instance.register(this),this.removeXRIconIfDisabled(),this.handleMouseLock()}get session(){return this.config.session}onVersion(e){this.send({type:"version",version:this.config.VERSION})}onPing(e){var t,r;this.config.isFlagEnabled("HoveringMouse")!==!(null===(r=null===(t=null==this?void 0:this.streamInfo)||void 0===t?void 0:t.streamInfo.meta)||void 0===r?void 0:r.mouseLock)&&this.handleMouseLock(),this.session.current&&this.session.set(this.session.current)}onStreamInfo(e){var t,r,n,i;if(Vt.Info(Vt.GetStackTrace(),"StreamInfo received."),this.streamInfo=e,!(null===(r=null===(t=this.config)||void 0===t?void 0:t.settings)||void 0===r?void 0:r["do-not-eval-streamInfo"])){const{afk:t}=e.streamInfo;if(t){this.config.setFlagEnabled(Ot.AFKDetection,t.enabled),this.config.setNumericSetting($t.AFKTimeoutSecs,t.warn+t.error);const{afkController:e}=this.webRtcController;e.closeTimeout=t.action}(null===(n=e.streamInfo.webSdkSettings)||void 0===n?void 0:n.init)&&this.config.setSettings(e.streamInfo.webSdkSettings.init),(null===(i=e.streamInfo.webSdkSettings)||void 0===i?void 0:i.conf)&&Object.entries(e.streamInfo.webSdkSettings.conf).forEach((([e,t])=>{const r=e;this.config.settings[r]=t,"connectionIdentifierLoggingDisabled"===e&&!0===t&&ConnectionIdentifier.Instance.disable()}))}this.handleMouseLock(),this.injectCustomUI()}onQueue(e){Vt.Info(Vt.GetStackTrace(),"QueueInfo received."),EventHandler.Emit(this.queueHandler,e)}onError(e){Vt.Error(Vt.GetStackTrace(),e.type),EventHandler.Emit(this.errorHandler,e)}onLoveLetter(e){this.config.settings.loveLetterLogging&&console.info(e.reason),EventHandler.Emit(this.loveLetterHandler,e),this.pushLetter(e.reason)}onSessionId(e){Vt.Info(Vt.GetStackTrace(),e.sessionId),this.session.set(e.sessionId),EventHandler.Emit(this.sessionIdHandler,e.sessionId)}onVideoInitialized(){this.handleMouseLock(),this.send({type:"onVideoInitialized"}),EventHandler.Emit(this.videoInitializedHandler,void 0),this.handleResolutionChange(),this.handleRemoveLoveLetters(),this.microphoneOverlay.toggleVisibility(!1),this.applyResolutionIfPlaying(),this.removeXRIconIfDisabled()}addMessageHandler(e,t,r){this.webSocketController.signallingProtocol.addMessageHandler(e,(n=>{const i=t.safeParse(JSON.parse(n));if(i.success)r.call(this,i.data);else{const t=new Error(`Unexpected message content. Event:'${e}', ZodError: ${i.error.message}`);Vt.Error(t.stack,t.message)}}))}sendStats(e){const t={type:"stats",stats:Stats(e)};this.send(t)}send(e){if(Send[e.type]){const t=Send[e.type].safeParse(e);if(t.success)this.webSocketController.webSocket.send(JSON.stringify(t.data));else{const e=t;Vt.Error(Vt.GetStackTrace(),`Failed to send. ${e.error}`)}}else this.webSocketController.webSocket.send(JSON.stringify(e))}handleResolutionChange(){var e,t,r,n,i,s,a,o,l,c,h;if(!(null==this?void 0:this.streamInfo)||!(null==this?void 0:this.webRtcController)||!(null===(t=null===(e=null==this?void 0:this.webRtcController)||void 0===e?void 0:e.videoPlayer)||void 0===t?void 0:t.getVideoElement()))return;const d=null===(n=null===(r=null==this?void 0:this.streamInfo)||void 0===r?void 0:r.streamInfo)||void 0===n?void 0:n.resolution,u=null!==(o=null===(a=null===(s=null===(i=null==this?void 0:this.streamInfo)||void 0===i?void 0:i.streamInfo)||void 0===s?void 0:s.meta)||void 0===a?void 0:a.version)&&void 0!==o?o:null===(h=null===(c=null===(l=this.streamInfo)||void 0===l?void 0:l.streamInfo)||void 0===c?void 0:c.meta)||void 0===h?void 0:h.ueVersion;d&&(null==d?void 0:d.dynamic)&&setTimeout((()=>{var e;const{videoPlayer:t}=null==this?void 0:this.webRtcController,r=null==t?void 0:t.getVideoParentElement(),n=null==r?void 0:r.getBoundingClientRect().width,i=null==r?void 0:r.getBoundingClientRect().height,s=null==d?void 0:d.width,a=null==d?void 0:d.height,o=n/i;let l,c;if(o>s/a?(l=s,c=s/o):(c=a,l=a*o),t)if(!u||(null==u?void 0:u.startsWith("4.27"))){const t={Console:`r.setres ${Math.round(l)}x${Math.round(c)}w`};null===(e=null==this?void 0:this.webRtcController)||void 0===e||e.emitUIInteraction(t)}else t.onMatchViewportResolutionCallback(Math.round(l),Math.round(c))}),500)}applyResolutionIfPlaying(){var e;const t=null===(e=null==this?void 0:this.webRtcController)||void 0===e?void 0:e.videoPlayer.getVideoElement();t&&t.addEventListener("playing",(()=>{setTimeout((()=>{null==this||this.handleResolutionChange()}),1500)}))}removePlayer(){var e;null===(e=null==this?void 0:this.webSocketController)||void 0===e||e.close()}handleMouseLock(){var e,t,r;null===(e=null==this?void 0:this.config)||void 0===e||e.modifyInitialSettings(!(null===(r=null===(t=null==this?void 0:this.streamInfo)||void 0===t?void 0:t.streamInfo.meta)||void 0===r?void 0:r.mouseLock))}initLoveLettersContainer(){var e;const t=new ArcwareLogoLoader;if(!this.loveLettersContainer){const r=null===document||void 0===document?void 0:document.createElement("div"),{videoPlayer:n}=null==this?void 0:this.webRtcController,i=n.getVideoParentElement();null===(e=null==r?void 0:r.classList)||void 0===e||e.add("love-letters-box-root"),null==i||i.appendChild(r);const s=null===document||void 0===document?void 0:document.createElement("div");s.id="letters-block";const a=null===document||void 0===document?void 0:document.createElement("div");a.id="letters-wrapper",r&&(null==s||s.appendChild(null==t?void 0:t.arcwareLogoLoader),null==r||r.appendChild(s),null==s||s.appendChild(a)),s.innerHTML="",s&&(null==s||s.appendChild(null==t?void 0:t.arcwareLogoLoader),null==s||s.appendChild(a))}}pushLetter(e){var t;null===(t=null==this?void 0:this.loveLettersQueue)||void 0===t||t.push(e),this.isProcessingQueue||null==this||this.processLoveLetterQueue()}processLoveLetterQueue(){var e,t;this.isProcessingQueue=!0;const r=this.loveLettersQueue.shift();if(void 0!==r){const n=null==r?void 0:r.replace(/LL: |\.$/g,"");null===(e=null==this?void 0:this.loveLettersList)||void 0===e||e.push(n);const i=new LoveLetters;null==i||i.addLetter(n,null===(t=null==this?void 0:this.loveLettersList)||void 0===t?void 0:t.length),setTimeout((()=>{this.processLoveLetterQueue()}),1e3)}else this.isProcessingQueue=!1}handleRemoveLoveLetters(){const e=null===document||void 0===document?void 0:document.querySelector(".love-letters-box-root");setTimeout((()=>{var t;e&&(null===(t=null==e?void 0:e.classList)||void 0===t||t.add("fade-out"))}),1e3),setTimeout((()=>{var t;e&&(null==e?void 0:e.parentNode)&&(null===(t=null==e?void 0:e.parentNode)||void 0===t||t.removeChild(e))}),1600)}toggleAudio(e,t){var r,n;const{streamController:i}=this.webRtcController;e&&(e.muted=t,i&&(i.audioElement.muted=t,(null==e?void 0:e.currentTime)>0&&!(null==e?void 0:e.paused)&&(null===(r=null==i?void 0:i.audioElement)||void 0===r?void 0:r.paused)&&(null===(n=null==i?void 0:i.audioElement)||void 0===n||n.play())))}createMicrophoneOverlay(){var e;null===(e=null==this?void 0:this.microphoneOverlay)||void 0===e||e.createOverlay()}toggleMic(e,t){var r,n;null===(r=null==this?void 0:this.config)||void 0===r||r.setFlagEnabled(Ot.UseMic,e),t||(null===(n=null==this?void 0:this.microphoneOverlay)||void 0===n||n.toggleMessage(e),setTimeout((()=>{var e;null===(e=null==this?void 0:this.microphoneOverlay)||void 0===e||e.toggleVisibility(!0)}),200),setTimeout((()=>{var e;null===(e=null==this?void 0:this.webRtcController)||void 0===e||e.restartStreamAutomatically()}),1e3))}wrapWebSocketOnCloseHandler(){var e;(null===(e=null==this?void 0:this.webSocketController)||void 0===e?void 0:e.webSocket)&&(this.webSocketController.webSocket.onclose=e=>{var t;null===(t=null==this?void 0:this.webSocketController)||void 0===t||t.handleOnClose(e),EventHandler.Emit(this.websocketOnCloseHandler,e)})}onStreamingStateChange(e){var t,r,n,i,s,a;const o=null===(r=null===(t=null==this?void 0:this.webRtcController)||void 0===t?void 0:t.videoPlayer)||void 0===r?void 0:r.getVideoElement();null==o||o.addEventListener("play",(()=>e(!0))),null==o||o.addEventListener("pause",(()=>e(!1))),null==o||o.addEventListener("ended",(()=>e(!1)));const l=null===(i=null===(n=null==this?void 0:this.webSocketController)||void 0===n?void 0:n.webSocket)||void 0===i?void 0:i.onopen;this.webSocketController.webSocket.onopen=t=>{var r;null==l||l.call(null===(r=null==this?void 0:this.webSocketController)||void 0===r?void 0:r.webSocket,t),e(!0)};const c=null===(a=null===(s=null==this?void 0:this.webSocketController)||void 0===s?void 0:s.webSocket)||void 0===a?void 0:a.onclose;this.webSocketController.webSocket.onclose=t=>{var r;null==c||c.call(null===(r=null==this?void 0:this.webSocketController)||void 0===r?void 0:r.webSocket,t),e(!1)}}removeXRIconIfDisabled(){var e,t,r,n,i;if(!(null===(t=null===(e=null==this?void 0:this.config)||void 0===e?void 0:e.initialSettings)||void 0===t?void 0:t.XRControllerInput)&&(null===(r=null==this?void 0:this.config)||void 0===r||r.setFlagEnabled(Ot.XRControllerInput,!1),this.videoElementParent&&(null===(n=null==this?void 0:this.videoElementParent)||void 0===n?void 0:n.parentElement))){const e=null===(i=null==this?void 0:this.videoElementParent)||void 0===i?void 0:i.parentElement.querySelector("#xrBtn");null==e||e.remove()}}injectCustomUI(){var e;const t=null===document||void 0===document?void 0:document.getElementById("stream-ui");null==t||t.addEventListener("touchmove",(e=>{e.stopPropagation()}));const r=null===(e=null==this?void 0:this.videoElementParent)||void 0===e?void 0:e.parentElement;t&&r&&(null==r||r.appendChild(t))}}var $=_export,assign=objectAssign;function ArcwareInit({shareId:e,projectId:t},r){if(e&&!e.startsWith("share-"))throw new Error(`Unexpected shareId-format: '${e}'.`);const n=new ArcwareConfig({useUrlParams:!0===(null==r?void 0:r.useUrlParams),initialSettings:Object.assign({ss:DefaultUrl,AutoConnect:!1,StartVideoMuted:!0,AutoPlayVideo:!0,KeyboardInput:!0,MouseInput:!0,GamepadInput:!1,TouchInput:!0,XRControllerInput:!1,UseMic:!0,SuppressBrowserKeys:!0,AFKTimeout:void 0,ControlsQuality:void 0,FakeMouseWithTouches:!1,ForceMonoAudio:!1,ForceTURN:void 0,HoveringMouse:!0,MatchViewportRes:void 0,MaxQP:void 0,MinQP:void 0,OfferToReceive:void 0,PreferredCodec:void 0,preferSFU:void 0,StreamerId:void 0,TimeoutIfIdle:void 0,WebRTCFPS:void 0,WebRTCMaxBitrate:void 0,WebRTCMinBitrate:void 0},null==r?void 0:r.initialSettings),settings:Object.assign({shareId:e,projectId:t,token:void 0,session:void 0,fullscreenButton:!0,audioButton:!0,stopButton:!1,infoButton:!1,micButton:!1,settingsButton:!1,connectionStrengthIcon:!1,connectionIdentifierLoggingDisabled:void 0,errorHandler:void 0,loveLetterHandler:void 0,loveLetterLogging:void 0,queueHandler:void 0,sessionIdHandler:void 0},null==r?void 0:r.settings)}),i=new ArcwarePixelStreaming(n);return{Config:n,PixelStreaming:i,Application:new ArcwareApplication({stream:i})}}$({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign},{assign:assign}),exports.AFKOverlay=q,exports.ActionOverlay=V,exports.AfkLogic=Ct,exports.AfkTimedOutEvent=ft,exports.AfkWarningActivateEvent=Tt,exports.AfkWarningDeactivateEvent=Et,exports.AfkWarningUpdateEvent=yt,exports.AggregatedStats=bt,exports.Application=G,exports.ArcwareApplication=ArcwareApplication,exports.ArcwareConfig=ArcwareConfig,exports.ArcwareInit=ArcwareInit,exports.ArcwarePixelStreaming=ArcwarePixelStreaming,exports.ArcwareStyles=ArcwareStyles,exports.CandidatePairStats=Mt,exports.CandidateStat=wt,exports.Config=Pt,exports.ConfigUI=J,exports.ConnectOverlay=Y,exports.ControlSchemeType=kt,exports.DataChannelCloseEvent=Rt,exports.DataChannelErrorEvent=Lt,exports.DataChannelOpenEvent=xt,exports.DataChannelStats=At,exports.DefaultUrl=DefaultUrl,exports.DisconnectOverlay=K,exports.EncoderSettings=Ft,exports.ErrorOverlay=$$9,exports.EventEmitter=Dt,exports.Flags=Ot,exports.HideFreezeFrameEvent=Ut,exports.InboundAudioStats=It,exports.InboundVideoStats=Gt,exports.InfoOverlay=tt,exports.InitialSettings=zt,exports.InitialSettingsEvent=Bt,exports.LatencyTestResultEvent=_t,exports.LatencyTestResults=Wt,exports.LoadFreezeFrameEvent=Ht,exports.Logger=Vt,exports.MessageRecv=Nt,exports.MessageSend=Kt,exports.MessageStreamerList=Qt,exports.NumericParameters=$t,exports.OptionParameters=qt,exports.OutBoundVideoStats=Xt,exports.OverlayBase=et,exports.PixelStreaming=jt,exports.PixelStreamingApplicationStyle=st,exports.PlayOverlay=it,exports.PlayStreamErrorEvent=Yt,exports.PlayStreamEvent=Jt,exports.PlayStreamRejectedEvent=Zt,exports.SettingBase=es,exports.SettingFlag=ts,exports.SettingNumber=ss,exports.SettingOption=ns$1,exports.SettingText=rs,exports.SettingUIBase=nt,exports.SettingUIFlag=ot,exports.SettingUINumber=lt,exports.SettingUIOption=at,exports.SettingUIText=rt,exports.SettingsChangedEvent=is,exports.SignallingProtocol=os,exports.StatsReceivedEvent=as,exports.StreamLoadingEvent=ds,exports.StreamerListMessageEvent=ls,exports.TextOverlay=ct,exports.TextParameters=cs,exports.UnquantizedAndDenormalizeUnsigned=hs,exports.VideoEncoderAvgQPEvent=gs,exports.VideoInitializedEvent=us,exports.WebRTCSettings=ms,exports.WebRtcAutoConnectEvent=Ss,exports.WebRtcConnectedEvent=ps,exports.WebRtcConnectingEvent=vs,exports.WebRtcDisconnectedEvent=Cs,exports.WebRtcFailedEvent=fs,exports.WebRtcPlayerController=Ts,exports.WebRtcSdpEvent=Es,exports.WebSocketController=ys,exports.WebXRController=bs,exports.XrFrameEvent=Ms,exports.XrSessionEndedEvent=ws,exports.XrSessionStartedEvent=Ps;
|