easyproctor-hml 0.0.21 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- "use strict";(()=>{var Xd=Object.create;var Kc=Object.defineProperty;var Kd=Object.getOwnPropertyDescriptor;var Wd=Object.getOwnPropertyNames;var Yd=Object.getPrototypeOf,$d=Object.prototype.hasOwnProperty;var Wc=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Zd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Wd(e))!$d.call(t,i)&&i!==r&&Kc(t,i,{get:()=>e[i],enumerable:!(n=Kd(e,i))||n.enumerable});return t};var Qd=(t,e,r)=>(r=t!=null?Xd(Yd(t)):{},Zd(e||!t||!t.__esModule?Kc(r,"default",{value:t,enumerable:!0}):r,t));var i1=Wc((Wm,n1)=>{n1.exports=typeof self=="object"?self.FormData:window.FormData});var kf=Wc((gc,bc)=>{"use strict";(function(t,e){typeof gc=="object"&&typeof bc<"u"?bc.exports=e():typeof define=="function"&&define.amd?define(e):t.MicRecorder=e()})(gc,function(){function t(C){return new Int8Array(C)}function e(C){return new Int16Array(C)}function r(C){return new Int32Array(C)}function n(C){return new Float32Array(C)}function i(C){return new Float64Array(C)}function a(C){if(C.length==1)return n(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(a(C));return ie}function s(C){if(C.length==1)return r(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(s(C));return ie}function v(C){if(C.length==1)return e(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(v(C));return ie}function d(C){if(C.length==1)return new Array(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(d(C));return ie}var p={};p.fill=function(C,$,ie,Z){if(arguments.length==2)for(var ye=0;ye<C.length;ye++)C[ye]=arguments[1];else for(var ye=$;ye<ie;ye++)C[ye]=Z};var B={};B.arraycopy=function(C,$,ie,Z,ye){for(var Q=$+ye;$<Q;)ie[Z++]=C[$++]};var z={};z.SQRT2=1.4142135623730951,z.FAST_LOG10=function(C){return Math.log10(C)},z.FAST_LOG10_X=function(C,$){return Math.log10(C)*$};function ee(C){this.ordinal=C}ee.short_block_allowed=new ee(0),ee.short_block_coupled=new ee(1),ee.short_block_dispensed=new ee(2),ee.short_block_forced=new ee(3);var te={};te.MAX_VALUE=34028235e31;function D(C){this.ordinal=C}D.vbr_off=new D(0),D.vbr_mt=new D(1),D.vbr_rh=new D(2),D.vbr_abr=new D(3),D.vbr_mtrh=new D(4),D.vbr_default=D.vbr_mtrh;var ce=function(C){},P={System:B,VbrMode:D,Float:te,ShortBlock:ee,Util:z,Arrays:p,new_array_n:d,new_byte:t,new_double:i,new_float:n,new_float_n:a,new_int:r,new_int_n:s,new_short:e,new_short_n:v,assert:ce},oe=P.System,se=P.Util,xe=P.Arrays,Ge=P.new_float;function lt(){var C=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*se.SQRT2*.5/2384e-9,.017876148*se.SQRT2*.5/2384e-9,.003134727*se.SQRT2*.5/2384e-9,.002457142*se.SQRT2*.5/2384e-9,971317e-9*se.SQRT2*.5/2384e-9,218868e-9*se.SQRT2*.5/2384e-9,101566e-9*se.SQRT2*.5/2384e-9,13828e-9*se.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],$=12,ie=36,Z=[[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,940084909404969e-27,6423305872147839e-28,2382191739347918e-28,5456116108943412e-27,4878985199565852e-27,4240448995017367e-27,3559909094758252e-27,2858043359288075e-27,2156177623817898e-27,1475637723558783e-27,8371015190102974e-28,2599706096327376e-28,-5456116108943412e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758252e-27,-2858043359288076e-27,-2156177623817898e-27,-1475637723558783e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347923e-28,-6423305872147843e-28,-9400849094049696e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049694e-28,-642330587214784e-27,-2382191739347918e-28],[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,9400849094049688e-28,6423305872147841e-28,2382191739347918e-28,5456116108943413e-27,4878985199565852e-27,4240448995017367e-27,3559909094758253e-27,2858043359288075e-27,2156177623817898e-27,1475637723558782e-27,8371015190102975e-28,2599706096327376e-28,-5461314069809755e-27,-4921085770524055e-27,-4343405037091838e-27,-3732668368707687e-27,-3093523840190885e-27,-2430835727329465e-27,-1734679010007751e-27,-974825365660928e-27,-2797435120168326e-28,0,0,0,0,0,0,-2283748241799531e-28,-4037858874020686e-28,-2146547464825323e-28],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2283748241799531e-28,4037858874020686e-28,2146547464825323e-28,5461314069809755e-27,4921085770524055e-27,4343405037091838e-27,3732668368707687e-27,3093523840190885e-27,2430835727329466e-27,1734679010007751e-27,974825365660928e-27,2797435120168326e-28,-5456116108943413e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758253e-27,-2858043359288075e-27,-2156177623817898e-27,-1475637723558782e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347913e-28,-6423305872147834e-28,-9400849094049688e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049688e-28,-6423305872147841e-28,-2382191739347918e-28]],ye=Z[T.SHORT_TYPE],Q=Z[T.SHORT_TYPE],me=Z[T.SHORT_TYPE],Ne=Z[T.SHORT_TYPE],ke=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function G(M,K,o){for(var I=10,H=K+238-14-286,O=-15;O<0;O++){var g,_,k;g=C[I+-10],_=M[H+-224]*g,k=M[K+224]*g,g=C[I+-9],_+=M[H+-160]*g,k+=M[K+160]*g,g=C[I+-8],_+=M[H+-96]*g,k+=M[K+96]*g,g=C[I+-7],_+=M[H+-32]*g,k+=M[K+32]*g,g=C[I+-6],_+=M[H+32]*g,k+=M[K+-32]*g,g=C[I+-5],_+=M[H+96]*g,k+=M[K+-96]*g,g=C[I+-4],_+=M[H+160]*g,k+=M[K+-160]*g,g=C[I+-3],_+=M[H+224]*g,k+=M[K+-224]*g,g=C[I+-2],_+=M[K+-256]*g,k-=M[H+256]*g,g=C[I+-1],_+=M[K+-192]*g,k-=M[H+192]*g,g=C[I+0],_+=M[K+-128]*g,k-=M[H+128]*g,g=C[I+1],_+=M[K+-64]*g,k-=M[H+64]*g,g=C[I+2],_+=M[K+0]*g,k-=M[H+0]*g,g=C[I+3],_+=M[K+64]*g,k-=M[H+-64]*g,g=C[I+4],_+=M[K+128]*g,k-=M[H+-128]*g,g=C[I+5],_+=M[K+192]*g,k-=M[H+-192]*g,_*=C[I+6],g=k-_,o[30+O*2]=k+_,o[31+O*2]=C[I+7]*g,I+=18,K--,H++}{var _,k,q,w;k=M[K+-16]*C[I+-10],_=M[K+-32]*C[I+-2],k+=(M[K+-48]-M[K+16])*C[I+-9],_+=M[K+-96]*C[I+-1],k+=(M[K+-80]+M[K+48])*C[I+-8],_+=M[K+-160]*C[I+0],k+=(M[K+-112]-M[K+80])*C[I+-7],_+=M[K+-224]*C[I+1],k+=(M[K+-144]+M[K+112])*C[I+-6],_-=M[K+32]*C[I+2],k+=(M[K+-176]-M[K+144])*C[I+-5],_-=M[K+96]*C[I+3],k+=(M[K+-208]+M[K+176])*C[I+-4],_-=M[K+160]*C[I+4],k+=(M[K+-240]-M[K+208])*C[I+-3],_-=M[K+224],q=_-k,w=_+k,k=o[14],_=o[15]-k,o[31]=w+k,o[30]=q+_,o[15]=q-_,o[14]=w-k}{var c;c=o[28]-o[0],o[0]+=o[28],o[28]=c*C[I+-2*18+7],c=o[29]-o[1],o[1]+=o[29],o[29]=c*C[I+-2*18+7],c=o[26]-o[2],o[2]+=o[26],o[26]=c*C[I+-4*18+7],c=o[27]-o[3],o[3]+=o[27],o[27]=c*C[I+-4*18+7],c=o[24]-o[4],o[4]+=o[24],o[24]=c*C[I+-6*18+7],c=o[25]-o[5],o[5]+=o[25],o[25]=c*C[I+-6*18+7],c=o[22]-o[6],o[6]+=o[22],o[22]=c*se.SQRT2,c=o[23]-o[7],o[7]+=o[23],o[23]=c*se.SQRT2-o[7],o[7]-=o[6],o[22]-=o[7],o[23]-=o[22],c=o[6],o[6]=o[31]-c,o[31]=o[31]+c,c=o[7],o[7]=o[30]-c,o[30]=o[30]+c,c=o[22],o[22]=o[15]-c,o[15]=o[15]+c,c=o[23],o[23]=o[14]-c,o[14]=o[14]+c,c=o[20]-o[8],o[8]+=o[20],o[20]=c*C[I+-10*18+7],c=o[21]-o[9],o[9]+=o[21],o[21]=c*C[I+-10*18+7],c=o[18]-o[10],o[10]+=o[18],o[18]=c*C[I+-12*18+7],c=o[19]-o[11],o[11]+=o[19],o[19]=c*C[I+-12*18+7],c=o[16]-o[12],o[12]+=o[16],o[16]=c*C[I+-14*18+7],c=o[17]-o[13],o[13]+=o[17],o[17]=c*C[I+-14*18+7],c=-o[20]+o[24],o[20]+=o[24],o[24]=c*C[I+-12*18+7],c=-o[21]+o[25],o[21]+=o[25],o[25]=c*C[I+-12*18+7],c=o[4]-o[8],o[4]+=o[8],o[8]=c*C[I+-12*18+7],c=o[5]-o[9],o[5]+=o[9],o[9]=c*C[I+-12*18+7],c=o[0]-o[12],o[0]+=o[12],o[12]=c*C[I+-4*18+7],c=o[1]-o[13],o[1]+=o[13],o[13]=c*C[I+-4*18+7],c=o[16]-o[28],o[16]+=o[28],o[28]=c*C[I+-4*18+7],c=-o[17]+o[29],o[17]+=o[29],o[29]=c*C[I+-4*18+7],c=se.SQRT2*(o[2]-o[10]),o[2]+=o[10],o[10]=c,c=se.SQRT2*(o[3]-o[11]),o[3]+=o[11],o[11]=c,c=se.SQRT2*(-o[18]+o[26]),o[18]+=o[26],o[26]=c-o[18],c=se.SQRT2*(-o[19]+o[27]),o[19]+=o[27],o[27]=c-o[19],c=o[2],o[19]-=o[3],o[3]-=c,o[2]=o[31]-c,o[31]+=c,c=o[3],o[11]-=o[19],o[18]-=c,o[3]=o[30]-c,o[30]+=c,c=o[18],o[27]-=o[11],o[19]-=c,o[18]=o[15]-c,o[15]+=c,c=o[19],o[10]-=c,o[19]=o[14]-c,o[14]+=c,c=o[10],o[11]-=c,o[10]=o[23]-c,o[23]+=c,c=o[11],o[26]-=c,o[11]=o[22]-c,o[22]+=c,c=o[26],o[27]-=c,o[26]=o[7]-c,o[7]+=c,c=o[27],o[27]=o[6]-c,o[6]+=c,c=se.SQRT2*(o[0]-o[4]),o[0]+=o[4],o[4]=c,c=se.SQRT2*(o[1]-o[5]),o[1]+=o[5],o[5]=c,c=se.SQRT2*(o[16]-o[20]),o[16]+=o[20],o[20]=c,c=se.SQRT2*(o[17]-o[21]),o[17]+=o[21],o[21]=c,c=-se.SQRT2*(o[8]-o[12]),o[8]+=o[12],o[12]=c-o[8],c=-se.SQRT2*(o[9]-o[13]),o[9]+=o[13],o[13]=c-o[9],c=-se.SQRT2*(o[25]-o[29]),o[25]+=o[29],o[29]=c-o[25],c=-se.SQRT2*(o[24]+o[28]),o[24]-=o[28],o[28]=c-o[24],c=o[24]-o[16],o[24]=c,c=o[20]-c,o[20]=c,c=o[28]-c,o[28]=c,c=o[25]-o[17],o[25]=c,c=o[21]-c,o[21]=c,c=o[29]-c,o[29]=c,c=o[17]-o[1],o[17]=c,c=o[9]-c,o[9]=c,c=o[25]-c,o[25]=c,c=o[5]-c,o[5]=c,c=o[21]-c,o[21]=c,c=o[13]-c,o[13]=c,c=o[29]-c,o[29]=c,c=o[1]-o[0],o[1]=c,c=o[16]-c,o[16]=c,c=o[17]-c,o[17]=c,c=o[8]-c,o[8]=c,c=o[9]-c,o[9]=c,c=o[24]-c,o[24]=c,c=o[25]-c,o[25]=c,c=o[4]-c,o[4]=c,c=o[5]-c,o[5]=c,c=o[20]-c,o[20]=c,c=o[21]-c,o[21]=c,c=o[12]-c,o[12]=c,c=o[13]-c,o[13]=c,c=o[28]-c,o[28]=c,c=o[29]-c,o[29]=c,c=o[0],o[0]+=o[31],o[31]-=c,c=o[1],o[1]+=o[30],o[30]-=c,c=o[16],o[16]+=o[15],o[15]-=c,c=o[17],o[17]+=o[14],o[14]-=c,c=o[8],o[8]+=o[23],o[23]-=c,c=o[9],o[9]+=o[22],o[22]-=c,c=o[24],o[24]+=o[7],o[7]-=c,c=o[25],o[25]+=o[6],o[6]-=c,c=o[4],o[4]+=o[27],o[27]-=c,c=o[5],o[5]+=o[26],o[26]-=c,c=o[20],o[20]+=o[11],o[11]-=c,c=o[21],o[21]+=o[10],o[10]-=c,c=o[12],o[12]+=o[19],o[19]-=c,c=o[13],o[13]+=o[18],o[18]-=c,c=o[28],o[28]+=o[3],o[3]-=c,c=o[29],o[29]+=o[2],o[2]-=c}}function de(M,K){for(var o=0;o<3;o++){var I,H,O,g,_,k;g=M[K+2*3]*Z[T.SHORT_TYPE][0]-M[K+5*3],I=M[K+0*3]*Z[T.SHORT_TYPE][2]-M[K+3*3],H=g+I,O=g-I,g=M[K+5*3]*Z[T.SHORT_TYPE][0]+M[K+2*3],I=M[K+3*3]*Z[T.SHORT_TYPE][2]+M[K+0*3],_=g+I,k=-g+I,I=(M[K+1*3]*Z[T.SHORT_TYPE][1]-M[K+4*3])*2069978111953089e-26,g=(M[K+4*3]*Z[T.SHORT_TYPE][1]+M[K+1*3])*2069978111953089e-26,M[K+3*0]=H*190752519173728e-25+I,M[K+3*5]=-_*190752519173728e-25+g,O=O*.8660254037844387*1907525191737281e-26,_=_*.5*1907525191737281e-26+g,M[K+3*1]=O-_,M[K+3*2]=O+_,H=H*.5*1907525191737281e-26-I,k=k*.8660254037844387*1907525191737281e-26,M[K+3*3]=H+k,M[K+3*4]=H-k,K++}}function he(M,K,o){var I,H;{var O,g,_,k,q,w,c,L;O=o[17]-o[9],_=o[15]-o[11],k=o[14]-o[12],q=o[0]+o[8],w=o[1]+o[7],c=o[2]+o[6],L=o[3]+o[5],M[K+17]=q+c-L-(w-o[4]),H=(q+c-L)*Q[12+7]+(w-o[4]),I=(O-_-k)*Q[12+6],M[K+5]=I+H,M[K+6]=I-H,g=(o[16]-o[10])*Q[12+6],w=w*Q[12+7]+o[4],I=O*Q[12+0]+g+_*Q[12+1]+k*Q[12+2],H=-q*Q[12+4]+w-c*Q[12+5]+L*Q[12+3],M[K+1]=I+H,M[K+2]=I-H,I=O*Q[12+1]-g-_*Q[12+2]+k*Q[12+0],H=-q*Q[12+5]+w-c*Q[12+3]+L*Q[12+4],M[K+9]=I+H,M[K+10]=I-H,I=O*Q[12+2]-g+_*Q[12+0]-k*Q[12+1],H=q*Q[12+3]-w+c*Q[12+4]-L*Q[12+5],M[K+13]=I+H,M[K+14]=I-H}{var y,u,m,b,l,h,x,E;y=o[8]-o[0],m=o[6]-o[2],b=o[5]-o[3],l=o[17]+o[9],h=o[16]+o[10],x=o[15]+o[11],E=o[14]+o[12],M[K+0]=l+x+E+(h+o[13]),I=(l+x+E)*Q[12+7]-(h+o[13]),H=(y-m+b)*Q[12+6],M[K+11]=I+H,M[K+12]=I-H,u=(o[7]-o[1])*Q[12+6],h=o[13]-h*Q[12+7],I=l*Q[12+3]-h+x*Q[12+4]+E*Q[12+5],H=y*Q[12+2]+u+m*Q[12+0]+b*Q[12+1],M[K+3]=I+H,M[K+4]=I-H,I=-l*Q[12+5]+h-x*Q[12+3]-E*Q[12+4],H=y*Q[12+1]+u-m*Q[12+2]-b*Q[12+0],M[K+7]=I+H,M[K+8]=I-H,I=-l*Q[12+4]+h-x*Q[12+5]-E*Q[12+3],H=y*Q[12+0]-u+m*Q[12+1]-b*Q[12+2],M[K+15]=I+H,M[K+16]=I-H}}this.mdct_sub48=function(M,K,o){for(var I=K,H=286,O=0;O<M.channels_out;O++){for(var g=0;g<M.mode_gr;g++){for(var _,k=M.l3_side.tt[g][O],q=k.xr,w=0,c=M.sb_sample[O][1-g],L=0,y=0;y<18/2;y++)for(G(I,H,c[L]),G(I,H+32,c[L+1]),L+=2,H+=64,_=1;_<32;_+=2)c[L-1][_]*=-1;for(_=0;_<32;_++,w+=18){var u=k.block_type,m=M.sb_sample[O][g],b=M.sb_sample[O][1-g];if(k.mixed_block_flag!=0&&_<2&&(u=0),M.amp_filter[_]<1e-12)xe.fill(q,w+0,w+18,0);else{if(M.amp_filter[_]<1)for(var y=0;y<18;y++)b[y][ke[_]]*=M.amp_filter[_];if(u==T.SHORT_TYPE){for(var y=-$/4;y<0;y++){var l=Z[T.SHORT_TYPE][y+3];q[w+y*3+9]=m[9+y][ke[_]]*l-m[8-y][ke[_]],q[w+y*3+18]=m[14-y][ke[_]]*l+m[15+y][ke[_]],q[w+y*3+10]=m[15+y][ke[_]]*l-m[14-y][ke[_]],q[w+y*3+19]=b[2-y][ke[_]]*l+b[3+y][ke[_]],q[w+y*3+11]=b[3+y][ke[_]]*l-b[2-y][ke[_]],q[w+y*3+20]=b[8-y][ke[_]]*l+b[9+y][ke[_]]}de(q,w)}else{for(var h=Ge(18),y=-ie/4;y<0;y++){var x,E;x=Z[u][y+27]*b[y+9][ke[_]]+Z[u][y+36]*b[8-y][ke[_]],E=Z[u][y+9]*m[y+9][ke[_]]-Z[u][y+18]*m[8-y][ke[_]],h[y+9]=x-E*ye[3+y+9],h[y+18]=x*ye[3+y+9]+E}he(q,w,h)}}if(u!=T.SHORT_TYPE&&_!=0)for(var y=7;y>=0;--y){var X,U;X=q[w+y]*me[20+y]+q[w+-1-y]*Ne[28+y],U=q[w+y]*Ne[28+y]-q[w+-1-y]*me[20+y],q[w+-1-y]=X,q[w+y]=U}}}if(I=o,H=286,M.mode_gr==1)for(var j=0;j<18;j++)oe.arraycopy(M.sb_sample[O][1][j],0,M.sb_sample[O][0][j],0,32)}}}var ft=lt,st=P.System,yt=P.new_float,Xt=P.new_float_n;function tr(){this.l=yt(T.SBMAX_l),this.s=Xt([T.SBMAX_s,3]);var C=this;this.assign=function($){st.arraycopy($.l,0,C.l,0,T.SBMAX_l);for(var ie=0;ie<T.SBMAX_s;ie++)for(var Z=0;Z<3;Z++)C.s[ie][Z]=$.s[ie][Z]}}var sr=tr;function an(){this.thm=new sr,this.en=new sr}var Tr=an,hr=P.System,gr=P.VbrMode,$t=P.new_array_n,St=P.new_float,kt=P.new_float_n,Nt=P.new_int,It=P.assert;Qe.ENCDELAY=576,Qe.POSTDELAY=1152,Qe.MDCTDELAY=48,Qe.FFTOFFSET=224+Qe.MDCTDELAY,Qe.DECDELAY=528,Qe.SBLIMIT=32,Qe.CBANDS=64,Qe.SBPSY_l=21,Qe.SBPSY_s=12,Qe.SBMAX_l=22,Qe.SBMAX_s=13,Qe.PSFB21=6,Qe.PSFB12=6,Qe.BLKSIZE=1024,Qe.HBLKSIZE=Qe.BLKSIZE/2+1,Qe.BLKSIZE_s=256,Qe.HBLKSIZE_s=Qe.BLKSIZE_s/2+1,Qe.NORM_TYPE=0,Qe.START_TYPE=1,Qe.SHORT_TYPE=2,Qe.STOP_TYPE=3,Qe.MPG_MD_LR_LR=0,Qe.MPG_MD_LR_I=1,Qe.MPG_MD_MS_LR=2,Qe.MPG_MD_MS_I=3,Qe.fircoef=[-.0207887*5,-.0378413*5,-.0432472*5,-.031183*5,779609e-23*5,.0467745*5,.10091*5,.151365*5,.187098*5];function Qe(){var C=ft,$=Tr,ie=Qe.FFTOFFSET,Z=Qe.MPG_MD_MS_LR,ye=null;this.psy=null;var Q=null,me=null,Ne=null;this.setModules=function(M,K,o,I){ye=M,this.psy=K,Q=K,me=I,Ne=o};var ke=new C;function G(M){var K,o;if(M.ATH.useAdjust==0){M.ATH.adjust=1;return}if(o=M.loudness_sq[0][0],K=M.loudness_sq[1][0],M.channels_out==2?(o+=M.loudness_sq[0][1],K+=M.loudness_sq[1][1]):(o+=o,K+=K),M.mode_gr==2&&(o=Math.max(o,K)),o*=.5,o*=M.ATH.aaSensitivityP,o>.03125)M.ATH.adjust>=1?M.ATH.adjust=1:M.ATH.adjust<M.ATH.adjustLimit&&(M.ATH.adjust=M.ATH.adjustLimit),M.ATH.adjustLimit=1;else{var I=31.98*o+625e-6;M.ATH.adjust>=I?(M.ATH.adjust*=I*.075+.925,M.ATH.adjust<I&&(M.ATH.adjust=I)):M.ATH.adjustLimit>=I?M.ATH.adjust=I:M.ATH.adjust<M.ATH.adjustLimit&&(M.ATH.adjust=M.ATH.adjustLimit),M.ATH.adjustLimit=I}}function de(M){var K,o;for(It(0<=M.bitrate_index&&M.bitrate_index<16),It(0<=M.mode_ext&&M.mode_ext<4),M.bitrate_stereoMode_Hist[M.bitrate_index][4]++,M.bitrate_stereoMode_Hist[15][4]++,M.channels_out==2&&(M.bitrate_stereoMode_Hist[M.bitrate_index][M.mode_ext]++,M.bitrate_stereoMode_Hist[15][M.mode_ext]++),K=0;K<M.mode_gr;++K)for(o=0;o<M.channels_out;++o){var I=M.l3_side.tt[K][o].block_type|0;M.l3_side.tt[K][o].mixed_block_flag!=0&&(I=4),M.bitrate_blockType_Hist[M.bitrate_index][I]++,M.bitrate_blockType_Hist[M.bitrate_index][5]++,M.bitrate_blockType_Hist[15][I]++,M.bitrate_blockType_Hist[15][5]++}}function he(M,K){var o=M.internal_flags,I,H;if(o.lame_encode_frame_init==0){var O,g,_=St(2014),k=St(286+1152+576);for(o.lame_encode_frame_init=1,O=0,g=0;O<286+576*(1+o.mode_gr);++O)O<576*o.mode_gr?(_[O]=0,o.channels_out==2&&(k[O]=0)):(_[O]=K[0][g],o.channels_out==2&&(k[O]=K[1][g]),++g);for(H=0;H<o.mode_gr;H++)for(I=0;I<o.channels_out;I++)o.l3_side.tt[H][I].block_type=Qe.SHORT_TYPE;ke.mdct_sub48(o,_,k),It(576>=Qe.FFTOFFSET),It(o.mf_size>=Qe.BLKSIZE+M.framesize-Qe.FFTOFFSET),It(o.mf_size>=512+M.framesize-32)}}this.lame_encode_mp3_frame=function(M,K,o,I,H,O){var g,_=$t([2,2]);_[0][0]=new $,_[0][1]=new $,_[1][0]=new $,_[1][1]=new $;var k=$t([2,2]);k[0][0]=new $,k[0][1]=new $,k[1][0]=new $,k[1][1]=new $;var q,w=[null,null],c=M.internal_flags,L=kt([2,4]),y=[.5,.5],u=[[0,0],[0,0]],m=[[0,0],[0,0]],b,l,h;if(w[0]=K,w[1]=o,c.lame_encode_frame_init==0&&he(M,w),c.padding=0,(c.slot_lag-=c.frac_SpF)<0&&(c.slot_lag+=M.out_samplerate,c.padding=1),c.psymodel!=0){var x,E=[null,null],X=0,U=Nt(2);for(h=0;h<c.mode_gr;h++){for(l=0;l<c.channels_out;l++)E[l]=w[l],X=576+h*576-Qe.FFTOFFSET;if(M.VBR==gr.vbr_mtrh||M.VBR==gr.vbr_mt?x=Q.L3psycho_anal_vbr(M,E,X,h,_,k,u[h],m[h],L[h],U):x=Q.L3psycho_anal_ns(M,E,X,h,_,k,u[h],m[h],L[h],U),x!=0)return-4;for(M.mode==nr.JOINT_STEREO&&(y[h]=L[h][2]+L[h][3],y[h]>0&&(y[h]=L[h][3]/y[h])),l=0;l<c.channels_out;l++){var j=c.l3_side.tt[h][l];j.block_type=U[l],j.mixed_block_flag=0}}}else for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)c.l3_side.tt[h][l].block_type=Qe.NORM_TYPE,c.l3_side.tt[h][l].mixed_block_flag=0,m[h][l]=u[h][l]=700;if(G(c),ke.mdct_sub48(c,w[0],w[1]),c.mode_ext=Qe.MPG_MD_LR_LR,M.force_ms)c.mode_ext=Qe.MPG_MD_MS_LR;else if(M.mode==nr.JOINT_STEREO){var Se=0,f=0;for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)Se+=m[h][l],f+=u[h][l];if(Se<=1*f){var S=c.l3_side.tt[0],fe=c.l3_side.tt[c.mode_gr-1];S[0].block_type==S[1].block_type&&fe[0].block_type==fe[1].block_type&&(c.mode_ext=Qe.MPG_MD_MS_LR)}}if(c.mode_ext==Z?(q=k,b=m):(q=_,b=u),M.analysis&&c.pinfo!=null)for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)c.pinfo.ms_ratio[h]=c.ms_ratio[h],c.pinfo.ms_ener_ratio[h]=y[h],c.pinfo.blocktype[h][l]=c.l3_side.tt[h][l].block_type,c.pinfo.pe[h][l]=b[h][l],hr.arraycopy(c.l3_side.tt[h][l].xr,0,c.pinfo.xr[h][l],0,576),c.mode_ext==Z&&(c.pinfo.ers[h][l]=c.pinfo.ers[h][l+2],hr.arraycopy(c.pinfo.energy[h][l+2],0,c.pinfo.energy[h][l],0,c.pinfo.energy[h][l].length));if(M.VBR==gr.vbr_off||M.VBR==gr.vbr_abr){var _e,Oe;for(_e=0;_e<18;_e++)c.nsPsy.pefirbuf[_e]=c.nsPsy.pefirbuf[_e+1];for(Oe=0,h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)Oe+=b[h][l];for(c.nsPsy.pefirbuf[18]=Oe,Oe=c.nsPsy.pefirbuf[9],_e=0;_e<9;_e++)Oe+=(c.nsPsy.pefirbuf[_e]+c.nsPsy.pefirbuf[18-_e])*Qe.fircoef[_e];for(Oe=670*5*c.mode_gr*c.channels_out/Oe,h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)b[h][l]*=Oe}if(c.iteration_loop.iteration_loop(M,b,y,q),ye.format_bitstream(M),g=ye.copy_buffer(c,I,H,O,1),M.bWriteVbrTag&&me.addVbrFrame(M),M.analysis&&c.pinfo!=null){for(l=0;l<c.channels_out;l++){var Ue;for(Ue=0;Ue<ie;Ue++)c.pinfo.pcmdata[l][Ue]=c.pinfo.pcmdata[l][Ue+M.framesize];for(Ue=ie;Ue<1600;Ue++)c.pinfo.pcmdata[l][Ue]=w[l][Ue-ie]}Ne.set_frame_pinfo(M,q)}return de(c),g}}var T=Qe,le=P.Util,Le=P.new_float;function $e(){var C=Le(T.BLKSIZE),$=Le(T.BLKSIZE_s/2),ie=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function Z(Q,me,Ne){var ke=0,G,de,he;Ne<<=1;var M=me+Ne;G=4;do{var K,o,I,H,O,g,_;_=G>>1,H=G,O=G<<1,g=O+H,G=O<<1,de=me,he=de+_;do{var k,q,w,c;q=Q[de+0]-Q[de+H],k=Q[de+0]+Q[de+H],c=Q[de+O]-Q[de+g],w=Q[de+O]+Q[de+g],Q[de+O]=k-w,Q[de+0]=k+w,Q[de+g]=q-c,Q[de+H]=q+c,q=Q[he+0]-Q[he+H],k=Q[he+0]+Q[he+H],c=le.SQRT2*Q[he+g],w=le.SQRT2*Q[he+O],Q[he+O]=k-w,Q[he+0]=k+w,Q[he+g]=q-c,Q[he+H]=q+c,he+=G,de+=G}while(de<M);for(o=ie[ke+0],K=ie[ke+1],I=1;I<_;I++){var L,y;L=1-2*K*K,y=2*K*o,de=me+I,he=me+H-I;do{var u,m,b,k,q,l,w,h,c,x;m=y*Q[de+H]-L*Q[he+H],u=L*Q[de+H]+y*Q[he+H],q=Q[de+0]-u,k=Q[de+0]+u,l=Q[he+0]-m,b=Q[he+0]+m,m=y*Q[de+g]-L*Q[he+g],u=L*Q[de+g]+y*Q[he+g],c=Q[de+O]-u,w=Q[de+O]+u,x=Q[he+O]-m,h=Q[he+O]+m,m=K*w-o*x,u=o*w+K*x,Q[de+O]=k-u,Q[de+0]=k+u,Q[he+g]=l-m,Q[he+H]=l+m,m=o*h-K*c,u=K*h+o*c,Q[he+O]=b-u,Q[he+0]=b+u,Q[de+g]=q-m,Q[de+H]=q+m,he+=G,de+=G}while(de<M);L=o,o=L*ie[ke+0]-K*ie[ke+1],K=L*ie[ke+1]+K*ie[ke+0]}ke+=2}while(G<Ne)}var ye=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function(Q,me,Ne,ke,G){for(var de=0;de<3;de++){var he=T.BLKSIZE_s/2,M=65535&576/3*(de+1),K=T.BLKSIZE_s/8-1;do{var o,I,H,O,g,_=ye[K<<2]&255;o=$[_]*ke[Ne][G+_+M],g=$[127-_]*ke[Ne][G+_+M+128],I=o-g,o=o+g,H=$[_+64]*ke[Ne][G+_+M+64],g=$[63-_]*ke[Ne][G+_+M+192],O=H-g,H=H+g,he-=4,me[de][he+0]=o+H,me[de][he+2]=o-H,me[de][he+1]=I+O,me[de][he+3]=I-O,o=$[_+1]*ke[Ne][G+_+M+1],g=$[126-_]*ke[Ne][G+_+M+129],I=o-g,o=o+g,H=$[_+65]*ke[Ne][G+_+M+65],g=$[62-_]*ke[Ne][G+_+M+193],O=H-g,H=H+g,me[de][he+T.BLKSIZE_s/2+0]=o+H,me[de][he+T.BLKSIZE_s/2+2]=o-H,me[de][he+T.BLKSIZE_s/2+1]=I+O,me[de][he+T.BLKSIZE_s/2+3]=I-O}while(--K>=0);Z(me[de],he,T.BLKSIZE_s/2)}},this.fft_long=function(Q,me,Ne,ke,G){var de=T.BLKSIZE/8-1,he=T.BLKSIZE/2;do{var M,K,o,I,H,O=ye[de]&255;M=C[O]*ke[Ne][G+O],H=C[O+512]*ke[Ne][G+O+512],K=M-H,M=M+H,o=C[O+256]*ke[Ne][G+O+256],H=C[O+768]*ke[Ne][G+O+768],I=o-H,o=o+H,he-=4,me[he+0]=M+o,me[he+2]=M-o,me[he+1]=K+I,me[he+3]=K-I,M=C[O+1]*ke[Ne][G+O+1],H=C[O+513]*ke[Ne][G+O+513],K=M-H,M=M+H,o=C[O+257]*ke[Ne][G+O+257],H=C[O+769]*ke[Ne][G+O+769],I=o-H,o=o+H,me[he+T.BLKSIZE/2+0]=M+o,me[he+T.BLKSIZE/2+2]=M-o,me[he+T.BLKSIZE/2+1]=K+I,me[he+T.BLKSIZE/2+3]=K-I}while(--de>=0);Z(me,he,T.BLKSIZE/2)},this.init_fft=function(Q){for(var me=0;me<T.BLKSIZE;me++)C[me]=.42-.5*Math.cos(2*Math.PI*(me+.5)/T.BLKSIZE)+.08*Math.cos(4*Math.PI*(me+.5)/T.BLKSIZE);for(var me=0;me<T.BLKSIZE_s/2;me++)$[me]=.5*(1-Math.cos(2*Math.PI*(me+.5)/T.BLKSIZE_s))}}var ae=$e,be=P.VbrMode,Ie=P.Float,Ce=P.ShortBlock,Be=P.Util,Ye=P.Arrays,Fe=P.new_float,ot=P.new_float_n,mt=P.new_int,Ee=P.assert;function br(){var C=new ae,$=2.302585092994046,ie=2,Z=16,ye=2,Q=16,me=.34,Ne=1/(14752*14752)/(T.BLKSIZE/2),ke=.01,G=.8,de=.6,he=.3,M=3.5,K=4.4,o=25,I=21,H=.2302585093;function O(R){return R}function g(R,A){for(var F=0,V=0;V<T.BLKSIZE/2;++V)F+=R[V]*A.ATH.eql_w[V];return F*=Ne,F}function _(R,A,F,V,J,N,Y,re,W,ve,ne){var pe=R.internal_flags;if(W<2)C.fft_long(pe,V[J],W,ve,ne),C.fft_short(pe,N[Y],W,ve,ne);else if(W==2){for(var He=T.BLKSIZE-1;He>=0;--He){var rt=V[J+0][He],Re=V[J+1][He];V[J+0][He]=(rt+Re)*Be.SQRT2*.5,V[J+1][He]=(rt-Re)*Be.SQRT2*.5}for(var Ze=2;Ze>=0;--Ze)for(var He=T.BLKSIZE_s-1;He>=0;--He){var rt=N[Y+0][Ze][He],Re=N[Y+1][Ze][He];N[Y+0][Ze][He]=(rt+Re)*Be.SQRT2*.5,N[Y+1][Ze][He]=(rt-Re)*Be.SQRT2*.5}}A[0]=V[J+0][0],A[0]*=A[0];for(var He=T.BLKSIZE/2-1;He>=0;--He){var ue=V[J+0][T.BLKSIZE/2-He],Xe=V[J+0][T.BLKSIZE/2+He];A[T.BLKSIZE/2-He]=(ue*ue+Xe*Xe)*.5}for(var Ze=2;Ze>=0;--Ze){F[Ze][0]=N[Y+0][Ze][0],F[Ze][0]*=F[Ze][0];for(var He=T.BLKSIZE_s/2-1;He>=0;--He){var ue=N[Y+0][Ze][T.BLKSIZE_s/2-He],Xe=N[Y+0][Ze][T.BLKSIZE_s/2+He];F[Ze][T.BLKSIZE_s/2-He]=(ue*ue+Xe*Xe)*.5}}{for(var vt=0,He=11;He<T.HBLKSIZE;He++)vt+=A[He];pe.tot_ener[W]=vt}if(R.analysis){for(var He=0;He<T.HBLKSIZE;He++)pe.pinfo.energy[re][W][He]=pe.pinfo.energy_save[W][He],pe.pinfo.energy_save[W][He]=A[He];pe.pinfo.pe[re][W]=pe.pe[W]}R.athaa_loudapprox==2&&W<2&&(pe.loudness_sq[re][W]=pe.loudness_sq_save[W],pe.loudness_sq_save[W]=g(A,pe))}var k=8,q=23,w=15,c,L,y,u=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];function m(){c=Math.pow(10,(k+1)/16),L=Math.pow(10,(q+1)/16),y=Math.pow(10,w/10)}var b=[3.3246*3.3246,3.23837*3.23837,3.15437*3.15437,3.00412*3.00412,2.86103*2.86103,2.65407*2.65407,2.46209*2.46209,2.284*2.284,2.11879*2.11879,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,1.56911*1.56911,1.46658*1.46658,1.37074*1.37074,1.31036*1.31036,1.25264*1.25264,1.20648*1.20648,1.16203*1.16203,1.12765*1.12765,1.09428*1.09428,1.0659*1.0659,1.03826*1.03826,1.01895*1.01895,1],l=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1],h=[2.35364*2.35364,2.29259*2.29259,2.23313*2.23313,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,1.49999*1.49999,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.11084*1.11084,1.03826*1.03826];function x(R,A,F,V,J,N){var Y;if(A>R)if(A<R*L)Y=A/R;else return R+A;else{if(R>=A*L)return R+A;Y=R/A}if(Ee(R>=0),Ee(A>=0),R+=A,V+3<=3+3){if(Y>=c)return R;var re=0|Be.FAST_LOG10_X(Y,16);return R*l[re]}var re=0|Be.FAST_LOG10_X(Y,16);if(N!=0?A=J.ATH.cb_s[F]*J.ATH.adjust:A=J.ATH.cb_l[F]*J.ATH.adjust,Ee(A>=0),R<y*A){if(R>A){var W,ve;return W=1,re<=13&&(W=h[re]),ve=Be.FAST_LOG10_X(R/A,10/15),R*((b[re]-W)*ve+W)}return re>13?R:R*h[re]}return R*b[re]}var E=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1];function X(R,A,F){var V;if(R<0&&(R=0),A<0&&(A=0),R<=0)return A;if(A<=0)return R;if(A>R?V=A/R:V=R/A,-2<=F&&F<=2){if(V>=c)return R+A;var J=0|Be.FAST_LOG10_X(V,16);return(R+A)*E[J]}return V<L?R+A:(R<A&&(R=A),R)}function U(R,A){var F=R.internal_flags;if(F.channels_out>1){for(var V=0;V<T.SBMAX_l;V++){var J=F.thm[0].l[V],N=F.thm[1].l[V];F.thm[0].l[V]+=N*A,F.thm[1].l[V]+=J*A}for(var V=0;V<T.SBMAX_s;V++)for(var Y=0;Y<3;Y++){var J=F.thm[0].s[V][Y],N=F.thm[1].s[V][Y];F.thm[0].s[V][Y]+=N*A,F.thm[1].s[V][Y]+=J*A}}}function j(R){for(var A=0;A<T.SBMAX_l;A++)if(!(R.thm[0].l[A]>1.58*R.thm[1].l[A]||R.thm[1].l[A]>1.58*R.thm[0].l[A])){var F=R.mld_l[A]*R.en[3].l[A],V=Math.max(R.thm[2].l[A],Math.min(R.thm[3].l[A],F));F=R.mld_l[A]*R.en[2].l[A];var J=Math.max(R.thm[3].l[A],Math.min(R.thm[2].l[A],F));R.thm[2].l[A]=V,R.thm[3].l[A]=J}for(var A=0;A<T.SBMAX_s;A++)for(var N=0;N<3;N++)if(!(R.thm[0].s[A][N]>1.58*R.thm[1].s[A][N]||R.thm[1].s[A][N]>1.58*R.thm[0].s[A][N])){var F=R.mld_s[A]*R.en[3].s[A][N],V=Math.max(R.thm[2].s[A][N],Math.min(R.thm[3].s[A][N],F));F=R.mld_s[A]*R.en[2].s[A][N];var J=Math.max(R.thm[3].s[A][N],Math.min(R.thm[2].s[A][N],F));R.thm[2].s[A][N]=V,R.thm[3].s[A][N]=J}}function Se(R,A,F){var V=A,J=Math.pow(10,F);A*=2,V*=2;for(var N=0;N<T.SBMAX_l;N++){var Y,re,W,ve;if(ve=R.ATH.cb_l[R.bm_l[N]]*J,Y=Math.min(Math.max(R.thm[0].l[N],ve),Math.max(R.thm[1].l[N],ve)),re=Math.max(R.thm[2].l[N],ve),W=Math.max(R.thm[3].l[N],ve),Y*A<re+W){var ne=Y*V/(re+W);re*=ne,W*=ne,Ee(re+W>0)}R.thm[2].l[N]=Math.min(re,R.thm[2].l[N]),R.thm[3].l[N]=Math.min(W,R.thm[3].l[N])}J*=T.BLKSIZE_s/T.BLKSIZE;for(var N=0;N<T.SBMAX_s;N++)for(var pe=0;pe<3;pe++){var Y,re,W,ve;if(ve=R.ATH.cb_s[R.bm_s[N]]*J,Y=Math.min(Math.max(R.thm[0].s[N][pe],ve),Math.max(R.thm[1].s[N][pe],ve)),re=Math.max(R.thm[2].s[N][pe],ve),W=Math.max(R.thm[3].s[N][pe],ve),Y*A<re+W){var ne=Y*A/(re+W);re*=ne,W*=ne,Ee(re+W>0)}R.thm[2].s[N][pe]=Math.min(R.thm[2].s[N][pe],re),R.thm[3].s[N][pe]=Math.min(R.thm[3].s[N][pe],W)}}function f(R,A,F,V,J){var N,Y,re=0,W=0;for(N=Y=0;N<T.SBMAX_s;++Y,++N){for(var ve=R.bo_s[N],ne=R.npart_s,pe=ve<ne?ve:ne;Y<pe;)Ee(A[Y]>=0),Ee(F[Y]>=0),re+=A[Y],W+=F[Y],Y++;if(R.en[V].s[N][J]=re,R.thm[V].s[N][J]=W,Y>=ne){++N;break}Ee(A[Y]>=0),Ee(F[Y]>=0);{var He=R.PSY.bo_s_weight[N],rt=1-He;re=He*A[Y],W=He*F[Y],R.en[V].s[N][J]+=re,R.thm[V].s[N][J]+=W,re=rt*A[Y],W=rt*F[Y]}}for(;N<T.SBMAX_s;++N)R.en[V].s[N][J]=0,R.thm[V].s[N][J]=0}function S(R,A,F,V){var J,N,Y=0,re=0;for(J=N=0;J<T.SBMAX_l;++N,++J){for(var W=R.bo_l[J],ve=R.npart_l,ne=W<ve?W:ve;N<ne;)Ee(A[N]>=0),Ee(F[N]>=0),Y+=A[N],re+=F[N],N++;if(R.en[V].l[J]=Y,R.thm[V].l[J]=re,N>=ve){++J;break}Ee(A[N]>=0),Ee(F[N]>=0);{var pe=R.PSY.bo_l_weight[J],He=1-pe;Y=pe*A[N],re=pe*F[N],R.en[V].l[J]+=Y,R.thm[V].l[J]+=re,Y=He*A[N],re=He*F[N]}}for(;J<T.SBMAX_l;++J)R.en[V].l[J]=0,R.thm[V].l[J]=0}function fe(R,A,F,V,J,N){var Y=R.internal_flags,re,W;for(W=re=0;W<Y.npart_s;++W){for(var ve=0,ne=0,pe=Y.numlines_s[W],He=0;He<pe;++He,++re){var rt=A[N][re];ve+=rt,ne<rt&&(ne=rt)}F[W]=ve}for(Ee(W==Y.npart_s),Ee(re==129),re=W=0;W<Y.npart_s;W++){var Re=Y.s3ind_s[W][0],Ze=Y.s3_ss[re++]*F[Re];for(++Re;Re<=Y.s3ind_s[W][1];)Ze+=Y.s3_ss[re]*F[Re],++re,++Re;{var ue=ye*Y.nb_s1[J][W];V[W]=Math.min(Ze,ue)}if(Y.blocktype_old[J&1]==T.SHORT_TYPE){var ue=Q*Y.nb_s2[J][W],Xe=V[W];V[W]=Math.min(ue,Xe)}Y.nb_s2[J][W]=Y.nb_s1[J][W],Y.nb_s1[J][W]=Ze,Ee(V[W]>=0)}for(;W<=T.CBANDS;++W)F[W]=0,V[W]=0}function _e(R,A,F,V){var J=R.internal_flags;R.short_blocks==Ce.short_block_coupled&&!(A[0]!=0&&A[1]!=0)&&(A[0]=A[1]=0);for(var N=0;N<J.channels_out;N++)V[N]=T.NORM_TYPE,R.short_blocks==Ce.short_block_dispensed&&(A[N]=1),R.short_blocks==Ce.short_block_forced&&(A[N]=0),A[N]!=0?(Ee(J.blocktype_old[N]!=T.START_TYPE),J.blocktype_old[N]==T.SHORT_TYPE&&(V[N]=T.STOP_TYPE)):(V[N]=T.SHORT_TYPE,J.blocktype_old[N]==T.NORM_TYPE&&(J.blocktype_old[N]=T.START_TYPE),J.blocktype_old[N]==T.STOP_TYPE&&(J.blocktype_old[N]=T.SHORT_TYPE)),F[N]=J.blocktype_old[N],J.blocktype_old[N]=V[N]}function Oe(R,A,F){return F>=1?R:F<=0?A:A>0?Math.pow(R/A,F)*A:0}var Ue=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function je(R,A){for(var F=309.07,V=0;V<T.SBMAX_s-1;V++)for(var J=0;J<3;J++){var N=R.thm.s[V][J];if(Ee(V<Ue.length),N>0){var Y=N*A,re=R.en.s[V][J];re>Y&&(re>Y*1e10?F+=Ue[V]*(10*$):(Ee(Y>0),F+=Ue[V]*Be.FAST_LOG10(re/Y)))}}return F}var ze=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function nt(R,A){for(var F=281.0575,V=0;V<T.SBMAX_l-1;V++){var J=R.thm.l[V];if(Ee(V<ze.length),J>0){var N=J*A,Y=R.en.l[V];Y>N&&(Y>N*1e10?F+=ze[V]*(10*$):(Ee(N>0),F+=ze[V]*Be.FAST_LOG10(Y/N)))}}return F}function Ke(R,A,F,V,J){var N,Y;for(N=Y=0;N<R.npart_l;++N){var re=0,W=0,ve;for(ve=0;ve<R.numlines_l[N];++ve,++Y){var ne=A[Y];Ee(ne>=0),re+=ne,W<ne&&(W=ne)}F[N]=re,V[N]=W,J[N]=re*R.rnumlines_l[N],Ee(R.rnumlines_l[N]>=0),Ee(re>=0),Ee(F[N]>=0),Ee(V[N]>=0),Ee(J[N]>=0)}}function Ve(R,A,F,V){var J=u.length-1,N=0,Y=F[N]+F[N+1];if(Ee(Y>=0),Y>0){var re=A[N];re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_l[N]+R.numlines_l[N+1]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_l[N]+R.numlines_l[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;for(N=1;N<R.npart_l-1;N++)if(Y=F[N-1]+F[N]+F[N+1],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_l[N-1]+R.numlines_l[N]+R.numlines_l[N+1]-1>0),Y=20*(re*3-Y)/(Y*(R.numlines_l[N-1]+R.numlines_l[N]+R.numlines_l[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;if(Ee(N>0),Ee(N==R.npart_l-1),Y=F[N-1]+F[N],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),Ee(R.numlines_l[N-1]+R.numlines_l[N]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_l[N-1]+R.numlines_l[N]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;Ee(N==R.npart_l-1)}var xt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];this.L3psycho_anal_ns=function(R,A,F,V,J,N,Y,re,W,ve){var ne=R.internal_flags,pe=ot([2,T.BLKSIZE]),He=ot([2,3,T.BLKSIZE_s]),rt=Fe(T.CBANDS+1),Re=Fe(T.CBANDS+1),Ze=Fe(T.CBANDS+2),ue=mt(2),Xe=mt(2),vt,Ae,We,Te,Je,Ft,qe,ct,pt=ot([2,576]),Vt,Xr=mt(T.CBANDS+2),Zt=mt(T.CBANDS+2);for(Ye.fill(Zt,0),vt=ne.channels_out,R.mode==nr.JOINT_STEREO&&(vt=4),R.VBR==be.vbr_off?Vt=ne.ResvMax==0?0:ne.ResvSize/ne.ResvMax*.5:R.VBR==be.vbr_rh||R.VBR==be.vbr_mtrh||R.VBR==be.vbr_mt?Vt=.6:Vt=1,Ae=0;Ae<ne.channels_out;Ae++){var Ht=A[Ae],Ur=F+576-350-I+192;for(Ee(xt.length==(I-1)/2),Te=0;Te<576;Te++){var Kr,Wr;for(Kr=Ht[Ur+Te+10],Wr=0,Je=0;Je<(I-1)/2-1;Je+=2)Kr+=xt[Je]*(Ht[Ur+Te+Je]+Ht[Ur+Te+I-Je]),Wr+=xt[Je+1]*(Ht[Ur+Te+Je+1]+Ht[Ur+Te+I-Je-1]);pt[Ae][Te]=Kr+Wr}J[V][Ae].en.assign(ne.en[Ae]),J[V][Ae].thm.assign(ne.thm[Ae]),vt>2&&(N[V][Ae].en.assign(ne.en[Ae+2]),N[V][Ae].thm.assign(ne.thm[Ae+2]))}for(Ae=0;Ae<vt;Ae++){var gn,bn,Er=Fe(12),Fn=[0,0,0,0],ia=Fe(12),m0=1,Vc,qc=Fe(T.CBANDS),zc=Fe(T.CBANDS),qt=[0,0,0,0],jc=Fe(T.HBLKSIZE),Gc=ot([3,T.HBLKSIZE_s]);for(Ee(ne.npart_s<=T.CBANDS),Ee(ne.npart_l<=T.CBANDS),Te=0;Te<3;Te++)Er[Te]=ne.nsPsy.last_en_subshort[Ae][Te+6],Ee(ne.nsPsy.last_en_subshort[Ae][Te+4]>0),ia[Te]=Er[Te]/ne.nsPsy.last_en_subshort[Ae][Te+4],Fn[0]+=Er[Te];if(Ae==2)for(Te=0;Te<576;Te++){var p0,h0;p0=pt[0][Te],h0=pt[1][Te],pt[0][Te]=p0+h0,pt[1][Te]=p0-h0}{var Xc=pt[Ae&1],Wa=0;for(Te=0;Te<9;Te++){for(var Gd=Wa+64,lr=1;Wa<Gd;Wa++)lr<Math.abs(Xc[Wa])&&(lr=Math.abs(Xc[Wa]));ne.nsPsy.last_en_subshort[Ae][Te]=Er[Te+3]=lr,Fn[1+Te/3]+=lr,lr>Er[Te+3-2]?(Ee(Er[Te+3-2]>0),lr=lr/Er[Te+3-2]):Er[Te+3-2]>lr*10?(Ee(lr>0),lr=Er[Te+3-2]/(lr*10)):lr=0,ia[Te+3]=lr}}if(R.analysis){var _0=ia[0];for(Te=1;Te<12;Te++)_0<ia[Te]&&(_0=ia[Te]);ne.pinfo.ers[V][Ae]=ne.pinfo.ers_save[Ae],ne.pinfo.ers_save[Ae]=_0}for(Vc=Ae==3?ne.nsPsy.attackthre_s:ne.nsPsy.attackthre,Te=0;Te<12;Te++)qt[Te/3]==0&&ia[Te]>Vc&&(qt[Te/3]=Te%3+1);for(Te=1;Te<4;Te++){var S0;Fn[Te-1]>Fn[Te]?(Ee(Fn[Te]>0),S0=Fn[Te-1]/Fn[Te]):(Ee(Fn[Te-1]>0),S0=Fn[Te]/Fn[Te-1]),S0<1.7&&(qt[Te]=0,Te==1&&(qt[0]=0))}for(qt[0]!=0&&ne.nsPsy.lastAttacks[Ae]!=0&&(qt[0]=0),(ne.nsPsy.lastAttacks[Ae]==3||qt[0]+qt[1]+qt[2]+qt[3]!=0)&&(m0=0,qt[1]!=0&&qt[0]!=0&&(qt[1]=0),qt[2]!=0&&qt[1]!=0&&(qt[2]=0),qt[3]!=0&&qt[2]!=0&&(qt[3]=0)),Ae<2?Xe[Ae]=m0:m0==0&&(Xe[0]=Xe[1]=0),W[Ae]=ne.tot_ener[Ae],bn=He,gn=pe,_(R,jc,Gc,gn,Ae&1,bn,Ae&1,V,Ae,A,F),Ke(ne,jc,rt,qc,zc),Ve(ne,qc,zc,Xr),ct=0;ct<3;ct++){var g0,Hr;for(fe(R,Gc,Re,Ze,Ae,ct),f(ne,Re,Ze,Ae,ct),qe=0;qe<T.SBMAX_s;qe++){if(Hr=ne.thm[Ae].s[qe][ct],Hr*=G,qt[ct]>=2||qt[ct+1]==1){var Ya=ct!=0?ct-1:2,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,de*Vt);Hr=Math.min(Hr,lr)}if(qt[ct]==1){var Ya=ct!=0?ct-1:2,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,he*Vt);Hr=Math.min(Hr,lr)}else if(ct!=0&&qt[ct-1]==3||ct==0&&ne.nsPsy.lastAttacks[Ae]==3){var Ya=ct!=2?ct+1:0,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,he*Vt);Hr=Math.min(Hr,lr)}g0=Er[ct*3+3]+Er[ct*3+4]+Er[ct*3+5],Er[ct*3+5]*6<g0&&(Hr*=.5,Er[ct*3+4]*6<g0&&(Hr*=.5)),ne.thm[Ae].s[qe][ct]=Hr}}for(ne.nsPsy.lastAttacks[Ae]=qt[2],Ft=0,We=0;We<ne.npart_l;We++){for(var Mi=ne.s3ind[We][0],b0=rt[Mi]*u[Xr[Mi]],Pi=ne.s3_ll[Ft++]*b0;++Mi<=ne.s3ind[We][1];)b0=rt[Mi]*u[Xr[Mi]],Pi=x(Pi,ne.s3_ll[Ft++]*b0,Mi,Mi-We,ne,0);Pi*=.158489319246111,ne.blocktype_old[Ae&1]==T.SHORT_TYPE?Ze[We]=Pi:Ze[We]=Oe(Math.min(Pi,Math.min(ie*ne.nb_1[Ae][We],Z*ne.nb_2[Ae][We])),Pi,Vt),ne.nb_2[Ae][We]=ne.nb_1[Ae][We],ne.nb_1[Ae][We]=Pi}for(;We<=T.CBANDS;++We)rt[We]=0,Ze[We]=0;S(ne,rt,Ze,Ae)}if((R.mode==nr.STEREO||R.mode==nr.JOINT_STEREO)&&R.interChRatio>0&&U(R,R.interChRatio),R.mode==nr.JOINT_STEREO){var x0;j(ne),x0=R.msfix,Math.abs(x0)>0&&Se(ne,x0,R.ATHlower*ne.ATH.adjust)}for(_e(R,Xe,ve,ue),Ae=0;Ae<vt;Ae++){var $a,Za=0,Go,Xo;Ae>1?($a=re,Za=-2,Go=T.NORM_TYPE,(ve[0]==T.SHORT_TYPE||ve[1]==T.SHORT_TYPE)&&(Go=T.SHORT_TYPE),Xo=N[V][Ae-2]):($a=Y,Za=0,Go=ve[Ae],Xo=J[V][Ae]),Go==T.SHORT_TYPE?$a[Za+Ae]=je(Xo,ne.masking_lower):$a[Za+Ae]=nt(Xo,ne.masking_lower),R.analysis&&(ne.pinfo.pe[V][Ae]=$a[Za+Ae])}return 0};function Ot(R,A,F,V,J,N,Y,re){var W=R.internal_flags;if(V<2)C.fft_long(W,Y[re],V,A,F);else if(V==2)for(var ve=T.BLKSIZE-1;ve>=0;--ve){var ne=Y[re+0][ve],pe=Y[re+1][ve];Y[re+0][ve]=(ne+pe)*Be.SQRT2*.5,Y[re+1][ve]=(ne-pe)*Be.SQRT2*.5}N[0]=Y[re+0][0],N[0]*=N[0];for(var ve=T.BLKSIZE/2-1;ve>=0;--ve){var He=Y[re+0][T.BLKSIZE/2-ve],rt=Y[re+0][T.BLKSIZE/2+ve];N[T.BLKSIZE/2-ve]=(He*He+rt*rt)*.5}{for(var Re=0,ve=11;ve<T.HBLKSIZE;ve++)Re+=N[ve];W.tot_ener[V]=Re}if(R.analysis){for(var ve=0;ve<T.HBLKSIZE;ve++)W.pinfo.energy[J][V][ve]=W.pinfo.energy_save[V][ve],W.pinfo.energy_save[V][ve]=N[ve];W.pinfo.pe[J][V]=W.pe[V]}}function Rt(R,A,F,V,J,N,Y,re){var W=R.internal_flags;if(J==0&&V<2&&C.fft_short(W,Y[re],V,A,F),V==2)for(var ve=T.BLKSIZE_s-1;ve>=0;--ve){var ne=Y[re+0][J][ve],pe=Y[re+1][J][ve];Y[re+0][J][ve]=(ne+pe)*Be.SQRT2*.5,Y[re+1][J][ve]=(ne-pe)*Be.SQRT2*.5}N[J][0]=Y[re+0][J][0],N[J][0]*=N[J][0];for(var ve=T.BLKSIZE_s/2-1;ve>=0;--ve){var He=Y[re+0][J][T.BLKSIZE_s/2-ve],rt=Y[re+0][J][T.BLKSIZE_s/2+ve];N[J][T.BLKSIZE_s/2-ve]=(He*He+rt*rt)*.5}}function Lt(R,A,F,V){var J=R.internal_flags;R.athaa_loudapprox==2&&F<2&&(J.loudness_sq[A][F]=J.loudness_sq_save[F],J.loudness_sq_save[F]=g(V,J))}var jt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];function Kt(R,A,F,V,J,N,Y,re,W,ve){for(var ne=ot([2,576]),pe=R.internal_flags,He=pe.channels_out,rt=R.mode==nr.JOINT_STEREO?4:He,Re=0;Re<He;Re++){firbuf=A[Re];var Ze=F+576-350-I+192;Ee(jt.length==(I-1)/2);for(var ue=0;ue<576;ue++){var Xe,vt;Xe=firbuf[Ze+ue+10],vt=0;for(var Ae=0;Ae<(I-1)/2-1;Ae+=2)Xe+=jt[Ae]*(firbuf[Ze+ue+Ae]+firbuf[Ze+ue+I-Ae]),vt+=jt[Ae+1]*(firbuf[Ze+ue+Ae+1]+firbuf[Ze+ue+I-Ae-1]);ne[Re][ue]=Xe+vt}J[V][Re].en.assign(pe.en[Re]),J[V][Re].thm.assign(pe.thm[Re]),rt>2&&(N[V][Re].en.assign(pe.en[Re+2]),N[V][Re].thm.assign(pe.thm[Re+2]))}for(var Re=0;Re<rt;Re++){var We=Fe(12),Te=Fe(12),Je=[0,0,0,0],Ft=ne[Re&1],qe=0,ct=Re==3?pe.nsPsy.attackthre_s:pe.nsPsy.attackthre,pt=1;if(Re==2)for(var ue=0,Ae=576;Ae>0;++ue,--Ae){var Vt=ne[0][ue],Xr=ne[1][ue];ne[0][ue]=Vt+Xr,ne[1][ue]=Vt-Xr}for(var ue=0;ue<3;ue++)Te[ue]=pe.nsPsy.last_en_subshort[Re][ue+6],Ee(pe.nsPsy.last_en_subshort[Re][ue+4]>0),We[ue]=Te[ue]/pe.nsPsy.last_en_subshort[Re][ue+4],Je[0]+=Te[ue];for(var ue=0;ue<9;ue++){for(var Zt=qe+64,Ht=1;qe<Zt;qe++)Ht<Math.abs(Ft[qe])&&(Ht=Math.abs(Ft[qe]));pe.nsPsy.last_en_subshort[Re][ue]=Te[ue+3]=Ht,Je[1+ue/3]+=Ht,Ht>Te[ue+3-2]?(Ee(Te[ue+3-2]>0),Ht=Ht/Te[ue+3-2]):Te[ue+3-2]>Ht*10?(Ee(Ht>0),Ht=Te[ue+3-2]/(Ht*10)):Ht=0,We[ue+3]=Ht}for(var ue=0;ue<3;++ue){var Ur=Te[ue*3+3]+Te[ue*3+4]+Te[ue*3+5],Kr=1;Te[ue*3+5]*6<Ur&&(Kr*=.5,Te[ue*3+4]*6<Ur&&(Kr*=.5)),re[Re][ue]=Kr}if(R.analysis){for(var Wr=We[0],ue=1;ue<12;ue++)Wr<We[ue]&&(Wr=We[ue]);pe.pinfo.ers[V][Re]=pe.pinfo.ers_save[Re],pe.pinfo.ers_save[Re]=Wr}for(var ue=0;ue<12;ue++)W[Re][ue/3]==0&&We[ue]>ct&&(W[Re][ue/3]=ue%3+1);for(var ue=1;ue<4;ue++){var gn=Je[ue-1],bn=Je[ue],Er=Math.max(gn,bn);Er<4e4&&gn<1.7*bn&&bn<1.7*gn&&(ue==1&&W[Re][0]<=W[Re][ue]&&(W[Re][0]=0),W[Re][ue]=0)}W[Re][0]<=pe.nsPsy.lastAttacks[Re]&&(W[Re][0]=0),(pe.nsPsy.lastAttacks[Re]==3||W[Re][0]+W[Re][1]+W[Re][2]+W[Re][3]!=0)&&(pt=0,W[Re][1]!=0&&W[Re][0]!=0&&(W[Re][1]=0),W[Re][2]!=0&&W[Re][1]!=0&&(W[Re][2]=0),W[Re][3]!=0&&W[Re][2]!=0&&(W[Re][3]=0)),Re<2?ve[Re]=pt:pt==0&&(ve[0]=ve[1]=0),Y[Re]=pe.tot_ener[Re]}}function _r(R,A,F){if(F==0)for(var V=0;V<R.npart_s;V++)R.nb_s2[A][V]=R.nb_s1[A][V],R.nb_s1[A][V]=0}function Ln(R,A){for(var F=0;F<R.npart_l;F++)R.nb_2[A][F]=R.nb_1[A][F],R.nb_1[A][F]=0}function Lr(R,A,F,V){var J=u.length-1,N=0,Y=F[N]+F[N+1];if(Ee(Y>=0),Y>0){var re=A[N];re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_s[N]+R.numlines_s[N+1]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_s[N]+R.numlines_s[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;for(N=1;N<R.npart_s-1;N++)if(Y=F[N-1]+F[N]+F[N+1],Ee(N+1<R.npart_s),Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_s[N-1]+R.numlines_s[N]+R.numlines_s[N+1]-1>0),Y=20*(re*3-Y)/(Y*(R.numlines_s[N-1]+R.numlines_s[N]+R.numlines_s[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;if(Ee(N>0),Ee(N==R.npart_s-1),Y=F[N-1]+F[N],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),Ee(R.numlines_s[N-1]+R.numlines_s[N]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_s[N-1]+R.numlines_s[N]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;Ee(N==R.npart_s-1)}function Fr(R,A,F,V,J,N){var Y=R.internal_flags,re=new float[T.CBANDS],W=Fe(T.CBANDS),ve,ne,pe,He=new int[T.CBANDS];for(pe=ne=0;pe<Y.npart_s;++pe){var rt=0,Re=0,Ze=Y.numlines_s[pe];for(ve=0;ve<Ze;++ve,++ne){var ue=A[N][ne];rt+=ue,Re<ue&&(Re=ue)}F[pe]=rt,Ee(rt>=0),re[pe]=Re,Ee(Ze>0),W[pe]=rt/Ze,Ee(W[pe]>=0)}for(Ee(pe==Y.npart_s),Ee(ne==129);pe<T.CBANDS;++pe)re[pe]=0,W[pe]=0;for(Lr(Y,re,W,He),ne=pe=0;pe<Y.npart_s;pe++){var Xe=Y.s3ind_s[pe][0],vt=Y.s3ind_s[pe][1],Ae,We,Te,Je,Ft;for(Ae=He[Xe],We=1,Je=Y.s3_ss[ne]*F[Xe]*u[He[Xe]],++ne,++Xe;Xe<=vt;)Ae+=He[Xe],We+=1,Te=Y.s3_ss[ne]*F[Xe]*u[He[Xe]],Je=X(Je,Te,Xe-pe),++ne,++Xe;Ae=(1+2*Ae)/(2*We),Ft=u[Ae]*.5,Je*=Ft,V[pe]=Je,Y.nb_s2[J][pe]=Y.nb_s1[J][pe],Y.nb_s1[J][pe]=Je,Te=re[pe],Te*=Y.minval_s[pe],Te*=Ft,V[pe]>Te&&(V[pe]=Te),Y.masking_lower>1&&(V[pe]*=Y.masking_lower),V[pe]>F[pe]&&(V[pe]=F[pe]),Y.masking_lower<1&&(V[pe]*=Y.masking_lower),Ee(V[pe]>=0)}for(;pe<T.CBANDS;++pe)F[pe]=0,V[pe]=0}function _n(R,A,F,V,J){var N=Fe(T.CBANDS),Y=Fe(T.CBANDS),re=mt(T.CBANDS+2),W;Ke(R,A,F,N,Y),Ve(R,N,Y,re);var ve=0;for(W=0;W<R.npart_l;W++){var ne,pe,He,rt,Re=R.s3ind[W][0],Ze=R.s3ind[W][1],ue=0,Xe=0;for(ue=re[Re],Xe+=1,pe=R.s3_ll[ve]*F[Re]*u[re[Re]],++ve,++Re;Re<=Ze;)ue+=re[Re],Xe+=1,ne=R.s3_ll[ve]*F[Re]*u[re[Re]],rt=X(pe,ne,Re-W),pe=rt,++ve,++Re;if(ue=(1+2*ue)/(2*Xe),He=u[ue]*.5,pe*=He,R.blocktype_old[J&1]==T.SHORT_TYPE){var vt=ie*R.nb_1[J][W];vt>0?V[W]=Math.min(pe,vt):V[W]=Math.min(pe,F[W]*he)}else{var Ae=Z*R.nb_2[J][W],We=ie*R.nb_1[J][W],vt;Ae<=0&&(Ae=pe),We<=0&&(We=pe),R.blocktype_old[J&1]==T.NORM_TYPE?vt=Math.min(We,Ae):vt=We,V[W]=Math.min(pe,vt)}R.nb_2[J][W]=R.nb_1[J][W],R.nb_1[J][W]=pe,ne=N[W],ne*=R.minval_l[W],ne*=He,V[W]>ne&&(V[W]=ne),R.masking_lower>1&&(V[W]*=R.masking_lower),V[W]>F[W]&&(V[W]=F[W]),R.masking_lower<1&&(V[W]*=R.masking_lower),Ee(V[W]>=0)}for(;W<T.CBANDS;++W)F[W]=0,V[W]=0}function Ii(R,A){var F=R.internal_flags;R.short_blocks==Ce.short_block_coupled&&!(A[0]!=0&&A[1]!=0)&&(A[0]=A[1]=0);for(var V=0;V<F.channels_out;V++)R.short_blocks==Ce.short_block_dispensed&&(A[V]=1),R.short_blocks==Ce.short_block_forced&&(A[V]=0)}function Ci(R,A,F){for(var V=R.internal_flags,J=0;J<V.channels_out;J++){var N=T.NORM_TYPE;A[J]!=0?(Ee(V.blocktype_old[J]!=T.START_TYPE),V.blocktype_old[J]==T.SHORT_TYPE&&(N=T.STOP_TYPE)):(N=T.SHORT_TYPE,V.blocktype_old[J]==T.NORM_TYPE&&(V.blocktype_old[J]=T.START_TYPE),V.blocktype_old[J]==T.STOP_TYPE&&(V.blocktype_old[J]=T.SHORT_TYPE)),F[J]=V.blocktype_old[J],V.blocktype_old[J]=N}}function Sn(R,A,F,V,J,N,Y){for(var re=N*2,W=N>0?Math.pow(10,J):1,ve,ne,pe=0;pe<Y;++pe){var He=R[2][pe],rt=R[3][pe],Re=A[0][pe],Ze=A[1][pe],ue=A[2][pe],Xe=A[3][pe];if(Re<=1.58*Ze&&Ze<=1.58*Re){var vt=F[pe]*rt,Ae=F[pe]*He;ne=Math.max(ue,Math.min(Xe,vt)),ve=Math.max(Xe,Math.min(ue,Ae))}else ne=ue,ve=Xe;if(N>0){var We,Te,Je=V[pe]*W;if(We=Math.min(Math.max(Re,Je),Math.max(Ze,Je)),ue=Math.max(ne,Je),Xe=Math.max(ve,Je),Te=ue+Xe,Te>0&&We*re<Te){var Ft=We*re/Te;ue*=Ft,Xe*=Ft,Ee(Te>0)}ne=Math.min(ue,ne),ve=Math.min(Xe,ve)}ne>He&&(ne=He),ve>rt&&(ve=rt),A[2][pe]=ne,A[3][pe]=ve}}this.L3psycho_anal_vbr=function(R,A,F,V,J,N,Y,re,W,ve){var ne=R.internal_flags,pe,He,rt=Fe(T.HBLKSIZE),Re=ot([3,T.HBLKSIZE_s]),Ze=ot([2,T.BLKSIZE]),ue=ot([2,3,T.BLKSIZE_s]),Xe=ot([4,T.CBANDS]),vt=ot([4,T.CBANDS]),Ae=ot([4,3]),We=.6,Te=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],Je=mt(2),Ft=R.mode==nr.JOINT_STEREO?4:ne.channels_out;Kt(R,A,F,V,J,N,W,Ae,Te,Je),Ii(R,Je);{for(var qe=0;qe<Ft;qe++){var ct=qe&1;pe=Ze,Ot(R,A,F,qe,V,rt,pe,ct),Lt(R,V,qe,rt),Je[ct]!=0?_n(ne,rt,Xe[qe],vt[qe],qe):Ln(ne,qe)}Je[0]+Je[1]==2&&R.mode==nr.JOINT_STEREO&&Sn(Xe,vt,ne.mld_cb_l,ne.ATH.cb_l,R.ATHlower*ne.ATH.adjust,R.msfix,ne.npart_l);for(var qe=0;qe<Ft;qe++){var ct=qe&1;Je[ct]!=0&&S(ne,Xe[qe],vt[qe],qe)}}{for(var pt=0;pt<3;pt++){for(var qe=0;qe<Ft;++qe){var ct=qe&1;Je[ct]!=0?_r(ne,qe,pt):(He=ue,Rt(R,A,F,qe,pt,Re,He,ct),Fr(R,Re,Xe[qe],vt[qe],qe,pt))}Je[0]+Je[1]==0&&R.mode==nr.JOINT_STEREO&&Sn(Xe,vt,ne.mld_cb_s,ne.ATH.cb_s,R.ATHlower*ne.ATH.adjust,R.msfix,ne.npart_s);for(var qe=0;qe<Ft;++qe){var ct=qe&1;Je[ct]==0&&f(ne,Xe[qe],vt[qe],qe,pt)}}for(var qe=0;qe<Ft;qe++){var ct=qe&1;if(Je[ct]==0)for(var Vt=0;Vt<T.SBMAX_s;Vt++){for(var Xr=Fe(3),pt=0;pt<3;pt++){var Zt=ne.thm[qe].s[Vt][pt];if(Zt*=G,Te[qe][pt]>=2||Te[qe][pt+1]==1){var Ht=pt!=0?pt-1:2,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,de*We);Zt=Math.min(Zt,Ur)}else if(Te[qe][pt]==1){var Ht=pt!=0?pt-1:2,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,he*We);Zt=Math.min(Zt,Ur)}else if(pt!=0&&Te[qe][pt-1]==3||pt==0&&ne.nsPsy.lastAttacks[qe]==3){var Ht=pt!=2?pt+1:0,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,he*We);Zt=Math.min(Zt,Ur)}Zt*=Ae[qe][pt],Xr[pt]=Zt}for(var pt=0;pt<3;pt++)ne.thm[qe].s[Vt][pt]=Xr[pt]}}}for(var qe=0;qe<Ft;qe++)ne.nsPsy.lastAttacks[qe]=Te[qe][2];Ci(R,Je,ve);for(var qe=0;qe<Ft;qe++){var Kr,Wr,gn,bn;qe>1?(Kr=re,Wr=-2,gn=T.NORM_TYPE,(ve[0]==T.SHORT_TYPE||ve[1]==T.SHORT_TYPE)&&(gn=T.SHORT_TYPE),bn=N[V][qe-2]):(Kr=Y,Wr=0,gn=ve[qe],bn=J[V][qe]),gn==T.SHORT_TYPE?Kr[Wr+qe]=je(bn,ne.masking_lower):Kr[Wr+qe]=nt(bn,ne.masking_lower),R.analysis&&(ne.pinfo.pe[V][qe]=Kr[Wr+qe])}return 0};function Cr(R,A){var F=R,V;return F>=0?V=-F*27:V=F*A,V<=-72?0:Math.exp(V*H)}function ii(R){var A=0,F=0;{var V=0,J,N;for(V=0;Cr(V,R)>1e-20;V-=1);for(J=V,N=0;Math.abs(N-J)>1e-12;)V=(N+J)/2,Cr(V,R)>0?N=V:J=V;A=J}{var V=0,J,N;for(V=0;Cr(V,R)>1e-20;V+=1);for(J=0,N=V;Math.abs(N-J)>1e-12;)V=(N+J)/2,Cr(V,R)>0?J=V:N=V;F=N}{var Y=0,re=1e3,W;for(W=0;W<=re;++W){var V=A+W*(F-A)/re,ve=Cr(V,R);Y+=ve}{var ne=(re+1)/(Y*(F-A));return ne}}}function Ka(R){var A,F,V,J;return A=R,A>=0?A*=3:A*=1.5,A>=.5&&A<=2.5?(J=A-.5,F=8*(J*J-2*J)):F=0,A+=.474,V=15.811389+7.5*A-17.5*Math.sqrt(1+A*A),V<=-60?0:(A=Math.exp((F+V)*H),A/=.6609193,A)}function ai(R){return R<0&&(R=0),R=R*.001,13*Math.atan(.76*R)+3.5*Math.atan(R*R/(7.5*7.5))}function Fc(R,A,F,V,J,N,Y,re,W,ve,ne,pe){var He=Fe(T.CBANDS+1),rt=re/(pe>15?2*576:2*192),Re=mt(T.HBLKSIZE),Ze;re/=W;var ue=0,Xe=0;for(Ze=0;Ze<T.CBANDS;Ze++){var vt,Ae;for(vt=ai(re*ue),He[Ze]=re*ue,Ae=ue;ai(re*Ae)-vt<me&&Ae<=W/2;Ae++);for(R[Ze]=Ae-ue,Xe=Ze+1;ue<Ae;)Ee(ue<T.HBLKSIZE),Re[ue++]=Ze;if(ue>W/2){ue=W/2,++Ze;break}}Ee(Ze<T.CBANDS),He[Ze]=re*ue;for(var We=0;We<pe;We++){var Te,Je,Ft,qe,ct;Ft=ve[We],qe=ve[We+1],Te=0|Math.floor(.5+ne*(Ft-.5)),Te<0&&(Te=0),Je=0|Math.floor(.5+ne*(qe-.5)),Je>W/2&&(Je=W/2),F[We]=(Re[Te]+Re[Je])/2,A[We]=Re[Je];var pt=rt*qe;Y[We]=(pt-He[A[We]])/(He[A[We]+1]-He[A[We]]),Y[We]<0?Y[We]=0:Y[We]>1&&(Y[We]=1),ct=ai(re*ve[We]*ne),ct=Math.min(ct,15.5)/15.5,N[We]=Math.pow(10,1.25*(1-Math.cos(Math.PI*ct))-2.5)}ue=0;for(var Vt=0;Vt<Xe;Vt++){var Xr=R[Vt],vt,Zt;vt=ai(re*ue),Zt=ai(re*(ue+Xr-1)),V[Vt]=.5*(vt+Zt),vt=ai(re*(ue-.5)),Zt=ai(re*(ue+Xr-.5)),J[Vt]=Zt-vt,ue+=Xr}return Xe}function Uc(R,A,F,V,J,N){var Y=ot([T.CBANDS,T.CBANDS]),re,W=0;if(N)for(var ve=0;ve<A;ve++)for(re=0;re<A;re++){var ne=Ka(F[ve]-F[re])*V[re];Y[ve][re]=ne*J[ve]}else for(re=0;re<A;re++)for(var pe=15+Math.min(21/F[re],12),He=ii(pe),ve=0;ve<A;ve++){var ne=He*Cr(F[ve]-F[re],pe)*V[re];Y[ve][re]=ne*J[ve]}for(var ve=0;ve<A;ve++){for(re=0;re<A&&!(Y[ve][re]>0);re++);for(R[ve][0]=re,re=A-1;re>0&&!(Y[ve][re]>0);re--);R[ve][1]=re,W+=R[ve][1]-R[ve][0]+1}for(var rt=Fe(W),Re=0,ve=0;ve<A;ve++)for(re=R[ve][0];re<=R[ve][1];re++)rt[Re++]=Y[ve][re];return rt}function Hc(R){var A=ai(R);return A=Math.min(A,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*A))-2.5)}this.psymodel_init=function(R){var A=R.internal_flags,F,V=!0,J=13,N=24,Y=0,re=0,W=-8.25,ve=-4.5,ne=Fe(T.CBANDS),pe=Fe(T.CBANDS),He=Fe(T.CBANDS),rt=R.out_samplerate;switch(R.experimentalZ){default:case 0:V=!0;break;case 1:V=!(R.VBR==be.vbr_mtrh||R.VBR==be.vbr_mt);break;case 2:V=!1;break;case 3:J=8,Y=-1.75,re=-.0125,W=-8.25,ve=-2.25;break}for(A.ms_ener_ratio_old=.25,A.blocktype_old[0]=A.blocktype_old[1]=T.NORM_TYPE,F=0;F<4;++F){for(var ue=0;ue<T.CBANDS;++ue)A.nb_1[F][ue]=1e20,A.nb_2[F][ue]=1e20,A.nb_s1[F][ue]=A.nb_s2[F][ue]=1;for(var Re=0;Re<T.SBMAX_l;Re++)A.en[F].l[Re]=1e20,A.thm[F].l[Re]=1e20;for(var ue=0;ue<3;++ue){for(var Re=0;Re<T.SBMAX_s;Re++)A.en[F].s[Re][ue]=1e20,A.thm[F].s[Re][ue]=1e20;A.nsPsy.lastAttacks[F]=0}for(var ue=0;ue<9;ue++)A.nsPsy.last_en_subshort[F][ue]=10}for(A.loudness_sq_save[0]=A.loudness_sq_save[1]=0,A.npart_l=Fc(A.numlines_l,A.bo_l,A.bm_l,ne,pe,A.mld_l,A.PSY.bo_l_weight,rt,T.BLKSIZE,A.scalefac_band.l,T.BLKSIZE/(2*576),T.SBMAX_l),Ee(A.npart_l<T.CBANDS),F=0;F<A.npart_l;F++){var Ze=Y;ne[F]>=J&&(Ze=re*(ne[F]-J)/(N-J)+Y*(N-ne[F])/(N-J)),He[F]=Math.pow(10,Ze/10),A.numlines_l[F]>0?A.rnumlines_l[F]=1/A.numlines_l[F]:A.rnumlines_l[F]=0}A.s3_ll=Uc(A.s3ind,A.npart_l,ne,pe,He,V);var ue=0;for(F=0;F<A.npart_l;F++){var Xe;Xe=Ie.MAX_VALUE;for(var vt=0;vt<A.numlines_l[F];vt++,ue++){var Ae=rt*ue/(1e3*T.BLKSIZE),We;We=this.ATHformula(Ae*1e3,R)-20,We=Math.pow(10,.1*We),We*=A.numlines_l[F],Xe>We&&(Xe=We)}A.ATH.cb_l[F]=Xe,Xe=-20+ne[F]*20/10,Xe>6&&(Xe=100),Xe<-15&&(Xe=-15),Xe-=8,A.minval_l[F]=Math.pow(10,Xe/10)*A.numlines_l[F]}for(A.npart_s=Fc(A.numlines_s,A.bo_s,A.bm_s,ne,pe,A.mld_s,A.PSY.bo_s_weight,rt,T.BLKSIZE_s,A.scalefac_band.s,T.BLKSIZE_s/(2*192),T.SBMAX_s),Ee(A.npart_s<T.CBANDS),ue=0,F=0;F<A.npart_s;F++){var Xe,Ze=W;ne[F]>=J&&(Ze=ve*(ne[F]-J)/(N-J)+W*(N-ne[F])/(N-J)),He[F]=Math.pow(10,Ze/10),Xe=Ie.MAX_VALUE;for(var vt=0;vt<A.numlines_s[F];vt++,ue++){var Ae=rt*ue/(1e3*T.BLKSIZE_s),We;We=this.ATHformula(Ae*1e3,R)-20,We=Math.pow(10,.1*We),We*=A.numlines_s[F],Xe>We&&(Xe=We)}A.ATH.cb_s[F]=Xe,Xe=-7+ne[F]*7/12,ne[F]>12&&(Xe*=1+Math.log(1+Xe)*3.1),ne[F]<12&&(Xe*=1+Math.log(1-Xe)*2.3),Xe<-15&&(Xe=-15),Xe-=8,A.minval_s[F]=Math.pow(10,Xe/10)*A.numlines_s[F]}A.s3_ss=Uc(A.s3ind_s,A.npart_s,ne,pe,He,V),m(),C.init_fft(A),A.decay=Math.exp(-1*$/(ke*rt/192));{var Te;Te=M,(R.exp_nspsytune&2)!=0&&(Te=1),Math.abs(R.msfix)>0&&(Te=R.msfix),R.msfix=Te;for(var Je=0;Je<A.npart_l;Je++)A.s3ind[Je][1]>A.npart_l-1&&(A.s3ind[Je][1]=A.npart_l-1)}var Ft=576*A.mode_gr/rt;if(A.ATH.decay=Math.pow(10,-12/10*Ft),A.ATH.adjust=.01,A.ATH.adjustLimit=1,Ee(A.bo_l[T.SBMAX_l-1]<=A.npart_l),Ee(A.bo_s[T.SBMAX_s-1]<=A.npart_s),R.ATHtype!=-1){var Ae,qe=R.out_samplerate/T.BLKSIZE,ct=0;for(Ae=0,F=0;F<T.BLKSIZE/2;++F)Ae+=qe,A.ATH.eql_w[F]=1/Math.pow(10,this.ATHformula(Ae,R)/10),ct+=A.ATH.eql_w[F];for(ct=1/ct,F=T.BLKSIZE/2;--F>=0;)A.ATH.eql_w[F]*=ct}{for(var Je=ue=0;Je<A.npart_s;++Je)for(F=0;F<A.numlines_s[Je];++F)++ue;Ee(ue==129);for(var Je=ue=0;Je<A.npart_l;++Je)for(F=0;F<A.numlines_l[Je];++F)++ue;Ee(ue==513)}for(ue=0,F=0;F<A.npart_l;F++){var Ae=rt*(ue+A.numlines_l[F]/2)/(1*T.BLKSIZE);A.mld_cb_l[F]=Hc(Ae),ue+=A.numlines_l[F]}for(;F<T.CBANDS;++F)A.mld_cb_l[F]=1;for(ue=0,F=0;F<A.npart_s;F++){var Ae=rt*(ue+A.numlines_s[F]/2)/(1*T.BLKSIZE_s);A.mld_cb_s[F]=Hc(Ae),ue+=A.numlines_s[F]}for(;F<T.CBANDS;++F)A.mld_cb_s[F]=1;return 0};function na(R,A){R<-.3&&(R=3410),R/=1e3,R=Math.max(.1,R);var F=3.64*Math.pow(R,-.8)-6.8*Math.exp(-.6*Math.pow(R-3.4,2))+6*Math.exp(-.15*Math.pow(R-8.7,2))+(.6+.04*A)*.001*Math.pow(R,4);return F}this.ATHformula=function(R,A){var F;switch(A.ATHtype){case 0:F=na(R,9);break;case 1:F=na(R,-1);break;case 2:F=na(R,0);break;case 3:F=na(R,1)+6;break;case 4:F=na(R,A.ATHcurve);break;default:F=na(R,0);break}return F}}var Ar=br;function yr(C){var $=C;this.ordinal=function(){return $}}yr.STEREO=new yr(0),yr.JOINT_STEREO=new yr(1),yr.DUAL_CHANNEL=new yr(2),yr.MONO=new yr(3),yr.NOT_SET=new yr(4);var ea=yr;function pn(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=ea.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}var a0=pn,Ec={};Ec.SFBMAX=T.SBMAX_s*3;var xi=Ec,Lf=P.new_float,yi=P.new_int;function Ff(){this.xr=Lf(576),this.l3_enc=yi(576),this.scalefac=yi(xi.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=yi(3),this.subblock_gain=yi(3+1),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=yi(xi.SFBMAX),this.window=yi(xi.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=yi(4),this.max_nonzero_coeff=0;var C=this;function $(Z){return new Int32Array(Z)}function ie(Z){return new Float32Array(Z)}this.assign=function(Z){C.xr=ie(Z.xr),C.l3_enc=$(Z.l3_enc),C.scalefac=$(Z.scalefac),C.xrpow_max=Z.xrpow_max,C.part2_3_length=Z.part2_3_length,C.big_values=Z.big_values,C.count1=Z.count1,C.global_gain=Z.global_gain,C.scalefac_compress=Z.scalefac_compress,C.block_type=Z.block_type,C.mixed_block_flag=Z.mixed_block_flag,C.table_select=$(Z.table_select),C.subblock_gain=$(Z.subblock_gain),C.region0_count=Z.region0_count,C.region1_count=Z.region1_count,C.preflag=Z.preflag,C.scalefac_scale=Z.scalefac_scale,C.count1table_select=Z.count1table_select,C.part2_length=Z.part2_length,C.sfb_lmax=Z.sfb_lmax,C.sfb_smin=Z.sfb_smin,C.psy_lmax=Z.psy_lmax,C.sfbmax=Z.sfbmax,C.psymax=Z.psymax,C.sfbdivide=Z.sfbdivide,C.width=$(Z.width),C.window=$(Z.window),C.count1bits=Z.count1bits,C.sfb_partition_table=Z.sfb_partition_table.slice(0),C.slen=$(Z.slen),C.max_nonzero_coeff=Z.max_nonzero_coeff}}var Oo=Ff,wc=P.new_int;function Uf(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[wc(4),wc(4)];for(var C=0;C<2;C++)for(var $=0;$<2;$++)this.tt[C][$]=new Oo}var Hf=Uf,Lo=P.System,Fo=P.new_int;function Vf(C,$,ie,Z){this.l=Fo(1+T.SBMAX_l),this.s=Fo(1+T.SBMAX_s),this.psfb21=Fo(1+T.PSFB21),this.psfb12=Fo(1+T.PSFB12);var ye=this.l,Q=this.s;arguments.length==4&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],Lo.arraycopy(this.arrL,0,ye,0,Math.min(this.arrL.length,this.l.length)),Lo.arraycopy(this.arrS,0,Q,0,Math.min(this.arrS.length,this.s.length)),Lo.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),Lo.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}var Nn=Vf,o0=P.new_float,qf=P.new_float_n,zf=P.new_int;function jf(){this.last_en_subshort=qf([4,9]),this.lastAttacks=zf(4),this.pefirbuf=o0(19),this.longfact=o0(T.SBMAX_l),this.shortfact=o0(T.SBMAX_s),this.attackthre=0,this.attackthre_s=0}var Gf=jf;function Xf(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0}var Kf=Xf,Wf=P.new_byte,Yf=P.new_double,on=P.new_float,Ei=P.new_float_n,hn=P.new_int,Uo=P.new_int_n;jn.MFSIZE=3*1152+T.ENCDELAY-T.MDCTDELAY,jn.MAX_HEADER_BUF=256,jn.MAX_BITS_PER_CHANNEL=4095,jn.MAX_BITS_PER_GRANULE=7680,jn.BPC=320;function jn(){var C=40;this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=Ei([2,jn.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new Hf,this.ms_ratio=on(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=hn(2),this.CurrentStep=hn(2),this.masking_lower=0,this.bv_scf=hn(576),this.pseudohalf=hn(xi.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*jn.BPC+1),this.itime=Yf(2),this.sideinfo_len=0,this.sb_sample=Ei([2,2,18,T.SBLIMIT]),this.amp_filter=on(32);function $(){this.write_timing=0,this.ptr=0,this.buf=Wf(C)}this.header=new Array(jn.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new Nn,this.minval_l=on(T.CBANDS),this.minval_s=on(T.CBANDS),this.nb_1=Ei([4,T.CBANDS]),this.nb_2=Ei([4,T.CBANDS]),this.nb_s1=Ei([4,T.CBANDS]),this.nb_s2=Ei([4,T.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=on(4),this.loudness_sq=Ei([2,2]),this.loudness_sq_save=on(2),this.mld_l=on(T.SBMAX_l),this.mld_s=on(T.SBMAX_s),this.bm_l=hn(T.SBMAX_l),this.bo_l=hn(T.SBMAX_l),this.bm_s=hn(T.SBMAX_s),this.bo_s=hn(T.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=Uo([T.CBANDS,2]),this.s3ind_s=Uo([T.CBANDS,2]),this.numlines_s=hn(T.CBANDS),this.numlines_l=hn(T.CBANDS),this.rnumlines_l=on(T.CBANDS),this.mld_cb_l=on(T.CBANDS),this.mld_cb_s=on(T.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=on(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=hn(2),this.nsPsy=new Gf,this.VBR_seek_table=new Kf,this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=Uo([16,4+1]),this.bitrate_blockType_Hist=Uo([16,4+1+1]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var ie=0;ie<this.en.length;ie++)this.en[ie]=new sr;for(var ie=0;ie<this.thm.length;ie++)this.thm[ie]=new sr;for(var ie=0;ie<this.header.length;ie++)this.header[ie]=new $}var Bt=jn,wi=P.new_float;function $f(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=wi(T.SBMAX_l),this.s=wi(T.SBMAX_s),this.psfb21=wi(T.PSFB21),this.psfb12=wi(T.PSFB12),this.cb_l=wi(T.CBANDS),this.cb_s=wi(T.CBANDS),this.eql_w=wi(T.BLKSIZE/2)}var Zf=$f,Or=P.System,Rc=P.Arrays;Ut.STEPS_per_dB=100,Ut.MAX_dB=120,Ut.GAIN_NOT_ENOUGH_SAMPLES=-24601,Ut.GAIN_ANALYSIS_ERROR=0,Ut.GAIN_ANALYSIS_OK=1,Ut.INIT_GAIN_ANALYSIS_ERROR=0,Ut.INIT_GAIN_ANALYSIS_OK=1,Ut.YULE_ORDER=10,Ut.MAX_ORDER=Ut.YULE_ORDER,Ut.MAX_SAMP_FREQ=48e3,Ut.RMS_WINDOW_TIME_NUMERATOR=1,Ut.RMS_WINDOW_TIME_DENOMINATOR=20,Ut.MAX_SAMPLES_PER_WINDOW=Ut.MAX_SAMP_FREQ*Ut.RMS_WINDOW_TIME_NUMERATOR/Ut.RMS_WINDOW_TIME_DENOMINATOR+1;function Ut(){var C=64.82,$=Ut.YULE_ORDER,ie=.95,Z=Ut.MAX_SAMP_FREQ,ye=Ut.RMS_WINDOW_TIME_NUMERATOR,Q=Ut.RMS_WINDOW_TIME_DENOMINATOR,me=Ut.MAX_SAMPLES_PER_WINDOW,Ne=[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.26408300200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]],ke=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function G(o,I,H,O,g,_){for(;g--!=0;)H[O]=1e-10+o[I+0]*_[0]-H[O-1]*_[1]+o[I-1]*_[2]-H[O-2]*_[3]+o[I-2]*_[4]-H[O-3]*_[5]+o[I-3]*_[6]-H[O-4]*_[7]+o[I-4]*_[8]-H[O-5]*_[9]+o[I-5]*_[10]-H[O-6]*_[11]+o[I-6]*_[12]-H[O-7]*_[13]+o[I-7]*_[14]-H[O-8]*_[15]+o[I-8]*_[16]-H[O-9]*_[17]+o[I-9]*_[18]-H[O-10]*_[19]+o[I-10]*_[20],++O,++I}function de(o,I,H,O,g,_){for(;g--!=0;)H[O]=o[I+0]*_[0]-H[O-1]*_[1]+o[I-1]*_[2]-H[O-2]*_[3]+o[I-2]*_[4],++O,++I}function he(o,I){for(var H=0;H<MAX_ORDER;H++)o.linprebuf[H]=o.lstepbuf[H]=o.loutbuf[H]=o.rinprebuf[H]=o.rstepbuf[H]=o.routbuf[H]=0;switch(0|I){case 48e3:o.reqindex=0;break;case 44100:o.reqindex=1;break;case 32e3:o.reqindex=2;break;case 24e3:o.reqindex=3;break;case 22050:o.reqindex=4;break;case 16e3:o.reqindex=5;break;case 12e3:o.reqindex=6;break;case 11025:o.reqindex=7;break;case 8e3:o.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return o.sampleWindow=0|(I*ye+Q-1)/Q,o.lsum=0,o.rsum=0,o.totsamp=0,Rc.ill(o.A,0),INIT_GAIN_ANALYSIS_OK}this.InitGainAnalysis=function(o,I){return he(o,I)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(o.linpre=MAX_ORDER,o.rinpre=MAX_ORDER,o.lstep=MAX_ORDER,o.rstep=MAX_ORDER,o.lout=MAX_ORDER,o.rout=MAX_ORDER,Rc.fill(o.B,0),INIT_GAIN_ANALYSIS_OK)};function M(o){return o*o}this.AnalyzeSamples=function(o,I,H,O,g,_,k){var q,w,c,L,y,u,m;if(_==0)return GAIN_ANALYSIS_OK;switch(m=0,y=_,k){case 1:O=I,g=H;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(_<MAX_ORDER?(Or.arraycopy(I,H,o.linprebuf,MAX_ORDER,_),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER,_)):(Or.arraycopy(I,H,o.linprebuf,MAX_ORDER,MAX_ORDER),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER,MAX_ORDER));y>0;){u=y>o.sampleWindow-o.totsamp?o.sampleWindow-o.totsamp:y,m<MAX_ORDER?(q=o.linpre+m,w=o.linprebuf,c=o.rinpre+m,L=o.rinprebuf,u>MAX_ORDER-m&&(u=MAX_ORDER-m)):(q=H+m,w=I,c=g+m,L=O),G(w,q,o.lstepbuf,o.lstep+o.totsamp,u,Ne[o.reqindex]),G(L,c,o.rstepbuf,o.rstep+o.totsamp,u,Ne[o.reqindex]),de(o.lstepbuf,o.lstep+o.totsamp,o.loutbuf,o.lout+o.totsamp,u,ke[o.reqindex]),de(o.rstepbuf,o.rstep+o.totsamp,o.routbuf,o.rout+o.totsamp,u,ke[o.reqindex]),q=o.lout+o.totsamp,w=o.loutbuf,c=o.rout+o.totsamp,L=o.routbuf;for(var b=u%8;b--!=0;)o.lsum+=M(w[q++]),o.rsum+=M(L[c++]);for(b=u/8;b--!=0;)o.lsum+=M(w[q+0])+M(w[q+1])+M(w[q+2])+M(w[q+3])+M(w[q+4])+M(w[q+5])+M(w[q+6])+M(w[q+7]),q+=8,o.rsum+=M(L[c+0])+M(L[c+1])+M(L[c+2])+M(L[c+3])+M(L[c+4])+M(L[c+5])+M(L[c+6])+M(L[c+7]),c+=8;if(y-=u,m+=u,o.totsamp+=u,o.totsamp==o.sampleWindow){var l=Ut.STEPS_per_dB*10*Math.log10((o.lsum+o.rsum)/o.totsamp*.5+1e-37),h=l<=0?0:0|l;h>=o.A.length&&(h=o.A.length-1),o.A[h]++,o.lsum=o.rsum=0,Or.arraycopy(o.loutbuf,o.totsamp,o.loutbuf,0,MAX_ORDER),Or.arraycopy(o.routbuf,o.totsamp,o.routbuf,0,MAX_ORDER),Or.arraycopy(o.lstepbuf,o.totsamp,o.lstepbuf,0,MAX_ORDER),Or.arraycopy(o.rstepbuf,o.totsamp,o.rstepbuf,0,MAX_ORDER),o.totsamp=0}if(o.totsamp>o.sampleWindow)return GAIN_ANALYSIS_ERROR}return _<MAX_ORDER?(Or.arraycopy(o.linprebuf,_,o.linprebuf,0,MAX_ORDER-_),Or.arraycopy(o.rinprebuf,_,o.rinprebuf,0,MAX_ORDER-_),Or.arraycopy(I,H,o.linprebuf,MAX_ORDER-_,_),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER-_,_)):(Or.arraycopy(I,H+_-MAX_ORDER,o.linprebuf,0,MAX_ORDER),Or.arraycopy(O,g+_-MAX_ORDER,o.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK};function K(o,I){var H,O=0;for(H=0;H<I;H++)O+=o[H];if(O==0)return GAIN_NOT_ENOUGH_SAMPLES;var g=0|Math.ceil(O*(1-ie));for(H=I;H-- >0&&!((g-=o[H])<=0););return C-H/Ut.STEPS_per_dB}this.GetTitleGain=function(o){for(var I=K(o.A,o.A.length),H=0;H<o.A.length;H++)o.B[H]+=o.A[H],o.A[H]=0;for(var H=0;H<MAX_ORDER;H++)o.linprebuf[H]=o.lstepbuf[H]=o.loutbuf[H]=o.rinprebuf[H]=o.rstepbuf[H]=o.routbuf[H]=0;return o.totsamp=0,o.lsum=o.rsum=0,I}}var Ir=Ut,ta=P.new_float,Tc=P.new_int;function Qf(){this.linprebuf=ta(Ir.MAX_ORDER*2),this.linpre=0,this.lstepbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.lstep=0,this.loutbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.lout=0,this.rinprebuf=ta(Ir.MAX_ORDER*2),this.rinpre=0,this.rstepbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.rstep=0,this.routbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=Tc(0|Ir.STEPS_per_dB*Ir.MAX_dB),this.B=Tc(0|Ir.STEPS_per_dB*Ir.MAX_dB)}var Jf=Qf;function ed(C){this.bits=C}var Ac=ed,Ic=P.new_float,td=P.new_int,Cc=P.assert;function rd(C){var $=C;this.quantize=$,this.iteration_loop=function(ie,Z,ye,Q){var me=ie.internal_flags,Ne=Ic(xi.SFBMAX),ke=Ic(576),G=td(2),de=0,he,M=me.l3_side,K=new Ac(de);this.quantize.rv.ResvFrameBegin(ie,K),de=K.bits;for(var o=0;o<me.mode_gr;o++){he=this.quantize.qupvt.on_pe(ie,Z,G,de,o,o),me.mode_ext==T.MPG_MD_MS_LR&&(this.quantize.ms_convert(me.l3_side,o),this.quantize.qupvt.reduce_side(G,ye[o],de,he));for(var I=0;I<me.channels_out;I++){var H,O,g=M.tt[o][I];g.block_type!=T.SHORT_TYPE?(H=0,O=me.PSY.mask_adjust-H):(H=0,O=me.PSY.mask_adjust_short-H),me.masking_lower=Math.pow(10,O*.1),this.quantize.init_outer_loop(me,g),this.quantize.init_xrpow(me,g,ke)&&(this.quantize.qupvt.calc_xmin(ie,Q[o][I],g,Ne),this.quantize.outer_loop(ie,g,Ne,ke,I,G[I])),this.quantize.iteration_finish_one(me,o,I),Cc(g.part2_3_length<=Bt.MAX_BITS_PER_CHANNEL),Cc(g.part2_3_length<=G[I])}}this.quantize.rv.ResvFrameEnd(me,de)}}var nd=rd;function Et(C,$,ie,Z){this.xlen=C,this.linmax=$,this.table=ie,this.hlen=Z}var Me={};Me.t1HB=[1,1,1,0],Me.t2HB=[1,2,1,3,1,1,3,2,0],Me.t3HB=[3,2,1,1,1,1,3,2,0],Me.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],Me.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],Me.t7HB=[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],Me.t8HB=[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],Me.t9HB=[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],Me.t10HB=[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],Me.t11HB=[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],Me.t12HB=[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],Me.t13HB=[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],Me.t15HB=[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],Me.t16HB=[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],Me.t24HB=[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],Me.t32HB=[1<<0,5<<1,4<<1,5<<2,6<<1,5<<2,4<<2,4<<3,7<<1,3<<2,6<<2,0<<3,7<<2,2<<3,3<<3,1<<4],Me.t33HB=[15<<0,14<<1,13<<1,12<<2,11<<1,10<<2,9<<2,8<<3,7<<1,6<<2,5<<2,4<<3,3<<2,2<<3,1<<3,0<<4],Me.t1l=[1,4,3,5],Me.t2l=[1,4,7,4,5,7,6,7,8],Me.t3l=[2,3,7,4,4,7,6,7,8],Me.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],Me.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],Me.t7l=[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],Me.t8l=[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],Me.t9l=[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],Me.t10l=[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],Me.t11l=[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],Me.t12l=[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],Me.t13l=[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],Me.t15l=[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],Me.t16_5l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],Me.t16l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],Me.t24l=[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],Me.t32l=[1+0,4+1,4+1,5+2,4+1,6+2,5+2,6+3,4+1,5+2,5+2,6+3,5+2,6+3,6+3,6+4],Me.t33l=[4+0,4+1,4+1,4+2,4+1,4+2,4+2,4+3,4+1,4+2,4+2,4+3,4+2,4+3,4+3,4+4],Me.ht=[new Et(0,0,null,null),new Et(2,0,Me.t1HB,Me.t1l),new Et(3,0,Me.t2HB,Me.t2l),new Et(3,0,Me.t3HB,Me.t3l),new Et(0,0,null,null),new Et(4,0,Me.t5HB,Me.t5l),new Et(4,0,Me.t6HB,Me.t6l),new Et(6,0,Me.t7HB,Me.t7l),new Et(6,0,Me.t8HB,Me.t8l),new Et(6,0,Me.t9HB,Me.t9l),new Et(8,0,Me.t10HB,Me.t10l),new Et(8,0,Me.t11HB,Me.t11l),new Et(8,0,Me.t12HB,Me.t12l),new Et(16,0,Me.t13HB,Me.t13l),new Et(0,0,null,Me.t16_5l),new Et(16,0,Me.t15HB,Me.t15l),new Et(1,1,Me.t16HB,Me.t16l),new Et(2,3,Me.t16HB,Me.t16l),new Et(3,7,Me.t16HB,Me.t16l),new Et(4,15,Me.t16HB,Me.t16l),new Et(6,63,Me.t16HB,Me.t16l),new Et(8,255,Me.t16HB,Me.t16l),new Et(10,1023,Me.t16HB,Me.t16l),new Et(13,8191,Me.t16HB,Me.t16l),new Et(4,15,Me.t24HB,Me.t24l),new Et(5,31,Me.t24HB,Me.t24l),new Et(6,63,Me.t24HB,Me.t24l),new Et(7,127,Me.t24HB,Me.t24l),new Et(8,255,Me.t24HB,Me.t24l),new Et(9,511,Me.t24HB,Me.t24l),new Et(11,2047,Me.t24HB,Me.t24l),new Et(13,8191,Me.t24HB,Me.t24l),new Et(0,0,Me.t32HB,Me.t32l),new Et(0,0,Me.t33HB,Me.t33l)],Me.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],Me.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],Me.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],Me.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],Me.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],Me.scfsi_band=[0,6,11,16,21];var bt=Me,Ri=P.VbrMode,Ho=P.Float,s0=P.Util,Ti=P.new_float,id=P.new_int,Gn=P.assert;jr.Q_MAX=256+1,jr.Q_MAX2=116,jr.LARGE_BITS=1e5,jr.IXMAX_VAL=8206;function jr(){var C=null,$=null,ie=null;this.setModules=function(_,k,q){C=_,$=k,ie=q};function Z(_){return Gn(0<=_+jr.Q_MAX2&&_<jr.Q_MAX),M[_+jr.Q_MAX2]}this.IPOW20=function(_){return Gn(0<=_&&_<jr.Q_MAX),K[_]};var ye=2220446049250313e-31,Q=jr.IXMAX_VAL,me=Q+2,Ne=jr.Q_MAX,ke=jr.Q_MAX2,G=jr.LARGE_BITS,de=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var he=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=he,this.sfBandIndex=[new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0/3,24/3,48/3,72/3,108/3,156/3,216/3,288/3,372/3,480/3,486/3,492/3,498/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var M=Ti(Ne+ke+1),K=Ti(Ne),o=Ti(me),I=Ti(me);this.adj43=I;function H(_,k){var q=ie.ATHformula(k,_);return q-=de,q=Math.pow(10,q/10+_.ATHlower),q}function O(_){for(var k=_.internal_flags.ATH.l,q=_.internal_flags.ATH.psfb21,w=_.internal_flags.ATH.s,c=_.internal_flags.ATH.psfb12,L=_.internal_flags,y=_.out_samplerate,u=0;u<T.SBMAX_l;u++){var m=L.scalefac_band.l[u],b=L.scalefac_band.l[u+1];k[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/1152,x=H(_,h);k[u]=Math.min(k[u],x)}}for(var u=0;u<T.PSFB21;u++){var m=L.scalefac_band.psfb21[u],b=L.scalefac_band.psfb21[u+1];q[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/1152,x=H(_,h);q[u]=Math.min(q[u],x)}}for(var u=0;u<T.SBMAX_s;u++){var m=L.scalefac_band.s[u],b=L.scalefac_band.s[u+1];w[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/384,x=H(_,h);w[u]=Math.min(w[u],x)}w[u]*=L.scalefac_band.s[u+1]-L.scalefac_band.s[u]}for(var u=0;u<T.PSFB12;u++){var m=L.scalefac_band.psfb12[u],b=L.scalefac_band.psfb12[u+1];c[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/384,x=H(_,h);c[u]=Math.min(c[u],x)}c[u]*=L.scalefac_band.s[13]-L.scalefac_band.s[12]}if(_.noATH){for(var u=0;u<T.SBMAX_l;u++)k[u]=1e-20;for(var u=0;u<T.PSFB21;u++)q[u]=1e-20;for(var u=0;u<T.SBMAX_s;u++)w[u]=1e-20;for(var u=0;u<T.PSFB12;u++)c[u]=1e-20}L.ATH.floor=10*Math.log10(H(_,-1))}this.iteration_init=function(_){var k=_.internal_flags,q=k.l3_side,w;if(k.iteration_init_init==0){for(k.iteration_init_init=1,q.main_data_begin=0,O(_),o[0]=0,w=1;w<me;w++)o[w]=Math.pow(w,4/3);for(w=0;w<me-1;w++)I[w]=w+1-Math.pow(.5*(o[w]+o[w+1]),.75);for(I[w]=.5,w=0;w<Ne;w++)K[w]=Math.pow(2,(w-210)*-.1875);for(w=0;w<=Ne+ke;w++)M[w]=Math.pow(2,(w-210-ke)*.25);C.huffman_init(k);{var c,L,y,u;for(w=_.exp_nspsytune>>2&63,w>=32&&(w-=64),c=Math.pow(10,w/4/10),w=_.exp_nspsytune>>8&63,w>=32&&(w-=64),L=Math.pow(10,w/4/10),w=_.exp_nspsytune>>14&63,w>=32&&(w-=64),y=Math.pow(10,w/4/10),w=_.exp_nspsytune>>20&63,w>=32&&(w-=64),u=y*Math.pow(10,w/4/10),w=0;w<T.SBMAX_l;w++){var m;w<=6?m=c:w<=13?m=L:w<=20?m=y:m=u,k.nsPsy.longfact[w]=m}for(w=0;w<T.SBMAX_s;w++){var m;w<=5?m=c:w<=10?m=L:w<=11?m=y:m=u,k.nsPsy.shortfact[w]=m}}}},this.on_pe=function(_,k,q,w,c,L){var y=_.internal_flags,u=0,m,b=id(2),l,h=new Ac(u),x=$.ResvMaxBits(_,w,h,L);u=h.bits;var E=u+x;for(E>Bt.MAX_BITS_PER_GRANULE&&(E=Bt.MAX_BITS_PER_GRANULE),m=0,l=0;l<y.channels_out;++l)q[l]=Math.min(Bt.MAX_BITS_PER_CHANNEL,u/y.channels_out),b[l]=0|q[l]*k[c][l]/700-q[l],b[l]>w*3/4&&(b[l]=w*3/4),b[l]<0&&(b[l]=0),b[l]+q[l]>Bt.MAX_BITS_PER_CHANNEL&&(b[l]=Math.max(0,Bt.MAX_BITS_PER_CHANNEL-q[l])),m+=b[l];if(m>x)for(l=0;l<y.channels_out;++l)b[l]=x*b[l]/m;for(l=0;l<y.channels_out;++l)q[l]+=b[l],x-=b[l];for(m=0,l=0;l<y.channels_out;++l)m+=q[l];if(m>Bt.MAX_BITS_PER_GRANULE){var X=0;for(l=0;l<y.channels_out;++l)q[l]*=Bt.MAX_BITS_PER_GRANULE,q[l]/=m,X+=q[l];Gn(X<=Bt.MAX_BITS_PER_GRANULE)}return E},this.reduce_side=function(_,k,q,w){Gn(w<=Bt.MAX_BITS_PER_GRANULE),Gn(_[0]+_[1]<=Bt.MAX_BITS_PER_GRANULE);var c=.33*(.5-k)/.5;c<0&&(c=0),c>.5&&(c=.5);var L=0|c*.5*(_[0]+_[1]);L>Bt.MAX_BITS_PER_CHANNEL-_[0]&&(L=Bt.MAX_BITS_PER_CHANNEL-_[0]),L<0&&(L=0),_[1]>=125&&(_[1]-L>125?(_[0]<q&&(_[0]+=L),_[1]-=L):(_[0]+=_[1]-125,_[1]=125)),L=_[0]+_[1],L>w&&(_[0]=w*_[0]/L,_[1]=w*_[1]/L),Gn(_[0]<=Bt.MAX_BITS_PER_CHANNEL),Gn(_[1]<=Bt.MAX_BITS_PER_CHANNEL),Gn(_[0]+_[1]<=Bt.MAX_BITS_PER_GRANULE)},this.athAdjust=function(_,k,q){var w=90.30873362,c=94.82444863,L=s0.FAST_LOG10_X(k,10),y=_*_,u=0;return L-=q,y>1e-20&&(u=1+s0.FAST_LOG10_X(y,10/w)),u<0&&(u=0),L*=u,L+=q+w-c,Math.pow(10,.1*L)},this.calc_xmin=function(_,k,q,w){var c=0,L=_.internal_flags,y,u=0,m=0,b=L.ATH,l=q.xr,h=_.VBR==Ri.vbr_mtrh?1:0,x=L.masking_lower;for((_.VBR==Ri.vbr_mtrh||_.VBR==Ri.vbr_mt)&&(x=1),y=0;y<q.psy_lmax;y++){var E,X,U,j,Se,f;_.VBR==Ri.vbr_rh||_.VBR==Ri.vbr_mtrh?X=athAdjust(b.adjust,b.l[y],b.floor):X=b.adjust*b.l[y],Se=q.width[y],U=X/Se,j=ye,f=Se>>1,E=0;do{var S,fe;S=l[u]*l[u],E+=S,j+=S<U?S:U,u++,fe=l[u]*l[u],E+=fe,j+=fe<U?fe:U,u++}while(--f>0);if(E>X&&m++,y==T.SBPSY_l){var _e=X*L.nsPsy.longfact[y];j<_e&&(j=_e)}if(h!=0&&(X=j),!_.ATHonly){var Oe=k.en.l[y];if(Oe>0){var _e;_e=E*k.thm.l[y]*x/Oe,h!=0&&(_e*=L.nsPsy.longfact[y]),X<_e&&(X=_e)}}h!=0?w[c++]=X:w[c++]=X*L.nsPsy.longfact[y]}var Ue=575;if(q.block_type!=T.SHORT_TYPE)for(var je=576;je--!=0&&Xn.EQ(l[je],0);)Ue=je;q.max_nonzero_coeff=Ue;for(var ze=q.sfb_smin;y<q.psymax;ze++,y+=3){var Se,nt,Ke;for(_.VBR==Ri.vbr_rh||_.VBR==Ri.vbr_mtrh?Ke=athAdjust(b.adjust,b.s[ze],b.floor):Ke=b.adjust*b.s[ze],Se=q.width[y],nt=0;nt<3;nt++){var E=0,X,U,j,f=Se>>1;U=Ke/Se,j=ye;do{var S,fe;S=l[u]*l[u],E+=S,j+=S<U?S:U,u++,fe=l[u]*l[u],E+=fe,j+=fe<U?fe:U,u++}while(--f>0);if(E>Ke&&m++,ze==T.SBPSY_s){var _e=Ke*L.nsPsy.shortfact[ze];j<_e&&(j=_e)}if(h!=0?X=j:X=Ke,!_.ATHonly&&!_.ATHshort){var Oe=k.en.s[ze][nt];if(Oe>0){var _e;_e=E*k.thm.s[ze][nt]*x/Oe,h!=0&&(_e*=L.nsPsy.shortfact[ze]),X<_e&&(X=_e)}}h!=0?w[c++]=X:w[c++]=X*L.nsPsy.shortfact[ze]}_.useTemporal&&(w[c-3]>w[c-3+1]&&(w[c-3+1]+=(w[c-3]-w[c-3+1])*L.decay),w[c-3+1]>w[c-3+2]&&(w[c-3+2]+=(w[c-3+1]-w[c-3+2])*L.decay))}return m};function g(_){this.s=_}this.calc_noise_core=function(_,k,q,w){var c=0,L=k.s,y=_.l3_enc;if(L>_.count1)for(;q--!=0;){var u;u=_.xr[L],L++,c+=u*u,u=_.xr[L],L++,c+=u*u}else if(L>_.big_values){var m=Ti(2);for(m[0]=0,m[1]=w;q--!=0;){var u;u=Math.abs(_.xr[L])-m[y[L]],L++,c+=u*u,u=Math.abs(_.xr[L])-m[y[L]],L++,c+=u*u}}else for(;q--!=0;){var u;u=Math.abs(_.xr[L])-o[y[L]]*w,L++,c+=u*u,u=Math.abs(_.xr[L])-o[y[L]]*w,L++,c+=u*u}return k.s=L,c},this.calc_noise=function(_,k,q,w,c){var L=0,y=0,u,m,b=0,l=0,h=0,x=-20,E=0,X=_.scalefac,U=0;for(w.over_SSD=0,u=0;u<_.psymax;u++){var j=_.global_gain-(X[U++]+(_.preflag!=0?he[u]:0)<<_.scalefac_scale+1)-_.subblock_gain[_.window[u]]*8,Se=0;if(c!=null&&c.step[u]==j)Se=c.noise[u],E+=_.width[u],q[L++]=Se/k[y++],Se=c.noise_log[u];else{var f=Z(j);if(m=_.width[u]>>1,E+_.width[u]>_.max_nonzero_coeff){var S;S=_.max_nonzero_coeff-E+1,S>0?m=S>>1:m=0}var fe=new g(E);Se=this.calc_noise_core(_,fe,m,f),E=fe.s,c!=null&&(c.step[u]=j,c.noise[u]=Se),Se=q[L++]=Se/k[y++],Se=s0.FAST_LOG10(Math.max(Se,1e-20)),c!=null&&(c.noise_log[u]=Se)}if(c!=null&&(c.global_gain=_.global_gain),h+=Se,Se>0){var _e;_e=Math.max(0|Se*10+.5,1),w.over_SSD+=_e*_e,b++,l+=Se}x=Math.max(x,Se)}return w.over_count=b,w.tot_noise=h,w.over_noise=l,w.max_noise=x,b},this.set_pinfo=function(_,k,q,w,c){var L=_.internal_flags,y,u,m,b,l,h=k.scalefac_scale==0?.5:1,x=k.scalefac,E=Ti(L3Side.SFBMAX),X=Ti(L3Side.SFBMAX),U=new CalcNoiseResult;calc_xmin(_,q,k,E),calc_noise(k,E,X,U,null);var j=0;for(u=k.sfb_lmax,k.block_type!=T.SHORT_TYPE&&k.mixed_block_flag==0&&(u=22),y=0;y<u;y++){var Se=L.scalefac_band.l[y],f=L.scalefac_band.l[y+1],S=f-Se;for(b=0;j<f;j++)b+=k.xr[j]*k.xr[j];b/=S,l=1e15,L.pinfo.en[w][c][y]=l*b,L.pinfo.xfsf[w][c][y]=l*E[y]*X[y]/S,q.en.l[y]>0&&!_.ATHonly?b=b/q.en.l[y]:b=0,L.pinfo.thr[w][c][y]=l*Math.max(b*q.thm.l[y],L.ATH.l[y]),L.pinfo.LAMEsfb[w][c][y]=0,k.preflag!=0&&y>=11&&(L.pinfo.LAMEsfb[w][c][y]=-h*he[y]),y<T.SBPSY_l&&(Gn(x[y]>=0),L.pinfo.LAMEsfb[w][c][y]-=h*x[y])}if(k.block_type==T.SHORT_TYPE)for(u=y,y=k.sfb_smin;y<T.SBMAX_s;y++)for(var Se=L.scalefac_band.s[y],f=L.scalefac_band.s[y+1],S=f-Se,fe=0;fe<3;fe++){for(b=0,m=Se;m<f;m++)b+=k.xr[j]*k.xr[j],j++;b=Math.max(b/S,1e-20),l=1e15,L.pinfo.en_s[w][c][3*y+fe]=l*b,L.pinfo.xfsf_s[w][c][3*y+fe]=l*E[u]*X[u]/S,q.en.s[y][fe]>0?b=b/q.en.s[y][fe]:b=0,(_.ATHonly||_.ATHshort)&&(b=0),L.pinfo.thr_s[w][c][3*y+fe]=l*Math.max(b*q.thm.s[y][fe],L.ATH.s[y]),L.pinfo.LAMEsfb_s[w][c][3*y+fe]=-2*k.subblock_gain[fe],y<T.SBPSY_s&&(L.pinfo.LAMEsfb_s[w][c][3*y+fe]-=h*x[u]),u++}L.pinfo.LAMEqss[w][c]=k.global_gain,L.pinfo.LAMEmainbits[w][c]=k.part2_3_length+k.part2_length,L.pinfo.LAMEsfbits[w][c]=k.part2_length,L.pinfo.over[w][c]=U.over_count,L.pinfo.max_noise[w][c]=U.max_noise*10,L.pinfo.over_noise[w][c]=U.over_noise*10,L.pinfo.tot_noise[w][c]=U.tot_noise*10,L.pinfo.over_SSD[w][c]=U.over_SSD}}var ti=jr,ad=P.System,od=P.Arrays,za=P.new_int,sn=P.assert;function l0(){var C=null;this.qupvt=null,this.setModules=function(u){this.qupvt=u,C=u};function $(u){this.bits=0|u}var ie=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function Z(u,m,b,l,h,x){var E=.5946/m;for(sn(u>0),u=u>>1;u--!=0;)h[x++]=E>b[l++]?0:1,h[x++]=E>b[l++]?0:1}function ye(u,m,b,l,h,x){sn(u>0),u=u>>1;var E=u%2;for(u=u>>1;u--!=0;){var X,U,j,Se,f,S,fe,_e;X=b[l++]*m,U=b[l++]*m,f=0|X,j=b[l++]*m,S=0|U,Se=b[l++]*m,fe=0|j,X+=C.adj43[f],_e=0|Se,U+=C.adj43[S],h[x++]=0|X,j+=C.adj43[fe],h[x++]=0|U,Se+=C.adj43[_e],h[x++]=0|j,h[x++]=0|Se}if(E!=0){var X,U,f,S;X=b[l++]*m,U=b[l++]*m,f=0|X,S=0|U,X+=C.adj43[f],U+=C.adj43[S],h[x++]=0|X,h[x++]=0|U}}function Q(u,m,b,l,h){var x,E,X=0,U,j=0,Se=0,f=0,S=m,fe=0,_e=S,Oe=0,Ue=u,je=0;for(U=h!=null&&l.global_gain==h.global_gain,l.block_type==T.SHORT_TYPE?E=38:E=21,x=0;x<=E;x++){var ze=-1;if((U||l.block_type==T.NORM_TYPE)&&(ze=l.global_gain-(l.scalefac[x]+(l.preflag!=0?C.pretab[x]:0)<<l.scalefac_scale+1)-l.subblock_gain[l.window[x]]*8),sn(l.width[x]>=0),U&&h.step[x]==ze)j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0),Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0);else{var nt=l.width[x];if(X+l.width[x]>l.max_nonzero_coeff){var Ke;Ke=l.max_nonzero_coeff-X+1,od.fill(m,l.max_nonzero_coeff,576,0),nt=Ke,nt<0&&(nt=0),x=E+1}if(j==0&&Se==0&&(_e=S,Oe=fe,Ue=u,je=f),h!=null&&h.sfb_count1>0&&x>=h.sfb_count1&&h.step[x]>0&&ze>=h.step[x]?(j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0,_e=S,Oe=fe,Ue=u,je=f),Se+=nt):(Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0,_e=S,Oe=fe,Ue=u,je=f),j+=nt),nt<=0){Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0),j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0);break}}x<=E&&(fe+=l.width[x],f+=l.width[x],X+=l.width[x])}j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0),Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0)}function me(u,m,b){var l=0,h=0;do{var x=u[m++],E=u[m++];l<x&&(l=x),h<E&&(h=E)}while(m<b);return l<h&&(l=h),l}function Ne(u,m,b,l,h,x){var E=bt.ht[l].xlen*65536+bt.ht[h].xlen,X=0,U;do{var j=u[m++],Se=u[m++];j!=0&&(j>14&&(j=15,X+=E),j*=16),Se!=0&&(Se>14&&(Se=15,X+=E),j+=Se),X+=bt.largetbl[j]}while(m<b);return U=X&65535,X>>=16,X>U&&(X=U,l=h),x.bits+=X,l}function ke(u,m,b,l){var h=0,x=bt.ht[1].hlen;do{var E=u[m+0]*2+u[m+1];m+=2,h+=x[E]}while(m<b);return l.bits+=h,1}function G(u,m,b,l,h){var x=0,E,X=bt.ht[l].xlen,U;l==2?U=bt.table23:U=bt.table56;do{var j=u[m+0]*X+u[m+1];m+=2,x+=U[j]}while(m<b);return E=x&65535,x>>=16,x>E&&(x=E,l++),h.bits+=x,l}function de(u,m,b,l,h){var x=0,E=0,X=0,U=bt.ht[l].xlen,j=bt.ht[l].hlen,Se=bt.ht[l+1].hlen,f=bt.ht[l+2].hlen;do{var S=u[m+0]*U+u[m+1];m+=2,x+=j[S],E+=Se[S],X+=f[S]}while(m<b);var fe=l;return x>E&&(x=E,fe++),x>X&&(x=X,fe=l+2),h.bits+=x,fe}var he=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function M(u,m,b,l){var h=me(u,m,b);switch(h){case 0:return h;case 1:return ke(u,m,b,l);case 2:case 3:return G(u,m,b,he[h-1],l);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return de(u,m,b,he[h-1],l);default:if(h>ti.IXMAX_VAL)return l.bits=ti.LARGE_BITS,-1;h-=15;var x;for(x=24;x<32&&!(bt.ht[x].linmax>=h);x++);var E;for(E=x-8;E<24&&!(bt.ht[E].linmax>=h);E++);return Ne(u,m,b,E,x,l)}}this.noquant_count_bits=function(u,m,b){var l=m.l3_enc,h=Math.min(576,m.max_nonzero_coeff+2>>1<<1);for(b!=null&&(b.sfb_count1=0);h>1&&(l[h-1]|l[h-2])==0;h-=2);m.count1=h;for(var x=0,E=0;h>3;h-=4){var X;if(((l[h-1]|l[h-2]|l[h-3]|l[h-4])&2147483647)>1)break;X=((l[h-4]*2+l[h-3])*2+l[h-2])*2+l[h-1],x+=bt.t32l[X],E+=bt.t33l[X]}var U=x;if(m.count1table_select=0,x>E&&(U=E,m.count1table_select=1),m.count1bits=U,m.big_values=h,h==0)return U;if(m.block_type==T.SHORT_TYPE)x=3*u.scalefac_band.s[3],x>m.big_values&&(x=m.big_values),E=m.big_values;else if(m.block_type==T.NORM_TYPE){if(sn(h<=576),x=m.region0_count=u.bv_scf[h-2],E=m.region1_count=u.bv_scf[h-1],sn(x+E+2<T.SBPSY_l),E=u.scalefac_band.l[x+E+2],x=u.scalefac_band.l[x+1],E<h){var j=new $(U);m.table_select[2]=M(l,E,h,j),U=j.bits}}else m.region0_count=7,m.region1_count=T.SBMAX_l-1-7-1,x=u.scalefac_band.l[7+1],E=h,x>E&&(x=E);if(x=Math.min(x,h),E=Math.min(E,h),sn(x>=0),sn(E>=0),0<x){var j=new $(U);m.table_select[0]=M(l,0,x,j),U=j.bits}if(x<E){var j=new $(U);m.table_select[1]=M(l,x,E,j),U=j.bits}if(u.use_best_huffman==2&&(m.part2_3_length=U,best_huffman_divide(u,m),U=m.part2_3_length),b!=null&&m.block_type==T.NORM_TYPE){for(var Se=0;u.scalefac_band.l[Se]<m.big_values;)Se++;b.sfb_count1=Se}return U},this.count_bits=function(u,m,b,l){var h=b.l3_enc,x=ti.IXMAX_VAL/C.IPOW20(b.global_gain);if(b.xrpow_max>x)return ti.LARGE_BITS;if(Q(m,h,C.IPOW20(b.global_gain),b,l),(u.substep_shaping&2)!=0)for(var E=0,X=b.global_gain+b.scalefac_scale,U=.634521682242439/C.IPOW20(X),j=0;j<b.sfbmax;j++){var Se=b.width[j];if(sn(Se>=0),u.pseudohalf[j]==0)E+=Se;else{var f;for(f=E,E+=Se;f<E;++f)h[f]=m[f]>=U?h[f]:0}}return this.noquant_count_bits(u,b,l)};function K(u,m,b,l,h,x,E){for(var X=m.big_values,U=0;U<=7+15;U++)l[U]=ti.LARGE_BITS;for(var U=0;U<16;U++){var j=u.scalefac_band.l[U+1];if(j>=X)break;var Se=0,f=new $(Se),S=M(b,0,j,f);Se=f.bits;for(var fe=0;fe<8;fe++){var _e=u.scalefac_band.l[U+fe+2];if(_e>=X)break;var Oe=Se;f=new $(Oe);var Ue=M(b,j,_e,f);Oe=f.bits,l[U+fe]>Oe&&(l[U+fe]=Oe,h[U+fe]=U,x[U+fe]=S,E[U+fe]=Ue)}}}function o(u,m,b,l,h,x,E,X){for(var U=m.big_values,j=2;j<T.SBMAX_l+1;j++){var Se=u.scalefac_band.l[j];if(Se>=U)break;var f=h[j-2]+m.count1bits;if(b.part2_3_length<=f)break;var S=new $(f),fe=M(l,Se,U,S);f=S.bits,!(b.part2_3_length<=f)&&(b.assign(m),b.part2_3_length=f,b.region0_count=x[j-2],b.region1_count=j-2-x[j-2],b.table_select[0]=E[j-2],b.table_select[1]=X[j-2],b.table_select[2]=fe)}}this.best_huffman_divide=function(u,m){var b=new Oo,l=m.l3_enc,h=za(7+15+1),x=za(7+15+1),E=za(7+15+1),X=za(7+15+1);if(!(m.block_type==T.SHORT_TYPE&&u.mode_gr==1)){b.assign(m),m.block_type==T.NORM_TYPE&&(K(u,m,l,h,x,E,X),o(u,b,m,l,h,x,E,X));var U=b.big_values;if(!(U==0||(l[U-2]|l[U-1])>1)&&(U=m.count1+2,!(U>576))){b.assign(m),b.count1=U;var j=0,Se=0;for(sn(U<=576);U>b.big_values;U-=4){var f=((l[U-4]*2+l[U-3])*2+l[U-2])*2+l[U-1];j+=bt.t32l[f],Se+=bt.t33l[f]}if(b.big_values=U,b.count1table_select=0,j>Se&&(j=Se,b.count1table_select=1),b.count1bits=j,b.block_type==T.NORM_TYPE)o(u,b,m,l,h,x,E,X);else{if(b.part2_3_length=j,j=u.scalefac_band.l[7+1],j>U&&(j=U),j>0){var S=new $(b.part2_3_length);b.table_select[0]=M(l,0,j,S),b.part2_3_length=S.bits}if(U>j){var S=new $(b.part2_3_length);b.table_select[1]=M(l,j,U,S),b.part2_3_length=S.bits}m.part2_3_length>b.part2_3_length&&m.assign(b)}}}};var I=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],H=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],O=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],g=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];l0.slen1_tab=O,l0.slen2_tab=g;function _(u,m){for(var b,l=m.tt[1][u],h=m.tt[0][u],x=0;x<bt.scfsi_band.length-1;x++){for(b=bt.scfsi_band[x];b<bt.scfsi_band[x+1]&&!(h.scalefac[b]!=l.scalefac[b]&&l.scalefac[b]>=0);b++);if(b==bt.scfsi_band[x+1]){for(b=bt.scfsi_band[x];b<bt.scfsi_band[x+1];b++)l.scalefac[b]=-1;m.scfsi[u][x]=1}}var E=0,X=0;for(b=0;b<11;b++)l.scalefac[b]!=-1&&(X++,E<l.scalefac[b]&&(E=l.scalefac[b]));for(var U=0,j=0;b<T.SBPSY_l;b++)l.scalefac[b]!=-1&&(j++,U<l.scalefac[b]&&(U=l.scalefac[b]));for(var x=0;x<16;x++)if(E<I[x]&&U<H[x]){var Se=O[x]*X+g[x]*j;l.part2_length>Se&&(l.part2_length=Se,l.scalefac_compress=x)}}this.best_scalefac_store=function(u,m,b,l){var h=l.tt[m][b],x,E,X,U,j=0;for(X=0,x=0;x<h.sfbmax;x++){var Se=h.width[x];for(sn(Se>=0),X+=Se,U=-Se;U<0&&h.l3_enc[U+X]==0;U++);U==0&&(h.scalefac[x]=j=-2)}if(h.scalefac_scale==0&&h.preflag==0){var f=0;for(x=0;x<h.sfbmax;x++)h.scalefac[x]>0&&(f|=h.scalefac[x]);if((f&1)==0&&f!=0){for(x=0;x<h.sfbmax;x++)h.scalefac[x]>0&&(h.scalefac[x]>>=1);h.scalefac_scale=j=1}}if(h.preflag==0&&h.block_type!=T.SHORT_TYPE&&u.mode_gr==2){for(x=11;x<T.SBPSY_l&&!(h.scalefac[x]<C.pretab[x]&&h.scalefac[x]!=-2);x++);if(x==T.SBPSY_l){for(x=11;x<T.SBPSY_l;x++)h.scalefac[x]>0&&(h.scalefac[x]-=C.pretab[x]);h.preflag=j=1}}for(E=0;E<4;E++)l.scfsi[b][E]=0;for(u.mode_gr==2&&m==1&&l.tt[0][b].block_type!=T.SHORT_TYPE&&l.tt[1][b].block_type!=T.SHORT_TYPE&&(_(b,l),j=0),x=0;x<h.sfbmax;x++)h.scalefac[x]==-2&&(h.scalefac[x]=0);j!=0&&(u.mode_gr==2?this.scale_bitcount(h):this.scale_bitcount_lsf(u,h))};function k(u,m){for(var b=0;b<m;++b)if(u[b]<0)return!1;return!0}var q=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],w=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],c=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(u){var m,b,l=0,h=0,x,E=u.scalefac;if(sn(k(E,u.sfbmax)),u.block_type==T.SHORT_TYPE)x=q,u.mixed_block_flag!=0&&(x=w);else if(x=c,u.preflag==0){for(b=11;b<T.SBPSY_l&&!(E[b]<C.pretab[b]);b++);if(b==T.SBPSY_l)for(u.preflag=1,b=11;b<T.SBPSY_l;b++)E[b]-=C.pretab[b]}for(b=0;b<u.sfbdivide;b++)l<E[b]&&(l=E[b]);for(;b<u.sfbmax;b++)h<E[b]&&(h=E[b]);for(u.part2_length=ti.LARGE_BITS,m=0;m<16;m++)l<I[m]&&h<H[m]&&u.part2_length>x[m]&&(u.part2_length=x[m],u.scalefac_compress=m);return u.part2_length==ti.LARGE_BITS};var L=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(u,m){var b,l,h,x,E,X,U,j,Se=za(4),f=m.scalefac;for(m.preflag!=0?b=2:b=0,U=0;U<4;U++)Se[U]=0;if(m.block_type==T.SHORT_TYPE){l=1;var S=C.nr_of_sfb_block[b][l];for(j=0,h=0;h<4;h++)for(x=S[h]/3,U=0;U<x;U++,j++)for(E=0;E<3;E++)f[j*3+E]>Se[h]&&(Se[h]=f[j*3+E])}else{l=0;var S=C.nr_of_sfb_block[b][l];for(j=0,h=0;h<4;h++)for(x=S[h],U=0;U<x;U++,j++)f[j]>Se[h]&&(Se[h]=f[j])}for(X=!1,h=0;h<4;h++)Se[h]>L[b][h]&&(X=!0);if(!X){var fe,_e,Oe,Ue;for(m.sfb_partition_table=C.nr_of_sfb_block[b][l],h=0;h<4;h++)m.slen[h]=y[Se[h]];switch(fe=m.slen[0],_e=m.slen[1],Oe=m.slen[2],Ue=m.slen[3],b){case 0:m.scalefac_compress=(fe*5+_e<<4)+(Oe<<2)+Ue;break;case 1:m.scalefac_compress=400+(fe*5+_e<<2)+Oe;break;case 2:m.scalefac_compress=500+fe*3+_e;break;default:ad.err.printf(`intensity stereo not implemented yet
2
- `);break}}if(!X)for(sn(m.sfb_partition_table!=null),m.part2_length=0,h=0;h<4;h++)m.part2_length+=m.slen[h]*m.sfb_partition_table[h];return X};var y=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(u){for(var m=2;m<=576;m+=2){for(var b=0,l;u.scalefac_band.l[++b]<m;);for(l=ie[b][0];u.scalefac_band.l[l+1]>m;)l--;for(l<0&&(l=ie[b][0]),u.bv_scf[m-2]=l,l=ie[b][1];u.scalefac_band.l[l+u.bv_scf[m-2]+2]>m;)l--;l<0&&(l=ie[b][1]),u.bv_scf[m-1]=l}}}var c0=l0,Dn=P.System,sd=P.Arrays,ld=P.new_byte,cd=P.new_float_n,ud=P.new_int,dt=P.assert;Vo.EQ=function(C,$){return Math.abs(C)>Math.abs($)?Math.abs(C-$)<=Math.abs(C)*1e-6:Math.abs(C-$)<=Math.abs($)*1e-6},Vo.NEQ=function(C,$){return!Vo.EQ(C,$)};function Vo(){var C=this,$=32773,ie=32,Z=null,ye=null,Q=null,me=null;this.setModules=function(y,u,m,b){Z=y,ye=u,Q=m,me=b};var Ne=null,ke=0,G=0,de=0;this.getframebits=function(y){var u=y.internal_flags,m;u.bitrate_index!=0?m=bt.bitrate_table[y.version][u.bitrate_index]:m=y.brate,dt(8<=m&&m<=640);var b=0|(y.version+1)*72e3*m/y.out_samplerate+u.padding;return 8*b};function he(y){Dn.arraycopy(y.header[y.w_ptr].buf,0,Ne,G,y.sideinfo_len),G+=y.sideinfo_len,ke+=y.sideinfo_len*8,y.w_ptr=y.w_ptr+1&Bt.MAX_HEADER_BUF-1}function M(y,u,m){for(dt(m<ie-2);m>0;){var b;de==0&&(de=8,G++,dt(G<At.LAME_MAXMP3BUFFER),dt(y.header[y.w_ptr].write_timing>=ke),y.header[y.w_ptr].write_timing==ke&&he(y),Ne[G]=0),b=Math.min(m,de),m-=b,de-=b,dt(m<ie),dt(de<ie),Ne[G]|=u>>m<<de,ke+=b}}function K(y,u,m){for(dt(m<ie-2);m>0;){var b;de==0&&(de=8,G++,dt(G<At.LAME_MAXMP3BUFFER),Ne[G]=0),b=Math.min(m,de),m-=b,de-=b,dt(m<ie),dt(de<ie),Ne[G]|=u>>m<<de,ke+=b}}function o(y,u){var m=y.internal_flags,b;if(dt(u>=0),u>=8&&(M(m,76,8),u-=8),u>=8&&(M(m,65,8),u-=8),u>=8&&(M(m,77,8),u-=8),u>=8&&(M(m,69,8),u-=8),u>=32){var l=Q.getLameShortVersion();if(u>=32)for(b=0;b<l.length&&u>=8;++b)u-=8,M(m,l.charAt(b),8)}for(;u>=1;u-=1)M(m,m.ancillary_flag,1),m.ancillary_flag^=y.disable_reservoir?0:1;dt(u==0)}function I(y,u,m){for(var b=y.header[y.h_ptr].ptr;m>0;){var l=Math.min(m,8-(b&7));m-=l,dt(m<ie),y.header[y.h_ptr].buf[b>>3]|=u>>m<<8-(b&7)-l,b+=l}y.header[y.h_ptr].ptr=b}function H(y,u){y<<=8;for(var m=0;m<8;m++)y<<=1,u<<=1,((u^y)&65536)!=0&&(u^=$);return u}this.CRC_writeheader=function(y,u){var m=65535;m=H(u[2]&255,m),m=H(u[3]&255,m);for(var b=6;b<y.sideinfo_len;b++)m=H(u[b]&255,m);u[4]=byte(m>>8),u[5]=byte(m&255)};function O(y,u){var m=y.internal_flags,b,l,h;if(b=m.l3_side,m.header[m.h_ptr].ptr=0,sd.fill(m.header[m.h_ptr].buf,0,m.sideinfo_len,0),y.out_samplerate<16e3?I(m,4094,12):I(m,4095,12),I(m,y.version,1),I(m,4-3,2),I(m,y.error_protection?0:1,1),I(m,m.bitrate_index,4),I(m,m.samplerate_index,2),I(m,m.padding,1),I(m,y.extension,1),I(m,y.mode.ordinal(),2),I(m,m.mode_ext,2),I(m,y.copyright,1),I(m,y.original,1),I(m,y.emphasis,2),y.error_protection&&I(m,0,16),y.version==1){for(dt(b.main_data_begin>=0),I(m,b.main_data_begin,9),m.channels_out==2?I(m,b.private_bits,3):I(m,b.private_bits,5),h=0;h<m.channels_out;h++){var x;for(x=0;x<4;x++)I(m,b.scfsi[h][x],1)}for(l=0;l<2;l++)for(h=0;h<m.channels_out;h++){var E=b.tt[l][h];I(m,E.part2_3_length+E.part2_length,12),I(m,E.big_values/2,9),I(m,E.global_gain,8),I(m,E.scalefac_compress,4),E.block_type!=T.NORM_TYPE?(I(m,1,1),I(m,E.block_type,2),I(m,E.mixed_block_flag,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),I(m,E.subblock_gain[0],3),I(m,E.subblock_gain[1],3),I(m,E.subblock_gain[2],3)):(I(m,0,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),E.table_select[2]==14&&(E.table_select[2]=16),I(m,E.table_select[2],5),dt(0<=E.region0_count&&E.region0_count<16),dt(0<=E.region1_count&&E.region1_count<8),I(m,E.region0_count,4),I(m,E.region1_count,3)),I(m,E.preflag,1),I(m,E.scalefac_scale,1),I(m,E.count1table_select,1)}}else for(dt(b.main_data_begin>=0),I(m,b.main_data_begin,8),I(m,b.private_bits,m.channels_out),l=0,h=0;h<m.channels_out;h++){var E=b.tt[l][h];I(m,E.part2_3_length+E.part2_length,12),I(m,E.big_values/2,9),I(m,E.global_gain,8),I(m,E.scalefac_compress,9),E.block_type!=T.NORM_TYPE?(I(m,1,1),I(m,E.block_type,2),I(m,E.mixed_block_flag,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),I(m,E.subblock_gain[0],3),I(m,E.subblock_gain[1],3),I(m,E.subblock_gain[2],3)):(I(m,0,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),E.table_select[2]==14&&(E.table_select[2]=16),I(m,E.table_select[2],5),dt(0<=E.region0_count&&E.region0_count<16),dt(0<=E.region1_count&&E.region1_count<8),I(m,E.region0_count,4),I(m,E.region1_count,3)),I(m,E.scalefac_scale,1),I(m,E.count1table_select,1)}y.error_protection&&CRC_writeheader(m,m.header[m.h_ptr].buf);{var X=m.h_ptr;dt(m.header[X].ptr==m.sideinfo_len*8),m.h_ptr=X+1&Bt.MAX_HEADER_BUF-1,m.header[m.h_ptr].write_timing=m.header[X].write_timing+u,m.h_ptr==m.w_ptr&&Dn.err.println(`Error: MAX_HEADER_BUF too small in bitstream.c
3
- `)}}function g(y,u){var m=bt.ht[u.count1table_select+32],b,l=0,h=u.big_values,x=u.big_values;for(dt(u.count1table_select<2),b=(u.count1-u.big_values)/4;b>0;--b){var E=0,X=0,U;U=u.l3_enc[h+0],U!=0&&(X+=8,u.xr[x+0]<0&&E++,dt(U<=1)),U=u.l3_enc[h+1],U!=0&&(X+=4,E*=2,u.xr[x+1]<0&&E++,dt(U<=1)),U=u.l3_enc[h+2],U!=0&&(X+=2,E*=2,u.xr[x+2]<0&&E++,dt(U<=1)),U=u.l3_enc[h+3],U!=0&&(X++,E*=2,u.xr[x+3]<0&&E++,dt(U<=1)),h+=4,x+=4,M(y,E+m.table[X],m.hlen[X]),l+=m.hlen[X]}return l}function _(y,u,m,b,l){var h=bt.ht[u],x=0;if(dt(u<32),u==0)return x;for(var E=m;E<b;E+=2){var X=0,U=0,j=h.xlen,Se=h.xlen,f=0,S=l.l3_enc[E],fe=l.l3_enc[E+1];if(S!=0&&(l.xr[E]<0&&f++,X--),u>15){if(S>14){var _e=S-15;dt(_e<=h.linmax),f|=_e<<1,U=j,S=15}if(fe>14){var Oe=fe-15;dt(Oe<=h.linmax),f<<=j,f|=Oe,U+=j,fe=15}Se=16}fe!=0&&(f<<=1,l.xr[E+1]<0&&f++,X--),dt((S|fe)<16),S=S*Se+fe,U-=X,X+=h.hlen[S],dt(X<=ie),dt(U<=ie),M(y,h.table[S],X),M(y,f,U),x+=X+U}return x}function k(y,u){var m=3*y.scalefac_band.s[3];m>u.big_values&&(m=u.big_values);var b=_(y,u.table_select[0],0,m,u);return b+=_(y,u.table_select[1],m,u.big_values,u),b}function q(y,u){var m,b,l,h;m=u.big_values,dt(0<=m&&m<=576);var x=u.region0_count+1;return dt(0<=x),dt(x<y.scalefac_band.l.length),l=y.scalefac_band.l[x],x+=u.region1_count+1,dt(0<=x),dt(x<y.scalefac_band.l.length),h=y.scalefac_band.l[x],l>m&&(l=m),h>m&&(h=m),b=_(y,u.table_select[0],0,l,u),b+=_(y,u.table_select[1],l,h,u),b+=_(y,u.table_select[2],h,m,u),b}function w(y){var u,m,b,l,h=0,x=y.internal_flags,E=x.l3_side;if(y.version==1)for(u=0;u<2;u++)for(m=0;m<x.channels_out;m++){var X=E.tt[u][m],U=c0.slen1_tab[X.scalefac_compress],j=c0.slen2_tab[X.scalefac_compress];for(l=0,b=0;b<X.sfbdivide;b++)X.scalefac[b]!=-1&&(M(x,X.scalefac[b],U),l+=U);for(;b<X.sfbmax;b++)X.scalefac[b]!=-1&&(M(x,X.scalefac[b],j),l+=j);dt(l==X.part2_length),X.block_type==T.SHORT_TYPE?l+=k(x,X):l+=q(x,X),l+=g(x,X),dt(l==X.part2_3_length+X.part2_length),h+=l}else for(u=0,m=0;m<x.channels_out;m++){var X=E.tt[u][m],Se,f,S=0;if(dt(X.sfb_partition_table!=null),l=0,b=0,f=0,X.block_type==T.SHORT_TYPE){for(;f<4;f++){var fe=X.sfb_partition_table[f]/3,_e=X.slen[f];for(Se=0;Se<fe;Se++,b++)M(x,Math.max(X.scalefac[b*3+0],0),_e),M(x,Math.max(X.scalefac[b*3+1],0),_e),M(x,Math.max(X.scalefac[b*3+2],0),_e),S+=3*_e}l+=k(x,X)}else{for(;f<4;f++){var fe=X.sfb_partition_table[f],_e=X.slen[f];for(Se=0;Se<fe;Se++,b++)M(x,Math.max(X.scalefac[b],0),_e),S+=_e}l+=q(x,X)}l+=g(x,X),dt(l==X.part2_3_length),dt(S==X.part2_length),h+=S+l}return h}function c(){this.total=0}function L(y,u){var m=y.internal_flags,b,l,h,x,E;return E=m.w_ptr,x=m.h_ptr-1,x==-1&&(x=Bt.MAX_HEADER_BUF-1),b=m.header[x].write_timing-ke,u.total=b,b>=0&&(l=1+x-E,x<E&&(l=1+x-E+Bt.MAX_HEADER_BUF),b-=l*8*m.sideinfo_len),h=C.getframebits(y),b+=h,u.total+=h,u.total%8!=0?u.total=1+u.total/8:u.total=u.total/8,u.total+=G+1,b<0&&Dn.err.println(`strange error flushing buffer ...
4
- `),b}this.flush_bitstream=function(y){var u=y.internal_flags,m,b,l=u.h_ptr-1;if(l==-1&&(l=Bt.MAX_HEADER_BUF-1),m=u.l3_side,!((b=L(y,new c))<0)){if(o(y,b),dt(u.header[l].write_timing+this.getframebits(y)==ke),u.ResvSize=0,m.main_data_begin=0,u.findReplayGain){var h=Z.GetTitleGain(u.rgdata);dt(NEQ(h,Xa.GAIN_NOT_ENOUGH_SAMPLES)),u.RadioGain=Math.floor(h*10+.5)|0}u.findPeakSample&&(u.noclipGainChange=Math.ceil(Math.log10(u.PeakSample/32767)*20*10)|0,u.noclipGainChange>0&&(EQ(y.scale,1)||EQ(y.scale,0))?u.noclipScale=Math.floor(32767/u.PeakSample*100)/100:u.noclipScale=-1)}},this.add_dummy_byte=function(y,u,m){for(var b=y.internal_flags,l;m-- >0;)for(K(b,u,8),l=0;l<Bt.MAX_HEADER_BUF;++l)b.header[l].write_timing+=8},this.format_bitstream=function(y){var u=y.internal_flags,m;m=u.l3_side;var b=this.getframebits(y);o(y,m.resvDrain_pre),O(y,b);var l=8*u.sideinfo_len;if(l+=w(y),o(y,m.resvDrain_post),l+=m.resvDrain_post,m.main_data_begin+=(b-l)/8,L(y,new c)!=u.ResvSize&&Dn.err.println("Internal buffer inconsistency. flushbits <> ResvSize"),m.main_data_begin*8!=u.ResvSize&&(Dn.err.printf(`bit reservoir error:
1
+ "use strict";(()=>{var Xd=Object.create;var Kc=Object.defineProperty;var Kd=Object.getOwnPropertyDescriptor;var Wd=Object.getOwnPropertyNames;var Yd=Object.getPrototypeOf,$d=Object.prototype.hasOwnProperty;var Wc=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Zd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Wd(e))!$d.call(t,i)&&i!==r&&Kc(t,i,{get:()=>e[i],enumerable:!(n=Kd(e,i))||n.enumerable});return t};var Qd=(t,e,r)=>(r=t!=null?Xd(Yd(t)):{},Zd(e||!t||!t.__esModule?Kc(r,"default",{value:t,enumerable:!0}):r,t));var i1=Wc((Wm,n1)=>{n1.exports=typeof self=="object"?self.FormData:window.FormData});var Df=Wc((gc,bc)=>{"use strict";(function(t,e){typeof gc=="object"&&typeof bc<"u"?bc.exports=e():typeof define=="function"&&define.amd?define(e):t.MicRecorder=e()})(gc,function(){function t(C){return new Int8Array(C)}function e(C){return new Int16Array(C)}function r(C){return new Int32Array(C)}function n(C){return new Float32Array(C)}function i(C){return new Float64Array(C)}function a(C){if(C.length==1)return n(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(a(C));return ie}function s(C){if(C.length==1)return r(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(s(C));return ie}function v(C){if(C.length==1)return e(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(v(C));return ie}function d(C){if(C.length==1)return new Array(C[0]);var $=C[0];C=C.slice(1);for(var ie=[],Z=0;Z<$;Z++)ie.push(d(C));return ie}var p={};p.fill=function(C,$,ie,Z){if(arguments.length==2)for(var ye=0;ye<C.length;ye++)C[ye]=arguments[1];else for(var ye=$;ye<ie;ye++)C[ye]=Z};var B={};B.arraycopy=function(C,$,ie,Z,ye){for(var Q=$+ye;$<Q;)ie[Z++]=C[$++]};var z={};z.SQRT2=1.4142135623730951,z.FAST_LOG10=function(C){return Math.log10(C)},z.FAST_LOG10_X=function(C,$){return Math.log10(C)*$};function ee(C){this.ordinal=C}ee.short_block_allowed=new ee(0),ee.short_block_coupled=new ee(1),ee.short_block_dispensed=new ee(2),ee.short_block_forced=new ee(3);var te={};te.MAX_VALUE=34028235e31;function k(C){this.ordinal=C}k.vbr_off=new k(0),k.vbr_mt=new k(1),k.vbr_rh=new k(2),k.vbr_abr=new k(3),k.vbr_mtrh=new k(4),k.vbr_default=k.vbr_mtrh;var ce=function(C){},P={System:B,VbrMode:k,Float:te,ShortBlock:ee,Util:z,Arrays:p,new_array_n:d,new_byte:t,new_double:i,new_float:n,new_float_n:a,new_int:r,new_int_n:s,new_short:e,new_short_n:v,assert:ce},oe=P.System,se=P.Util,xe=P.Arrays,Ge=P.new_float;function lt(){var C=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.7960341867115,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*se.SQRT2*.5/2384e-9,.017876148*se.SQRT2*.5/2384e-9,.003134727*se.SQRT2*.5/2384e-9,.002457142*se.SQRT2*.5/2384e-9,971317e-9*se.SQRT2*.5/2384e-9,218868e-9*se.SQRT2*.5/2384e-9,101566e-9*se.SQRT2*.5/2384e-9,13828e-9*se.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],$=12,ie=36,Z=[[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,940084909404969e-27,6423305872147839e-28,2382191739347918e-28,5456116108943412e-27,4878985199565852e-27,4240448995017367e-27,3559909094758252e-27,2858043359288075e-27,2156177623817898e-27,1475637723558783e-27,8371015190102974e-28,2599706096327376e-28,-5456116108943412e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758252e-27,-2858043359288076e-27,-2156177623817898e-27,-1475637723558783e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347923e-28,-6423305872147843e-28,-9400849094049696e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049694e-28,-642330587214784e-27,-2382191739347918e-28],[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,9400849094049688e-28,6423305872147841e-28,2382191739347918e-28,5456116108943413e-27,4878985199565852e-27,4240448995017367e-27,3559909094758253e-27,2858043359288075e-27,2156177623817898e-27,1475637723558782e-27,8371015190102975e-28,2599706096327376e-28,-5461314069809755e-27,-4921085770524055e-27,-4343405037091838e-27,-3732668368707687e-27,-3093523840190885e-27,-2430835727329465e-27,-1734679010007751e-27,-974825365660928e-27,-2797435120168326e-28,0,0,0,0,0,0,-2283748241799531e-28,-4037858874020686e-28,-2146547464825323e-28],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.9955178160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2283748241799531e-28,4037858874020686e-28,2146547464825323e-28,5461314069809755e-27,4921085770524055e-27,4343405037091838e-27,3732668368707687e-27,3093523840190885e-27,2430835727329466e-27,1734679010007751e-27,974825365660928e-27,2797435120168326e-28,-5456116108943413e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758253e-27,-2858043359288075e-27,-2156177623817898e-27,-1475637723558782e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347913e-28,-6423305872147834e-28,-9400849094049688e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049688e-28,-6423305872147841e-28,-2382191739347918e-28]],ye=Z[T.SHORT_TYPE],Q=Z[T.SHORT_TYPE],me=Z[T.SHORT_TYPE],Ne=Z[T.SHORT_TYPE],De=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function G(M,K,o){for(var I=10,H=K+238-14-286,O=-15;O<0;O++){var g,_,D;g=C[I+-10],_=M[H+-224]*g,D=M[K+224]*g,g=C[I+-9],_+=M[H+-160]*g,D+=M[K+160]*g,g=C[I+-8],_+=M[H+-96]*g,D+=M[K+96]*g,g=C[I+-7],_+=M[H+-32]*g,D+=M[K+32]*g,g=C[I+-6],_+=M[H+32]*g,D+=M[K+-32]*g,g=C[I+-5],_+=M[H+96]*g,D+=M[K+-96]*g,g=C[I+-4],_+=M[H+160]*g,D+=M[K+-160]*g,g=C[I+-3],_+=M[H+224]*g,D+=M[K+-224]*g,g=C[I+-2],_+=M[K+-256]*g,D-=M[H+256]*g,g=C[I+-1],_+=M[K+-192]*g,D-=M[H+192]*g,g=C[I+0],_+=M[K+-128]*g,D-=M[H+128]*g,g=C[I+1],_+=M[K+-64]*g,D-=M[H+64]*g,g=C[I+2],_+=M[K+0]*g,D-=M[H+0]*g,g=C[I+3],_+=M[K+64]*g,D-=M[H+-64]*g,g=C[I+4],_+=M[K+128]*g,D-=M[H+-128]*g,g=C[I+5],_+=M[K+192]*g,D-=M[H+-192]*g,_*=C[I+6],g=D-_,o[30+O*2]=D+_,o[31+O*2]=C[I+7]*g,I+=18,K--,H++}{var _,D,q,w;D=M[K+-16]*C[I+-10],_=M[K+-32]*C[I+-2],D+=(M[K+-48]-M[K+16])*C[I+-9],_+=M[K+-96]*C[I+-1],D+=(M[K+-80]+M[K+48])*C[I+-8],_+=M[K+-160]*C[I+0],D+=(M[K+-112]-M[K+80])*C[I+-7],_+=M[K+-224]*C[I+1],D+=(M[K+-144]+M[K+112])*C[I+-6],_-=M[K+32]*C[I+2],D+=(M[K+-176]-M[K+144])*C[I+-5],_-=M[K+96]*C[I+3],D+=(M[K+-208]+M[K+176])*C[I+-4],_-=M[K+160]*C[I+4],D+=(M[K+-240]-M[K+208])*C[I+-3],_-=M[K+224],q=_-D,w=_+D,D=o[14],_=o[15]-D,o[31]=w+D,o[30]=q+_,o[15]=q-_,o[14]=w-D}{var c;c=o[28]-o[0],o[0]+=o[28],o[28]=c*C[I+-2*18+7],c=o[29]-o[1],o[1]+=o[29],o[29]=c*C[I+-2*18+7],c=o[26]-o[2],o[2]+=o[26],o[26]=c*C[I+-4*18+7],c=o[27]-o[3],o[3]+=o[27],o[27]=c*C[I+-4*18+7],c=o[24]-o[4],o[4]+=o[24],o[24]=c*C[I+-6*18+7],c=o[25]-o[5],o[5]+=o[25],o[25]=c*C[I+-6*18+7],c=o[22]-o[6],o[6]+=o[22],o[22]=c*se.SQRT2,c=o[23]-o[7],o[7]+=o[23],o[23]=c*se.SQRT2-o[7],o[7]-=o[6],o[22]-=o[7],o[23]-=o[22],c=o[6],o[6]=o[31]-c,o[31]=o[31]+c,c=o[7],o[7]=o[30]-c,o[30]=o[30]+c,c=o[22],o[22]=o[15]-c,o[15]=o[15]+c,c=o[23],o[23]=o[14]-c,o[14]=o[14]+c,c=o[20]-o[8],o[8]+=o[20],o[20]=c*C[I+-10*18+7],c=o[21]-o[9],o[9]+=o[21],o[21]=c*C[I+-10*18+7],c=o[18]-o[10],o[10]+=o[18],o[18]=c*C[I+-12*18+7],c=o[19]-o[11],o[11]+=o[19],o[19]=c*C[I+-12*18+7],c=o[16]-o[12],o[12]+=o[16],o[16]=c*C[I+-14*18+7],c=o[17]-o[13],o[13]+=o[17],o[17]=c*C[I+-14*18+7],c=-o[20]+o[24],o[20]+=o[24],o[24]=c*C[I+-12*18+7],c=-o[21]+o[25],o[21]+=o[25],o[25]=c*C[I+-12*18+7],c=o[4]-o[8],o[4]+=o[8],o[8]=c*C[I+-12*18+7],c=o[5]-o[9],o[5]+=o[9],o[9]=c*C[I+-12*18+7],c=o[0]-o[12],o[0]+=o[12],o[12]=c*C[I+-4*18+7],c=o[1]-o[13],o[1]+=o[13],o[13]=c*C[I+-4*18+7],c=o[16]-o[28],o[16]+=o[28],o[28]=c*C[I+-4*18+7],c=-o[17]+o[29],o[17]+=o[29],o[29]=c*C[I+-4*18+7],c=se.SQRT2*(o[2]-o[10]),o[2]+=o[10],o[10]=c,c=se.SQRT2*(o[3]-o[11]),o[3]+=o[11],o[11]=c,c=se.SQRT2*(-o[18]+o[26]),o[18]+=o[26],o[26]=c-o[18],c=se.SQRT2*(-o[19]+o[27]),o[19]+=o[27],o[27]=c-o[19],c=o[2],o[19]-=o[3],o[3]-=c,o[2]=o[31]-c,o[31]+=c,c=o[3],o[11]-=o[19],o[18]-=c,o[3]=o[30]-c,o[30]+=c,c=o[18],o[27]-=o[11],o[19]-=c,o[18]=o[15]-c,o[15]+=c,c=o[19],o[10]-=c,o[19]=o[14]-c,o[14]+=c,c=o[10],o[11]-=c,o[10]=o[23]-c,o[23]+=c,c=o[11],o[26]-=c,o[11]=o[22]-c,o[22]+=c,c=o[26],o[27]-=c,o[26]=o[7]-c,o[7]+=c,c=o[27],o[27]=o[6]-c,o[6]+=c,c=se.SQRT2*(o[0]-o[4]),o[0]+=o[4],o[4]=c,c=se.SQRT2*(o[1]-o[5]),o[1]+=o[5],o[5]=c,c=se.SQRT2*(o[16]-o[20]),o[16]+=o[20],o[20]=c,c=se.SQRT2*(o[17]-o[21]),o[17]+=o[21],o[21]=c,c=-se.SQRT2*(o[8]-o[12]),o[8]+=o[12],o[12]=c-o[8],c=-se.SQRT2*(o[9]-o[13]),o[9]+=o[13],o[13]=c-o[9],c=-se.SQRT2*(o[25]-o[29]),o[25]+=o[29],o[29]=c-o[25],c=-se.SQRT2*(o[24]+o[28]),o[24]-=o[28],o[28]=c-o[24],c=o[24]-o[16],o[24]=c,c=o[20]-c,o[20]=c,c=o[28]-c,o[28]=c,c=o[25]-o[17],o[25]=c,c=o[21]-c,o[21]=c,c=o[29]-c,o[29]=c,c=o[17]-o[1],o[17]=c,c=o[9]-c,o[9]=c,c=o[25]-c,o[25]=c,c=o[5]-c,o[5]=c,c=o[21]-c,o[21]=c,c=o[13]-c,o[13]=c,c=o[29]-c,o[29]=c,c=o[1]-o[0],o[1]=c,c=o[16]-c,o[16]=c,c=o[17]-c,o[17]=c,c=o[8]-c,o[8]=c,c=o[9]-c,o[9]=c,c=o[24]-c,o[24]=c,c=o[25]-c,o[25]=c,c=o[4]-c,o[4]=c,c=o[5]-c,o[5]=c,c=o[20]-c,o[20]=c,c=o[21]-c,o[21]=c,c=o[12]-c,o[12]=c,c=o[13]-c,o[13]=c,c=o[28]-c,o[28]=c,c=o[29]-c,o[29]=c,c=o[0],o[0]+=o[31],o[31]-=c,c=o[1],o[1]+=o[30],o[30]-=c,c=o[16],o[16]+=o[15],o[15]-=c,c=o[17],o[17]+=o[14],o[14]-=c,c=o[8],o[8]+=o[23],o[23]-=c,c=o[9],o[9]+=o[22],o[22]-=c,c=o[24],o[24]+=o[7],o[7]-=c,c=o[25],o[25]+=o[6],o[6]-=c,c=o[4],o[4]+=o[27],o[27]-=c,c=o[5],o[5]+=o[26],o[26]-=c,c=o[20],o[20]+=o[11],o[11]-=c,c=o[21],o[21]+=o[10],o[10]-=c,c=o[12],o[12]+=o[19],o[19]-=c,c=o[13],o[13]+=o[18],o[18]-=c,c=o[28],o[28]+=o[3],o[3]-=c,c=o[29],o[29]+=o[2],o[2]-=c}}function de(M,K){for(var o=0;o<3;o++){var I,H,O,g,_,D;g=M[K+2*3]*Z[T.SHORT_TYPE][0]-M[K+5*3],I=M[K+0*3]*Z[T.SHORT_TYPE][2]-M[K+3*3],H=g+I,O=g-I,g=M[K+5*3]*Z[T.SHORT_TYPE][0]+M[K+2*3],I=M[K+3*3]*Z[T.SHORT_TYPE][2]+M[K+0*3],_=g+I,D=-g+I,I=(M[K+1*3]*Z[T.SHORT_TYPE][1]-M[K+4*3])*2069978111953089e-26,g=(M[K+4*3]*Z[T.SHORT_TYPE][1]+M[K+1*3])*2069978111953089e-26,M[K+3*0]=H*190752519173728e-25+I,M[K+3*5]=-_*190752519173728e-25+g,O=O*.8660254037844387*1907525191737281e-26,_=_*.5*1907525191737281e-26+g,M[K+3*1]=O-_,M[K+3*2]=O+_,H=H*.5*1907525191737281e-26-I,D=D*.8660254037844387*1907525191737281e-26,M[K+3*3]=H+D,M[K+3*4]=H-D,K++}}function he(M,K,o){var I,H;{var O,g,_,D,q,w,c,L;O=o[17]-o[9],_=o[15]-o[11],D=o[14]-o[12],q=o[0]+o[8],w=o[1]+o[7],c=o[2]+o[6],L=o[3]+o[5],M[K+17]=q+c-L-(w-o[4]),H=(q+c-L)*Q[12+7]+(w-o[4]),I=(O-_-D)*Q[12+6],M[K+5]=I+H,M[K+6]=I-H,g=(o[16]-o[10])*Q[12+6],w=w*Q[12+7]+o[4],I=O*Q[12+0]+g+_*Q[12+1]+D*Q[12+2],H=-q*Q[12+4]+w-c*Q[12+5]+L*Q[12+3],M[K+1]=I+H,M[K+2]=I-H,I=O*Q[12+1]-g-_*Q[12+2]+D*Q[12+0],H=-q*Q[12+5]+w-c*Q[12+3]+L*Q[12+4],M[K+9]=I+H,M[K+10]=I-H,I=O*Q[12+2]-g+_*Q[12+0]-D*Q[12+1],H=q*Q[12+3]-w+c*Q[12+4]-L*Q[12+5],M[K+13]=I+H,M[K+14]=I-H}{var y,u,m,b,l,h,x,E;y=o[8]-o[0],m=o[6]-o[2],b=o[5]-o[3],l=o[17]+o[9],h=o[16]+o[10],x=o[15]+o[11],E=o[14]+o[12],M[K+0]=l+x+E+(h+o[13]),I=(l+x+E)*Q[12+7]-(h+o[13]),H=(y-m+b)*Q[12+6],M[K+11]=I+H,M[K+12]=I-H,u=(o[7]-o[1])*Q[12+6],h=o[13]-h*Q[12+7],I=l*Q[12+3]-h+x*Q[12+4]+E*Q[12+5],H=y*Q[12+2]+u+m*Q[12+0]+b*Q[12+1],M[K+3]=I+H,M[K+4]=I-H,I=-l*Q[12+5]+h-x*Q[12+3]-E*Q[12+4],H=y*Q[12+1]+u-m*Q[12+2]-b*Q[12+0],M[K+7]=I+H,M[K+8]=I-H,I=-l*Q[12+4]+h-x*Q[12+5]-E*Q[12+3],H=y*Q[12+0]-u+m*Q[12+1]-b*Q[12+2],M[K+15]=I+H,M[K+16]=I-H}}this.mdct_sub48=function(M,K,o){for(var I=K,H=286,O=0;O<M.channels_out;O++){for(var g=0;g<M.mode_gr;g++){for(var _,D=M.l3_side.tt[g][O],q=D.xr,w=0,c=M.sb_sample[O][1-g],L=0,y=0;y<18/2;y++)for(G(I,H,c[L]),G(I,H+32,c[L+1]),L+=2,H+=64,_=1;_<32;_+=2)c[L-1][_]*=-1;for(_=0;_<32;_++,w+=18){var u=D.block_type,m=M.sb_sample[O][g],b=M.sb_sample[O][1-g];if(D.mixed_block_flag!=0&&_<2&&(u=0),M.amp_filter[_]<1e-12)xe.fill(q,w+0,w+18,0);else{if(M.amp_filter[_]<1)for(var y=0;y<18;y++)b[y][De[_]]*=M.amp_filter[_];if(u==T.SHORT_TYPE){for(var y=-$/4;y<0;y++){var l=Z[T.SHORT_TYPE][y+3];q[w+y*3+9]=m[9+y][De[_]]*l-m[8-y][De[_]],q[w+y*3+18]=m[14-y][De[_]]*l+m[15+y][De[_]],q[w+y*3+10]=m[15+y][De[_]]*l-m[14-y][De[_]],q[w+y*3+19]=b[2-y][De[_]]*l+b[3+y][De[_]],q[w+y*3+11]=b[3+y][De[_]]*l-b[2-y][De[_]],q[w+y*3+20]=b[8-y][De[_]]*l+b[9+y][De[_]]}de(q,w)}else{for(var h=Ge(18),y=-ie/4;y<0;y++){var x,E;x=Z[u][y+27]*b[y+9][De[_]]+Z[u][y+36]*b[8-y][De[_]],E=Z[u][y+9]*m[y+9][De[_]]-Z[u][y+18]*m[8-y][De[_]],h[y+9]=x-E*ye[3+y+9],h[y+18]=x*ye[3+y+9]+E}he(q,w,h)}}if(u!=T.SHORT_TYPE&&_!=0)for(var y=7;y>=0;--y){var X,U;X=q[w+y]*me[20+y]+q[w+-1-y]*Ne[28+y],U=q[w+y]*Ne[28+y]-q[w+-1-y]*me[20+y],q[w+-1-y]=X,q[w+y]=U}}}if(I=o,H=286,M.mode_gr==1)for(var j=0;j<18;j++)oe.arraycopy(M.sb_sample[O][1][j],0,M.sb_sample[O][0][j],0,32)}}}var ft=lt,st=P.System,yt=P.new_float,Xt=P.new_float_n;function tr(){this.l=yt(T.SBMAX_l),this.s=Xt([T.SBMAX_s,3]);var C=this;this.assign=function($){st.arraycopy($.l,0,C.l,0,T.SBMAX_l);for(var ie=0;ie<T.SBMAX_s;ie++)for(var Z=0;Z<3;Z++)C.s[ie][Z]=$.s[ie][Z]}}var sr=tr;function an(){this.thm=new sr,this.en=new sr}var Tr=an,hr=P.System,gr=P.VbrMode,$t=P.new_array_n,St=P.new_float,Dt=P.new_float_n,Nt=P.new_int,It=P.assert;Qe.ENCDELAY=576,Qe.POSTDELAY=1152,Qe.MDCTDELAY=48,Qe.FFTOFFSET=224+Qe.MDCTDELAY,Qe.DECDELAY=528,Qe.SBLIMIT=32,Qe.CBANDS=64,Qe.SBPSY_l=21,Qe.SBPSY_s=12,Qe.SBMAX_l=22,Qe.SBMAX_s=13,Qe.PSFB21=6,Qe.PSFB12=6,Qe.BLKSIZE=1024,Qe.HBLKSIZE=Qe.BLKSIZE/2+1,Qe.BLKSIZE_s=256,Qe.HBLKSIZE_s=Qe.BLKSIZE_s/2+1,Qe.NORM_TYPE=0,Qe.START_TYPE=1,Qe.SHORT_TYPE=2,Qe.STOP_TYPE=3,Qe.MPG_MD_LR_LR=0,Qe.MPG_MD_LR_I=1,Qe.MPG_MD_MS_LR=2,Qe.MPG_MD_MS_I=3,Qe.fircoef=[-.0207887*5,-.0378413*5,-.0432472*5,-.031183*5,779609e-23*5,.0467745*5,.10091*5,.151365*5,.187098*5];function Qe(){var C=ft,$=Tr,ie=Qe.FFTOFFSET,Z=Qe.MPG_MD_MS_LR,ye=null;this.psy=null;var Q=null,me=null,Ne=null;this.setModules=function(M,K,o,I){ye=M,this.psy=K,Q=K,me=I,Ne=o};var De=new C;function G(M){var K,o;if(M.ATH.useAdjust==0){M.ATH.adjust=1;return}if(o=M.loudness_sq[0][0],K=M.loudness_sq[1][0],M.channels_out==2?(o+=M.loudness_sq[0][1],K+=M.loudness_sq[1][1]):(o+=o,K+=K),M.mode_gr==2&&(o=Math.max(o,K)),o*=.5,o*=M.ATH.aaSensitivityP,o>.03125)M.ATH.adjust>=1?M.ATH.adjust=1:M.ATH.adjust<M.ATH.adjustLimit&&(M.ATH.adjust=M.ATH.adjustLimit),M.ATH.adjustLimit=1;else{var I=31.98*o+625e-6;M.ATH.adjust>=I?(M.ATH.adjust*=I*.075+.925,M.ATH.adjust<I&&(M.ATH.adjust=I)):M.ATH.adjustLimit>=I?M.ATH.adjust=I:M.ATH.adjust<M.ATH.adjustLimit&&(M.ATH.adjust=M.ATH.adjustLimit),M.ATH.adjustLimit=I}}function de(M){var K,o;for(It(0<=M.bitrate_index&&M.bitrate_index<16),It(0<=M.mode_ext&&M.mode_ext<4),M.bitrate_stereoMode_Hist[M.bitrate_index][4]++,M.bitrate_stereoMode_Hist[15][4]++,M.channels_out==2&&(M.bitrate_stereoMode_Hist[M.bitrate_index][M.mode_ext]++,M.bitrate_stereoMode_Hist[15][M.mode_ext]++),K=0;K<M.mode_gr;++K)for(o=0;o<M.channels_out;++o){var I=M.l3_side.tt[K][o].block_type|0;M.l3_side.tt[K][o].mixed_block_flag!=0&&(I=4),M.bitrate_blockType_Hist[M.bitrate_index][I]++,M.bitrate_blockType_Hist[M.bitrate_index][5]++,M.bitrate_blockType_Hist[15][I]++,M.bitrate_blockType_Hist[15][5]++}}function he(M,K){var o=M.internal_flags,I,H;if(o.lame_encode_frame_init==0){var O,g,_=St(2014),D=St(286+1152+576);for(o.lame_encode_frame_init=1,O=0,g=0;O<286+576*(1+o.mode_gr);++O)O<576*o.mode_gr?(_[O]=0,o.channels_out==2&&(D[O]=0)):(_[O]=K[0][g],o.channels_out==2&&(D[O]=K[1][g]),++g);for(H=0;H<o.mode_gr;H++)for(I=0;I<o.channels_out;I++)o.l3_side.tt[H][I].block_type=Qe.SHORT_TYPE;De.mdct_sub48(o,_,D),It(576>=Qe.FFTOFFSET),It(o.mf_size>=Qe.BLKSIZE+M.framesize-Qe.FFTOFFSET),It(o.mf_size>=512+M.framesize-32)}}this.lame_encode_mp3_frame=function(M,K,o,I,H,O){var g,_=$t([2,2]);_[0][0]=new $,_[0][1]=new $,_[1][0]=new $,_[1][1]=new $;var D=$t([2,2]);D[0][0]=new $,D[0][1]=new $,D[1][0]=new $,D[1][1]=new $;var q,w=[null,null],c=M.internal_flags,L=Dt([2,4]),y=[.5,.5],u=[[0,0],[0,0]],m=[[0,0],[0,0]],b,l,h;if(w[0]=K,w[1]=o,c.lame_encode_frame_init==0&&he(M,w),c.padding=0,(c.slot_lag-=c.frac_SpF)<0&&(c.slot_lag+=M.out_samplerate,c.padding=1),c.psymodel!=0){var x,E=[null,null],X=0,U=Nt(2);for(h=0;h<c.mode_gr;h++){for(l=0;l<c.channels_out;l++)E[l]=w[l],X=576+h*576-Qe.FFTOFFSET;if(M.VBR==gr.vbr_mtrh||M.VBR==gr.vbr_mt?x=Q.L3psycho_anal_vbr(M,E,X,h,_,D,u[h],m[h],L[h],U):x=Q.L3psycho_anal_ns(M,E,X,h,_,D,u[h],m[h],L[h],U),x!=0)return-4;for(M.mode==nr.JOINT_STEREO&&(y[h]=L[h][2]+L[h][3],y[h]>0&&(y[h]=L[h][3]/y[h])),l=0;l<c.channels_out;l++){var j=c.l3_side.tt[h][l];j.block_type=U[l],j.mixed_block_flag=0}}}else for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)c.l3_side.tt[h][l].block_type=Qe.NORM_TYPE,c.l3_side.tt[h][l].mixed_block_flag=0,m[h][l]=u[h][l]=700;if(G(c),De.mdct_sub48(c,w[0],w[1]),c.mode_ext=Qe.MPG_MD_LR_LR,M.force_ms)c.mode_ext=Qe.MPG_MD_MS_LR;else if(M.mode==nr.JOINT_STEREO){var Se=0,f=0;for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)Se+=m[h][l],f+=u[h][l];if(Se<=1*f){var S=c.l3_side.tt[0],fe=c.l3_side.tt[c.mode_gr-1];S[0].block_type==S[1].block_type&&fe[0].block_type==fe[1].block_type&&(c.mode_ext=Qe.MPG_MD_MS_LR)}}if(c.mode_ext==Z?(q=D,b=m):(q=_,b=u),M.analysis&&c.pinfo!=null)for(h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)c.pinfo.ms_ratio[h]=c.ms_ratio[h],c.pinfo.ms_ener_ratio[h]=y[h],c.pinfo.blocktype[h][l]=c.l3_side.tt[h][l].block_type,c.pinfo.pe[h][l]=b[h][l],hr.arraycopy(c.l3_side.tt[h][l].xr,0,c.pinfo.xr[h][l],0,576),c.mode_ext==Z&&(c.pinfo.ers[h][l]=c.pinfo.ers[h][l+2],hr.arraycopy(c.pinfo.energy[h][l+2],0,c.pinfo.energy[h][l],0,c.pinfo.energy[h][l].length));if(M.VBR==gr.vbr_off||M.VBR==gr.vbr_abr){var _e,Oe;for(_e=0;_e<18;_e++)c.nsPsy.pefirbuf[_e]=c.nsPsy.pefirbuf[_e+1];for(Oe=0,h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)Oe+=b[h][l];for(c.nsPsy.pefirbuf[18]=Oe,Oe=c.nsPsy.pefirbuf[9],_e=0;_e<9;_e++)Oe+=(c.nsPsy.pefirbuf[_e]+c.nsPsy.pefirbuf[18-_e])*Qe.fircoef[_e];for(Oe=670*5*c.mode_gr*c.channels_out/Oe,h=0;h<c.mode_gr;h++)for(l=0;l<c.channels_out;l++)b[h][l]*=Oe}if(c.iteration_loop.iteration_loop(M,b,y,q),ye.format_bitstream(M),g=ye.copy_buffer(c,I,H,O,1),M.bWriteVbrTag&&me.addVbrFrame(M),M.analysis&&c.pinfo!=null){for(l=0;l<c.channels_out;l++){var Ue;for(Ue=0;Ue<ie;Ue++)c.pinfo.pcmdata[l][Ue]=c.pinfo.pcmdata[l][Ue+M.framesize];for(Ue=ie;Ue<1600;Ue++)c.pinfo.pcmdata[l][Ue]=w[l][Ue-ie]}Ne.set_frame_pinfo(M,q)}return de(c),g}}var T=Qe,le=P.Util,Le=P.new_float;function $e(){var C=Le(T.BLKSIZE),$=Le(T.BLKSIZE_s/2),ie=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function Z(Q,me,Ne){var De=0,G,de,he;Ne<<=1;var M=me+Ne;G=4;do{var K,o,I,H,O,g,_;_=G>>1,H=G,O=G<<1,g=O+H,G=O<<1,de=me,he=de+_;do{var D,q,w,c;q=Q[de+0]-Q[de+H],D=Q[de+0]+Q[de+H],c=Q[de+O]-Q[de+g],w=Q[de+O]+Q[de+g],Q[de+O]=D-w,Q[de+0]=D+w,Q[de+g]=q-c,Q[de+H]=q+c,q=Q[he+0]-Q[he+H],D=Q[he+0]+Q[he+H],c=le.SQRT2*Q[he+g],w=le.SQRT2*Q[he+O],Q[he+O]=D-w,Q[he+0]=D+w,Q[he+g]=q-c,Q[he+H]=q+c,he+=G,de+=G}while(de<M);for(o=ie[De+0],K=ie[De+1],I=1;I<_;I++){var L,y;L=1-2*K*K,y=2*K*o,de=me+I,he=me+H-I;do{var u,m,b,D,q,l,w,h,c,x;m=y*Q[de+H]-L*Q[he+H],u=L*Q[de+H]+y*Q[he+H],q=Q[de+0]-u,D=Q[de+0]+u,l=Q[he+0]-m,b=Q[he+0]+m,m=y*Q[de+g]-L*Q[he+g],u=L*Q[de+g]+y*Q[he+g],c=Q[de+O]-u,w=Q[de+O]+u,x=Q[he+O]-m,h=Q[he+O]+m,m=K*w-o*x,u=o*w+K*x,Q[de+O]=D-u,Q[de+0]=D+u,Q[he+g]=l-m,Q[he+H]=l+m,m=o*h-K*c,u=K*h+o*c,Q[he+O]=b-u,Q[he+0]=b+u,Q[de+g]=q-m,Q[de+H]=q+m,he+=G,de+=G}while(de<M);L=o,o=L*ie[De+0]-K*ie[De+1],K=L*ie[De+1]+K*ie[De+0]}De+=2}while(G<Ne)}var ye=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function(Q,me,Ne,De,G){for(var de=0;de<3;de++){var he=T.BLKSIZE_s/2,M=65535&576/3*(de+1),K=T.BLKSIZE_s/8-1;do{var o,I,H,O,g,_=ye[K<<2]&255;o=$[_]*De[Ne][G+_+M],g=$[127-_]*De[Ne][G+_+M+128],I=o-g,o=o+g,H=$[_+64]*De[Ne][G+_+M+64],g=$[63-_]*De[Ne][G+_+M+192],O=H-g,H=H+g,he-=4,me[de][he+0]=o+H,me[de][he+2]=o-H,me[de][he+1]=I+O,me[de][he+3]=I-O,o=$[_+1]*De[Ne][G+_+M+1],g=$[126-_]*De[Ne][G+_+M+129],I=o-g,o=o+g,H=$[_+65]*De[Ne][G+_+M+65],g=$[62-_]*De[Ne][G+_+M+193],O=H-g,H=H+g,me[de][he+T.BLKSIZE_s/2+0]=o+H,me[de][he+T.BLKSIZE_s/2+2]=o-H,me[de][he+T.BLKSIZE_s/2+1]=I+O,me[de][he+T.BLKSIZE_s/2+3]=I-O}while(--K>=0);Z(me[de],he,T.BLKSIZE_s/2)}},this.fft_long=function(Q,me,Ne,De,G){var de=T.BLKSIZE/8-1,he=T.BLKSIZE/2;do{var M,K,o,I,H,O=ye[de]&255;M=C[O]*De[Ne][G+O],H=C[O+512]*De[Ne][G+O+512],K=M-H,M=M+H,o=C[O+256]*De[Ne][G+O+256],H=C[O+768]*De[Ne][G+O+768],I=o-H,o=o+H,he-=4,me[he+0]=M+o,me[he+2]=M-o,me[he+1]=K+I,me[he+3]=K-I,M=C[O+1]*De[Ne][G+O+1],H=C[O+513]*De[Ne][G+O+513],K=M-H,M=M+H,o=C[O+257]*De[Ne][G+O+257],H=C[O+769]*De[Ne][G+O+769],I=o-H,o=o+H,me[he+T.BLKSIZE/2+0]=M+o,me[he+T.BLKSIZE/2+2]=M-o,me[he+T.BLKSIZE/2+1]=K+I,me[he+T.BLKSIZE/2+3]=K-I}while(--de>=0);Z(me,he,T.BLKSIZE/2)},this.init_fft=function(Q){for(var me=0;me<T.BLKSIZE;me++)C[me]=.42-.5*Math.cos(2*Math.PI*(me+.5)/T.BLKSIZE)+.08*Math.cos(4*Math.PI*(me+.5)/T.BLKSIZE);for(var me=0;me<T.BLKSIZE_s/2;me++)$[me]=.5*(1-Math.cos(2*Math.PI*(me+.5)/T.BLKSIZE_s))}}var ae=$e,be=P.VbrMode,Ie=P.Float,Ce=P.ShortBlock,Be=P.Util,Ye=P.Arrays,Fe=P.new_float,ot=P.new_float_n,mt=P.new_int,Ee=P.assert;function br(){var C=new ae,$=2.302585092994046,ie=2,Z=16,ye=2,Q=16,me=.34,Ne=1/(14752*14752)/(T.BLKSIZE/2),De=.01,G=.8,de=.6,he=.3,M=3.5,K=4.4,o=25,I=21,H=.2302585093;function O(R){return R}function g(R,A){for(var F=0,V=0;V<T.BLKSIZE/2;++V)F+=R[V]*A.ATH.eql_w[V];return F*=Ne,F}function _(R,A,F,V,J,N,Y,re,W,ve,ne){var pe=R.internal_flags;if(W<2)C.fft_long(pe,V[J],W,ve,ne),C.fft_short(pe,N[Y],W,ve,ne);else if(W==2){for(var He=T.BLKSIZE-1;He>=0;--He){var rt=V[J+0][He],Re=V[J+1][He];V[J+0][He]=(rt+Re)*Be.SQRT2*.5,V[J+1][He]=(rt-Re)*Be.SQRT2*.5}for(var Ze=2;Ze>=0;--Ze)for(var He=T.BLKSIZE_s-1;He>=0;--He){var rt=N[Y+0][Ze][He],Re=N[Y+1][Ze][He];N[Y+0][Ze][He]=(rt+Re)*Be.SQRT2*.5,N[Y+1][Ze][He]=(rt-Re)*Be.SQRT2*.5}}A[0]=V[J+0][0],A[0]*=A[0];for(var He=T.BLKSIZE/2-1;He>=0;--He){var ue=V[J+0][T.BLKSIZE/2-He],Xe=V[J+0][T.BLKSIZE/2+He];A[T.BLKSIZE/2-He]=(ue*ue+Xe*Xe)*.5}for(var Ze=2;Ze>=0;--Ze){F[Ze][0]=N[Y+0][Ze][0],F[Ze][0]*=F[Ze][0];for(var He=T.BLKSIZE_s/2-1;He>=0;--He){var ue=N[Y+0][Ze][T.BLKSIZE_s/2-He],Xe=N[Y+0][Ze][T.BLKSIZE_s/2+He];F[Ze][T.BLKSIZE_s/2-He]=(ue*ue+Xe*Xe)*.5}}{for(var vt=0,He=11;He<T.HBLKSIZE;He++)vt+=A[He];pe.tot_ener[W]=vt}if(R.analysis){for(var He=0;He<T.HBLKSIZE;He++)pe.pinfo.energy[re][W][He]=pe.pinfo.energy_save[W][He],pe.pinfo.energy_save[W][He]=A[He];pe.pinfo.pe[re][W]=pe.pe[W]}R.athaa_loudapprox==2&&W<2&&(pe.loudness_sq[re][W]=pe.loudness_sq_save[W],pe.loudness_sq_save[W]=g(A,pe))}var D=8,q=23,w=15,c,L,y,u=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749];function m(){c=Math.pow(10,(D+1)/16),L=Math.pow(10,(q+1)/16),y=Math.pow(10,w/10)}var b=[3.3246*3.3246,3.23837*3.23837,3.15437*3.15437,3.00412*3.00412,2.86103*2.86103,2.65407*2.65407,2.46209*2.46209,2.284*2.284,2.11879*2.11879,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,1.56911*1.56911,1.46658*1.46658,1.37074*1.37074,1.31036*1.31036,1.25264*1.25264,1.20648*1.20648,1.16203*1.16203,1.12765*1.12765,1.09428*1.09428,1.0659*1.0659,1.03826*1.03826,1.01895*1.01895,1],l=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1],h=[2.35364*2.35364,2.29259*2.29259,2.23313*2.23313,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,1.49999*1.49999,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.11084*1.11084,1.03826*1.03826];function x(R,A,F,V,J,N){var Y;if(A>R)if(A<R*L)Y=A/R;else return R+A;else{if(R>=A*L)return R+A;Y=R/A}if(Ee(R>=0),Ee(A>=0),R+=A,V+3<=3+3){if(Y>=c)return R;var re=0|Be.FAST_LOG10_X(Y,16);return R*l[re]}var re=0|Be.FAST_LOG10_X(Y,16);if(N!=0?A=J.ATH.cb_s[F]*J.ATH.adjust:A=J.ATH.cb_l[F]*J.ATH.adjust,Ee(A>=0),R<y*A){if(R>A){var W,ve;return W=1,re<=13&&(W=h[re]),ve=Be.FAST_LOG10_X(R/A,10/15),R*((b[re]-W)*ve+W)}return re>13?R:R*h[re]}return R*b[re]}var E=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1];function X(R,A,F){var V;if(R<0&&(R=0),A<0&&(A=0),R<=0)return A;if(A<=0)return R;if(A>R?V=A/R:V=R/A,-2<=F&&F<=2){if(V>=c)return R+A;var J=0|Be.FAST_LOG10_X(V,16);return(R+A)*E[J]}return V<L?R+A:(R<A&&(R=A),R)}function U(R,A){var F=R.internal_flags;if(F.channels_out>1){for(var V=0;V<T.SBMAX_l;V++){var J=F.thm[0].l[V],N=F.thm[1].l[V];F.thm[0].l[V]+=N*A,F.thm[1].l[V]+=J*A}for(var V=0;V<T.SBMAX_s;V++)for(var Y=0;Y<3;Y++){var J=F.thm[0].s[V][Y],N=F.thm[1].s[V][Y];F.thm[0].s[V][Y]+=N*A,F.thm[1].s[V][Y]+=J*A}}}function j(R){for(var A=0;A<T.SBMAX_l;A++)if(!(R.thm[0].l[A]>1.58*R.thm[1].l[A]||R.thm[1].l[A]>1.58*R.thm[0].l[A])){var F=R.mld_l[A]*R.en[3].l[A],V=Math.max(R.thm[2].l[A],Math.min(R.thm[3].l[A],F));F=R.mld_l[A]*R.en[2].l[A];var J=Math.max(R.thm[3].l[A],Math.min(R.thm[2].l[A],F));R.thm[2].l[A]=V,R.thm[3].l[A]=J}for(var A=0;A<T.SBMAX_s;A++)for(var N=0;N<3;N++)if(!(R.thm[0].s[A][N]>1.58*R.thm[1].s[A][N]||R.thm[1].s[A][N]>1.58*R.thm[0].s[A][N])){var F=R.mld_s[A]*R.en[3].s[A][N],V=Math.max(R.thm[2].s[A][N],Math.min(R.thm[3].s[A][N],F));F=R.mld_s[A]*R.en[2].s[A][N];var J=Math.max(R.thm[3].s[A][N],Math.min(R.thm[2].s[A][N],F));R.thm[2].s[A][N]=V,R.thm[3].s[A][N]=J}}function Se(R,A,F){var V=A,J=Math.pow(10,F);A*=2,V*=2;for(var N=0;N<T.SBMAX_l;N++){var Y,re,W,ve;if(ve=R.ATH.cb_l[R.bm_l[N]]*J,Y=Math.min(Math.max(R.thm[0].l[N],ve),Math.max(R.thm[1].l[N],ve)),re=Math.max(R.thm[2].l[N],ve),W=Math.max(R.thm[3].l[N],ve),Y*A<re+W){var ne=Y*V/(re+W);re*=ne,W*=ne,Ee(re+W>0)}R.thm[2].l[N]=Math.min(re,R.thm[2].l[N]),R.thm[3].l[N]=Math.min(W,R.thm[3].l[N])}J*=T.BLKSIZE_s/T.BLKSIZE;for(var N=0;N<T.SBMAX_s;N++)for(var pe=0;pe<3;pe++){var Y,re,W,ve;if(ve=R.ATH.cb_s[R.bm_s[N]]*J,Y=Math.min(Math.max(R.thm[0].s[N][pe],ve),Math.max(R.thm[1].s[N][pe],ve)),re=Math.max(R.thm[2].s[N][pe],ve),W=Math.max(R.thm[3].s[N][pe],ve),Y*A<re+W){var ne=Y*A/(re+W);re*=ne,W*=ne,Ee(re+W>0)}R.thm[2].s[N][pe]=Math.min(R.thm[2].s[N][pe],re),R.thm[3].s[N][pe]=Math.min(R.thm[3].s[N][pe],W)}}function f(R,A,F,V,J){var N,Y,re=0,W=0;for(N=Y=0;N<T.SBMAX_s;++Y,++N){for(var ve=R.bo_s[N],ne=R.npart_s,pe=ve<ne?ve:ne;Y<pe;)Ee(A[Y]>=0),Ee(F[Y]>=0),re+=A[Y],W+=F[Y],Y++;if(R.en[V].s[N][J]=re,R.thm[V].s[N][J]=W,Y>=ne){++N;break}Ee(A[Y]>=0),Ee(F[Y]>=0);{var He=R.PSY.bo_s_weight[N],rt=1-He;re=He*A[Y],W=He*F[Y],R.en[V].s[N][J]+=re,R.thm[V].s[N][J]+=W,re=rt*A[Y],W=rt*F[Y]}}for(;N<T.SBMAX_s;++N)R.en[V].s[N][J]=0,R.thm[V].s[N][J]=0}function S(R,A,F,V){var J,N,Y=0,re=0;for(J=N=0;J<T.SBMAX_l;++N,++J){for(var W=R.bo_l[J],ve=R.npart_l,ne=W<ve?W:ve;N<ne;)Ee(A[N]>=0),Ee(F[N]>=0),Y+=A[N],re+=F[N],N++;if(R.en[V].l[J]=Y,R.thm[V].l[J]=re,N>=ve){++J;break}Ee(A[N]>=0),Ee(F[N]>=0);{var pe=R.PSY.bo_l_weight[J],He=1-pe;Y=pe*A[N],re=pe*F[N],R.en[V].l[J]+=Y,R.thm[V].l[J]+=re,Y=He*A[N],re=He*F[N]}}for(;J<T.SBMAX_l;++J)R.en[V].l[J]=0,R.thm[V].l[J]=0}function fe(R,A,F,V,J,N){var Y=R.internal_flags,re,W;for(W=re=0;W<Y.npart_s;++W){for(var ve=0,ne=0,pe=Y.numlines_s[W],He=0;He<pe;++He,++re){var rt=A[N][re];ve+=rt,ne<rt&&(ne=rt)}F[W]=ve}for(Ee(W==Y.npart_s),Ee(re==129),re=W=0;W<Y.npart_s;W++){var Re=Y.s3ind_s[W][0],Ze=Y.s3_ss[re++]*F[Re];for(++Re;Re<=Y.s3ind_s[W][1];)Ze+=Y.s3_ss[re]*F[Re],++re,++Re;{var ue=ye*Y.nb_s1[J][W];V[W]=Math.min(Ze,ue)}if(Y.blocktype_old[J&1]==T.SHORT_TYPE){var ue=Q*Y.nb_s2[J][W],Xe=V[W];V[W]=Math.min(ue,Xe)}Y.nb_s2[J][W]=Y.nb_s1[J][W],Y.nb_s1[J][W]=Ze,Ee(V[W]>=0)}for(;W<=T.CBANDS;++W)F[W]=0,V[W]=0}function _e(R,A,F,V){var J=R.internal_flags;R.short_blocks==Ce.short_block_coupled&&!(A[0]!=0&&A[1]!=0)&&(A[0]=A[1]=0);for(var N=0;N<J.channels_out;N++)V[N]=T.NORM_TYPE,R.short_blocks==Ce.short_block_dispensed&&(A[N]=1),R.short_blocks==Ce.short_block_forced&&(A[N]=0),A[N]!=0?(Ee(J.blocktype_old[N]!=T.START_TYPE),J.blocktype_old[N]==T.SHORT_TYPE&&(V[N]=T.STOP_TYPE)):(V[N]=T.SHORT_TYPE,J.blocktype_old[N]==T.NORM_TYPE&&(J.blocktype_old[N]=T.START_TYPE),J.blocktype_old[N]==T.STOP_TYPE&&(J.blocktype_old[N]=T.SHORT_TYPE)),F[N]=J.blocktype_old[N],J.blocktype_old[N]=V[N]}function Oe(R,A,F){return F>=1?R:F<=0?A:A>0?Math.pow(R/A,F)*A:0}var Ue=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function je(R,A){for(var F=309.07,V=0;V<T.SBMAX_s-1;V++)for(var J=0;J<3;J++){var N=R.thm.s[V][J];if(Ee(V<Ue.length),N>0){var Y=N*A,re=R.en.s[V][J];re>Y&&(re>Y*1e10?F+=Ue[V]*(10*$):(Ee(Y>0),F+=Ue[V]*Be.FAST_LOG10(re/Y)))}}return F}var ze=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function nt(R,A){for(var F=281.0575,V=0;V<T.SBMAX_l-1;V++){var J=R.thm.l[V];if(Ee(V<ze.length),J>0){var N=J*A,Y=R.en.l[V];Y>N&&(Y>N*1e10?F+=ze[V]*(10*$):(Ee(N>0),F+=ze[V]*Be.FAST_LOG10(Y/N)))}}return F}function Ke(R,A,F,V,J){var N,Y;for(N=Y=0;N<R.npart_l;++N){var re=0,W=0,ve;for(ve=0;ve<R.numlines_l[N];++ve,++Y){var ne=A[Y];Ee(ne>=0),re+=ne,W<ne&&(W=ne)}F[N]=re,V[N]=W,J[N]=re*R.rnumlines_l[N],Ee(R.rnumlines_l[N]>=0),Ee(re>=0),Ee(F[N]>=0),Ee(V[N]>=0),Ee(J[N]>=0)}}function Ve(R,A,F,V){var J=u.length-1,N=0,Y=F[N]+F[N+1];if(Ee(Y>=0),Y>0){var re=A[N];re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_l[N]+R.numlines_l[N+1]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_l[N]+R.numlines_l[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;for(N=1;N<R.npart_l-1;N++)if(Y=F[N-1]+F[N]+F[N+1],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_l[N-1]+R.numlines_l[N]+R.numlines_l[N+1]-1>0),Y=20*(re*3-Y)/(Y*(R.numlines_l[N-1]+R.numlines_l[N]+R.numlines_l[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;if(Ee(N>0),Ee(N==R.npart_l-1),Y=F[N-1]+F[N],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),Ee(R.numlines_l[N-1]+R.numlines_l[N]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_l[N-1]+R.numlines_l[N]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;Ee(N==R.npart_l-1)}var xt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];this.L3psycho_anal_ns=function(R,A,F,V,J,N,Y,re,W,ve){var ne=R.internal_flags,pe=ot([2,T.BLKSIZE]),He=ot([2,3,T.BLKSIZE_s]),rt=Fe(T.CBANDS+1),Re=Fe(T.CBANDS+1),Ze=Fe(T.CBANDS+2),ue=mt(2),Xe=mt(2),vt,Ae,We,Te,Je,Ft,qe,ct,pt=ot([2,576]),Vt,Xr=mt(T.CBANDS+2),Zt=mt(T.CBANDS+2);for(Ye.fill(Zt,0),vt=ne.channels_out,R.mode==nr.JOINT_STEREO&&(vt=4),R.VBR==be.vbr_off?Vt=ne.ResvMax==0?0:ne.ResvSize/ne.ResvMax*.5:R.VBR==be.vbr_rh||R.VBR==be.vbr_mtrh||R.VBR==be.vbr_mt?Vt=.6:Vt=1,Ae=0;Ae<ne.channels_out;Ae++){var Ht=A[Ae],Ur=F+576-350-I+192;for(Ee(xt.length==(I-1)/2),Te=0;Te<576;Te++){var Kr,Wr;for(Kr=Ht[Ur+Te+10],Wr=0,Je=0;Je<(I-1)/2-1;Je+=2)Kr+=xt[Je]*(Ht[Ur+Te+Je]+Ht[Ur+Te+I-Je]),Wr+=xt[Je+1]*(Ht[Ur+Te+Je+1]+Ht[Ur+Te+I-Je-1]);pt[Ae][Te]=Kr+Wr}J[V][Ae].en.assign(ne.en[Ae]),J[V][Ae].thm.assign(ne.thm[Ae]),vt>2&&(N[V][Ae].en.assign(ne.en[Ae+2]),N[V][Ae].thm.assign(ne.thm[Ae+2]))}for(Ae=0;Ae<vt;Ae++){var gn,bn,Er=Fe(12),Fn=[0,0,0,0],ia=Fe(12),m0=1,Vc,qc=Fe(T.CBANDS),zc=Fe(T.CBANDS),qt=[0,0,0,0],jc=Fe(T.HBLKSIZE),Gc=ot([3,T.HBLKSIZE_s]);for(Ee(ne.npart_s<=T.CBANDS),Ee(ne.npart_l<=T.CBANDS),Te=0;Te<3;Te++)Er[Te]=ne.nsPsy.last_en_subshort[Ae][Te+6],Ee(ne.nsPsy.last_en_subshort[Ae][Te+4]>0),ia[Te]=Er[Te]/ne.nsPsy.last_en_subshort[Ae][Te+4],Fn[0]+=Er[Te];if(Ae==2)for(Te=0;Te<576;Te++){var p0,h0;p0=pt[0][Te],h0=pt[1][Te],pt[0][Te]=p0+h0,pt[1][Te]=p0-h0}{var Xc=pt[Ae&1],Wa=0;for(Te=0;Te<9;Te++){for(var Gd=Wa+64,lr=1;Wa<Gd;Wa++)lr<Math.abs(Xc[Wa])&&(lr=Math.abs(Xc[Wa]));ne.nsPsy.last_en_subshort[Ae][Te]=Er[Te+3]=lr,Fn[1+Te/3]+=lr,lr>Er[Te+3-2]?(Ee(Er[Te+3-2]>0),lr=lr/Er[Te+3-2]):Er[Te+3-2]>lr*10?(Ee(lr>0),lr=Er[Te+3-2]/(lr*10)):lr=0,ia[Te+3]=lr}}if(R.analysis){var _0=ia[0];for(Te=1;Te<12;Te++)_0<ia[Te]&&(_0=ia[Te]);ne.pinfo.ers[V][Ae]=ne.pinfo.ers_save[Ae],ne.pinfo.ers_save[Ae]=_0}for(Vc=Ae==3?ne.nsPsy.attackthre_s:ne.nsPsy.attackthre,Te=0;Te<12;Te++)qt[Te/3]==0&&ia[Te]>Vc&&(qt[Te/3]=Te%3+1);for(Te=1;Te<4;Te++){var S0;Fn[Te-1]>Fn[Te]?(Ee(Fn[Te]>0),S0=Fn[Te-1]/Fn[Te]):(Ee(Fn[Te-1]>0),S0=Fn[Te]/Fn[Te-1]),S0<1.7&&(qt[Te]=0,Te==1&&(qt[0]=0))}for(qt[0]!=0&&ne.nsPsy.lastAttacks[Ae]!=0&&(qt[0]=0),(ne.nsPsy.lastAttacks[Ae]==3||qt[0]+qt[1]+qt[2]+qt[3]!=0)&&(m0=0,qt[1]!=0&&qt[0]!=0&&(qt[1]=0),qt[2]!=0&&qt[1]!=0&&(qt[2]=0),qt[3]!=0&&qt[2]!=0&&(qt[3]=0)),Ae<2?Xe[Ae]=m0:m0==0&&(Xe[0]=Xe[1]=0),W[Ae]=ne.tot_ener[Ae],bn=He,gn=pe,_(R,jc,Gc,gn,Ae&1,bn,Ae&1,V,Ae,A,F),Ke(ne,jc,rt,qc,zc),Ve(ne,qc,zc,Xr),ct=0;ct<3;ct++){var g0,Hr;for(fe(R,Gc,Re,Ze,Ae,ct),f(ne,Re,Ze,Ae,ct),qe=0;qe<T.SBMAX_s;qe++){if(Hr=ne.thm[Ae].s[qe][ct],Hr*=G,qt[ct]>=2||qt[ct+1]==1){var Ya=ct!=0?ct-1:2,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,de*Vt);Hr=Math.min(Hr,lr)}if(qt[ct]==1){var Ya=ct!=0?ct-1:2,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,he*Vt);Hr=Math.min(Hr,lr)}else if(ct!=0&&qt[ct-1]==3||ct==0&&ne.nsPsy.lastAttacks[Ae]==3){var Ya=ct!=2?ct+1:0,lr=Oe(ne.thm[Ae].s[qe][Ya],Hr,he*Vt);Hr=Math.min(Hr,lr)}g0=Er[ct*3+3]+Er[ct*3+4]+Er[ct*3+5],Er[ct*3+5]*6<g0&&(Hr*=.5,Er[ct*3+4]*6<g0&&(Hr*=.5)),ne.thm[Ae].s[qe][ct]=Hr}}for(ne.nsPsy.lastAttacks[Ae]=qt[2],Ft=0,We=0;We<ne.npart_l;We++){for(var Mi=ne.s3ind[We][0],b0=rt[Mi]*u[Xr[Mi]],Pi=ne.s3_ll[Ft++]*b0;++Mi<=ne.s3ind[We][1];)b0=rt[Mi]*u[Xr[Mi]],Pi=x(Pi,ne.s3_ll[Ft++]*b0,Mi,Mi-We,ne,0);Pi*=.158489319246111,ne.blocktype_old[Ae&1]==T.SHORT_TYPE?Ze[We]=Pi:Ze[We]=Oe(Math.min(Pi,Math.min(ie*ne.nb_1[Ae][We],Z*ne.nb_2[Ae][We])),Pi,Vt),ne.nb_2[Ae][We]=ne.nb_1[Ae][We],ne.nb_1[Ae][We]=Pi}for(;We<=T.CBANDS;++We)rt[We]=0,Ze[We]=0;S(ne,rt,Ze,Ae)}if((R.mode==nr.STEREO||R.mode==nr.JOINT_STEREO)&&R.interChRatio>0&&U(R,R.interChRatio),R.mode==nr.JOINT_STEREO){var x0;j(ne),x0=R.msfix,Math.abs(x0)>0&&Se(ne,x0,R.ATHlower*ne.ATH.adjust)}for(_e(R,Xe,ve,ue),Ae=0;Ae<vt;Ae++){var $a,Za=0,Go,Xo;Ae>1?($a=re,Za=-2,Go=T.NORM_TYPE,(ve[0]==T.SHORT_TYPE||ve[1]==T.SHORT_TYPE)&&(Go=T.SHORT_TYPE),Xo=N[V][Ae-2]):($a=Y,Za=0,Go=ve[Ae],Xo=J[V][Ae]),Go==T.SHORT_TYPE?$a[Za+Ae]=je(Xo,ne.masking_lower):$a[Za+Ae]=nt(Xo,ne.masking_lower),R.analysis&&(ne.pinfo.pe[V][Ae]=$a[Za+Ae])}return 0};function Ot(R,A,F,V,J,N,Y,re){var W=R.internal_flags;if(V<2)C.fft_long(W,Y[re],V,A,F);else if(V==2)for(var ve=T.BLKSIZE-1;ve>=0;--ve){var ne=Y[re+0][ve],pe=Y[re+1][ve];Y[re+0][ve]=(ne+pe)*Be.SQRT2*.5,Y[re+1][ve]=(ne-pe)*Be.SQRT2*.5}N[0]=Y[re+0][0],N[0]*=N[0];for(var ve=T.BLKSIZE/2-1;ve>=0;--ve){var He=Y[re+0][T.BLKSIZE/2-ve],rt=Y[re+0][T.BLKSIZE/2+ve];N[T.BLKSIZE/2-ve]=(He*He+rt*rt)*.5}{for(var Re=0,ve=11;ve<T.HBLKSIZE;ve++)Re+=N[ve];W.tot_ener[V]=Re}if(R.analysis){for(var ve=0;ve<T.HBLKSIZE;ve++)W.pinfo.energy[J][V][ve]=W.pinfo.energy_save[V][ve],W.pinfo.energy_save[V][ve]=N[ve];W.pinfo.pe[J][V]=W.pe[V]}}function Rt(R,A,F,V,J,N,Y,re){var W=R.internal_flags;if(J==0&&V<2&&C.fft_short(W,Y[re],V,A,F),V==2)for(var ve=T.BLKSIZE_s-1;ve>=0;--ve){var ne=Y[re+0][J][ve],pe=Y[re+1][J][ve];Y[re+0][J][ve]=(ne+pe)*Be.SQRT2*.5,Y[re+1][J][ve]=(ne-pe)*Be.SQRT2*.5}N[J][0]=Y[re+0][J][0],N[J][0]*=N[J][0];for(var ve=T.BLKSIZE_s/2-1;ve>=0;--ve){var He=Y[re+0][J][T.BLKSIZE_s/2-ve],rt=Y[re+0][J][T.BLKSIZE_s/2+ve];N[J][T.BLKSIZE_s/2-ve]=(He*He+rt*rt)*.5}}function Lt(R,A,F,V){var J=R.internal_flags;R.athaa_loudapprox==2&&F<2&&(J.loudness_sq[A][F]=J.loudness_sq_save[F],J.loudness_sq_save[F]=g(V,J))}var jt=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];function Kt(R,A,F,V,J,N,Y,re,W,ve){for(var ne=ot([2,576]),pe=R.internal_flags,He=pe.channels_out,rt=R.mode==nr.JOINT_STEREO?4:He,Re=0;Re<He;Re++){firbuf=A[Re];var Ze=F+576-350-I+192;Ee(jt.length==(I-1)/2);for(var ue=0;ue<576;ue++){var Xe,vt;Xe=firbuf[Ze+ue+10],vt=0;for(var Ae=0;Ae<(I-1)/2-1;Ae+=2)Xe+=jt[Ae]*(firbuf[Ze+ue+Ae]+firbuf[Ze+ue+I-Ae]),vt+=jt[Ae+1]*(firbuf[Ze+ue+Ae+1]+firbuf[Ze+ue+I-Ae-1]);ne[Re][ue]=Xe+vt}J[V][Re].en.assign(pe.en[Re]),J[V][Re].thm.assign(pe.thm[Re]),rt>2&&(N[V][Re].en.assign(pe.en[Re+2]),N[V][Re].thm.assign(pe.thm[Re+2]))}for(var Re=0;Re<rt;Re++){var We=Fe(12),Te=Fe(12),Je=[0,0,0,0],Ft=ne[Re&1],qe=0,ct=Re==3?pe.nsPsy.attackthre_s:pe.nsPsy.attackthre,pt=1;if(Re==2)for(var ue=0,Ae=576;Ae>0;++ue,--Ae){var Vt=ne[0][ue],Xr=ne[1][ue];ne[0][ue]=Vt+Xr,ne[1][ue]=Vt-Xr}for(var ue=0;ue<3;ue++)Te[ue]=pe.nsPsy.last_en_subshort[Re][ue+6],Ee(pe.nsPsy.last_en_subshort[Re][ue+4]>0),We[ue]=Te[ue]/pe.nsPsy.last_en_subshort[Re][ue+4],Je[0]+=Te[ue];for(var ue=0;ue<9;ue++){for(var Zt=qe+64,Ht=1;qe<Zt;qe++)Ht<Math.abs(Ft[qe])&&(Ht=Math.abs(Ft[qe]));pe.nsPsy.last_en_subshort[Re][ue]=Te[ue+3]=Ht,Je[1+ue/3]+=Ht,Ht>Te[ue+3-2]?(Ee(Te[ue+3-2]>0),Ht=Ht/Te[ue+3-2]):Te[ue+3-2]>Ht*10?(Ee(Ht>0),Ht=Te[ue+3-2]/(Ht*10)):Ht=0,We[ue+3]=Ht}for(var ue=0;ue<3;++ue){var Ur=Te[ue*3+3]+Te[ue*3+4]+Te[ue*3+5],Kr=1;Te[ue*3+5]*6<Ur&&(Kr*=.5,Te[ue*3+4]*6<Ur&&(Kr*=.5)),re[Re][ue]=Kr}if(R.analysis){for(var Wr=We[0],ue=1;ue<12;ue++)Wr<We[ue]&&(Wr=We[ue]);pe.pinfo.ers[V][Re]=pe.pinfo.ers_save[Re],pe.pinfo.ers_save[Re]=Wr}for(var ue=0;ue<12;ue++)W[Re][ue/3]==0&&We[ue]>ct&&(W[Re][ue/3]=ue%3+1);for(var ue=1;ue<4;ue++){var gn=Je[ue-1],bn=Je[ue],Er=Math.max(gn,bn);Er<4e4&&gn<1.7*bn&&bn<1.7*gn&&(ue==1&&W[Re][0]<=W[Re][ue]&&(W[Re][0]=0),W[Re][ue]=0)}W[Re][0]<=pe.nsPsy.lastAttacks[Re]&&(W[Re][0]=0),(pe.nsPsy.lastAttacks[Re]==3||W[Re][0]+W[Re][1]+W[Re][2]+W[Re][3]!=0)&&(pt=0,W[Re][1]!=0&&W[Re][0]!=0&&(W[Re][1]=0),W[Re][2]!=0&&W[Re][1]!=0&&(W[Re][2]=0),W[Re][3]!=0&&W[Re][2]!=0&&(W[Re][3]=0)),Re<2?ve[Re]=pt:pt==0&&(ve[0]=ve[1]=0),Y[Re]=pe.tot_ener[Re]}}function _r(R,A,F){if(F==0)for(var V=0;V<R.npart_s;V++)R.nb_s2[A][V]=R.nb_s1[A][V],R.nb_s1[A][V]=0}function Ln(R,A){for(var F=0;F<R.npart_l;F++)R.nb_2[A][F]=R.nb_1[A][F],R.nb_1[A][F]=0}function Lr(R,A,F,V){var J=u.length-1,N=0,Y=F[N]+F[N+1];if(Ee(Y>=0),Y>0){var re=A[N];re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_s[N]+R.numlines_s[N+1]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_s[N]+R.numlines_s[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;for(N=1;N<R.npart_s-1;N++)if(Y=F[N-1]+F[N]+F[N+1],Ee(N+1<R.npart_s),Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),re<A[N+1]&&(re=A[N+1]),Ee(R.numlines_s[N-1]+R.numlines_s[N]+R.numlines_s[N+1]-1>0),Y=20*(re*3-Y)/(Y*(R.numlines_s[N-1]+R.numlines_s[N]+R.numlines_s[N+1]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;if(Ee(N>0),Ee(N==R.npart_s-1),Y=F[N-1]+F[N],Ee(Y>=0),Y>0){var re=A[N-1];re<A[N]&&(re=A[N]),Ee(R.numlines_s[N-1]+R.numlines_s[N]-1>0),Y=20*(re*2-Y)/(Y*(R.numlines_s[N-1]+R.numlines_s[N]-1));var W=0|Y;W>J&&(W=J),V[N]=W}else V[N]=0;Ee(N==R.npart_s-1)}function Fr(R,A,F,V,J,N){var Y=R.internal_flags,re=new float[T.CBANDS],W=Fe(T.CBANDS),ve,ne,pe,He=new int[T.CBANDS];for(pe=ne=0;pe<Y.npart_s;++pe){var rt=0,Re=0,Ze=Y.numlines_s[pe];for(ve=0;ve<Ze;++ve,++ne){var ue=A[N][ne];rt+=ue,Re<ue&&(Re=ue)}F[pe]=rt,Ee(rt>=0),re[pe]=Re,Ee(Ze>0),W[pe]=rt/Ze,Ee(W[pe]>=0)}for(Ee(pe==Y.npart_s),Ee(ne==129);pe<T.CBANDS;++pe)re[pe]=0,W[pe]=0;for(Lr(Y,re,W,He),ne=pe=0;pe<Y.npart_s;pe++){var Xe=Y.s3ind_s[pe][0],vt=Y.s3ind_s[pe][1],Ae,We,Te,Je,Ft;for(Ae=He[Xe],We=1,Je=Y.s3_ss[ne]*F[Xe]*u[He[Xe]],++ne,++Xe;Xe<=vt;)Ae+=He[Xe],We+=1,Te=Y.s3_ss[ne]*F[Xe]*u[He[Xe]],Je=X(Je,Te,Xe-pe),++ne,++Xe;Ae=(1+2*Ae)/(2*We),Ft=u[Ae]*.5,Je*=Ft,V[pe]=Je,Y.nb_s2[J][pe]=Y.nb_s1[J][pe],Y.nb_s1[J][pe]=Je,Te=re[pe],Te*=Y.minval_s[pe],Te*=Ft,V[pe]>Te&&(V[pe]=Te),Y.masking_lower>1&&(V[pe]*=Y.masking_lower),V[pe]>F[pe]&&(V[pe]=F[pe]),Y.masking_lower<1&&(V[pe]*=Y.masking_lower),Ee(V[pe]>=0)}for(;pe<T.CBANDS;++pe)F[pe]=0,V[pe]=0}function _n(R,A,F,V,J){var N=Fe(T.CBANDS),Y=Fe(T.CBANDS),re=mt(T.CBANDS+2),W;Ke(R,A,F,N,Y),Ve(R,N,Y,re);var ve=0;for(W=0;W<R.npart_l;W++){var ne,pe,He,rt,Re=R.s3ind[W][0],Ze=R.s3ind[W][1],ue=0,Xe=0;for(ue=re[Re],Xe+=1,pe=R.s3_ll[ve]*F[Re]*u[re[Re]],++ve,++Re;Re<=Ze;)ue+=re[Re],Xe+=1,ne=R.s3_ll[ve]*F[Re]*u[re[Re]],rt=X(pe,ne,Re-W),pe=rt,++ve,++Re;if(ue=(1+2*ue)/(2*Xe),He=u[ue]*.5,pe*=He,R.blocktype_old[J&1]==T.SHORT_TYPE){var vt=ie*R.nb_1[J][W];vt>0?V[W]=Math.min(pe,vt):V[W]=Math.min(pe,F[W]*he)}else{var Ae=Z*R.nb_2[J][W],We=ie*R.nb_1[J][W],vt;Ae<=0&&(Ae=pe),We<=0&&(We=pe),R.blocktype_old[J&1]==T.NORM_TYPE?vt=Math.min(We,Ae):vt=We,V[W]=Math.min(pe,vt)}R.nb_2[J][W]=R.nb_1[J][W],R.nb_1[J][W]=pe,ne=N[W],ne*=R.minval_l[W],ne*=He,V[W]>ne&&(V[W]=ne),R.masking_lower>1&&(V[W]*=R.masking_lower),V[W]>F[W]&&(V[W]=F[W]),R.masking_lower<1&&(V[W]*=R.masking_lower),Ee(V[W]>=0)}for(;W<T.CBANDS;++W)F[W]=0,V[W]=0}function Ii(R,A){var F=R.internal_flags;R.short_blocks==Ce.short_block_coupled&&!(A[0]!=0&&A[1]!=0)&&(A[0]=A[1]=0);for(var V=0;V<F.channels_out;V++)R.short_blocks==Ce.short_block_dispensed&&(A[V]=1),R.short_blocks==Ce.short_block_forced&&(A[V]=0)}function Ci(R,A,F){for(var V=R.internal_flags,J=0;J<V.channels_out;J++){var N=T.NORM_TYPE;A[J]!=0?(Ee(V.blocktype_old[J]!=T.START_TYPE),V.blocktype_old[J]==T.SHORT_TYPE&&(N=T.STOP_TYPE)):(N=T.SHORT_TYPE,V.blocktype_old[J]==T.NORM_TYPE&&(V.blocktype_old[J]=T.START_TYPE),V.blocktype_old[J]==T.STOP_TYPE&&(V.blocktype_old[J]=T.SHORT_TYPE)),F[J]=V.blocktype_old[J],V.blocktype_old[J]=N}}function Sn(R,A,F,V,J,N,Y){for(var re=N*2,W=N>0?Math.pow(10,J):1,ve,ne,pe=0;pe<Y;++pe){var He=R[2][pe],rt=R[3][pe],Re=A[0][pe],Ze=A[1][pe],ue=A[2][pe],Xe=A[3][pe];if(Re<=1.58*Ze&&Ze<=1.58*Re){var vt=F[pe]*rt,Ae=F[pe]*He;ne=Math.max(ue,Math.min(Xe,vt)),ve=Math.max(Xe,Math.min(ue,Ae))}else ne=ue,ve=Xe;if(N>0){var We,Te,Je=V[pe]*W;if(We=Math.min(Math.max(Re,Je),Math.max(Ze,Je)),ue=Math.max(ne,Je),Xe=Math.max(ve,Je),Te=ue+Xe,Te>0&&We*re<Te){var Ft=We*re/Te;ue*=Ft,Xe*=Ft,Ee(Te>0)}ne=Math.min(ue,ne),ve=Math.min(Xe,ve)}ne>He&&(ne=He),ve>rt&&(ve=rt),A[2][pe]=ne,A[3][pe]=ve}}this.L3psycho_anal_vbr=function(R,A,F,V,J,N,Y,re,W,ve){var ne=R.internal_flags,pe,He,rt=Fe(T.HBLKSIZE),Re=ot([3,T.HBLKSIZE_s]),Ze=ot([2,T.BLKSIZE]),ue=ot([2,3,T.BLKSIZE_s]),Xe=ot([4,T.CBANDS]),vt=ot([4,T.CBANDS]),Ae=ot([4,3]),We=.6,Te=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],Je=mt(2),Ft=R.mode==nr.JOINT_STEREO?4:ne.channels_out;Kt(R,A,F,V,J,N,W,Ae,Te,Je),Ii(R,Je);{for(var qe=0;qe<Ft;qe++){var ct=qe&1;pe=Ze,Ot(R,A,F,qe,V,rt,pe,ct),Lt(R,V,qe,rt),Je[ct]!=0?_n(ne,rt,Xe[qe],vt[qe],qe):Ln(ne,qe)}Je[0]+Je[1]==2&&R.mode==nr.JOINT_STEREO&&Sn(Xe,vt,ne.mld_cb_l,ne.ATH.cb_l,R.ATHlower*ne.ATH.adjust,R.msfix,ne.npart_l);for(var qe=0;qe<Ft;qe++){var ct=qe&1;Je[ct]!=0&&S(ne,Xe[qe],vt[qe],qe)}}{for(var pt=0;pt<3;pt++){for(var qe=0;qe<Ft;++qe){var ct=qe&1;Je[ct]!=0?_r(ne,qe,pt):(He=ue,Rt(R,A,F,qe,pt,Re,He,ct),Fr(R,Re,Xe[qe],vt[qe],qe,pt))}Je[0]+Je[1]==0&&R.mode==nr.JOINT_STEREO&&Sn(Xe,vt,ne.mld_cb_s,ne.ATH.cb_s,R.ATHlower*ne.ATH.adjust,R.msfix,ne.npart_s);for(var qe=0;qe<Ft;++qe){var ct=qe&1;Je[ct]==0&&f(ne,Xe[qe],vt[qe],qe,pt)}}for(var qe=0;qe<Ft;qe++){var ct=qe&1;if(Je[ct]==0)for(var Vt=0;Vt<T.SBMAX_s;Vt++){for(var Xr=Fe(3),pt=0;pt<3;pt++){var Zt=ne.thm[qe].s[Vt][pt];if(Zt*=G,Te[qe][pt]>=2||Te[qe][pt+1]==1){var Ht=pt!=0?pt-1:2,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,de*We);Zt=Math.min(Zt,Ur)}else if(Te[qe][pt]==1){var Ht=pt!=0?pt-1:2,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,he*We);Zt=Math.min(Zt,Ur)}else if(pt!=0&&Te[qe][pt-1]==3||pt==0&&ne.nsPsy.lastAttacks[qe]==3){var Ht=pt!=2?pt+1:0,Ur=Oe(ne.thm[qe].s[Vt][Ht],Zt,he*We);Zt=Math.min(Zt,Ur)}Zt*=Ae[qe][pt],Xr[pt]=Zt}for(var pt=0;pt<3;pt++)ne.thm[qe].s[Vt][pt]=Xr[pt]}}}for(var qe=0;qe<Ft;qe++)ne.nsPsy.lastAttacks[qe]=Te[qe][2];Ci(R,Je,ve);for(var qe=0;qe<Ft;qe++){var Kr,Wr,gn,bn;qe>1?(Kr=re,Wr=-2,gn=T.NORM_TYPE,(ve[0]==T.SHORT_TYPE||ve[1]==T.SHORT_TYPE)&&(gn=T.SHORT_TYPE),bn=N[V][qe-2]):(Kr=Y,Wr=0,gn=ve[qe],bn=J[V][qe]),gn==T.SHORT_TYPE?Kr[Wr+qe]=je(bn,ne.masking_lower):Kr[Wr+qe]=nt(bn,ne.masking_lower),R.analysis&&(ne.pinfo.pe[V][qe]=Kr[Wr+qe])}return 0};function Cr(R,A){var F=R,V;return F>=0?V=-F*27:V=F*A,V<=-72?0:Math.exp(V*H)}function ii(R){var A=0,F=0;{var V=0,J,N;for(V=0;Cr(V,R)>1e-20;V-=1);for(J=V,N=0;Math.abs(N-J)>1e-12;)V=(N+J)/2,Cr(V,R)>0?N=V:J=V;A=J}{var V=0,J,N;for(V=0;Cr(V,R)>1e-20;V+=1);for(J=0,N=V;Math.abs(N-J)>1e-12;)V=(N+J)/2,Cr(V,R)>0?J=V:N=V;F=N}{var Y=0,re=1e3,W;for(W=0;W<=re;++W){var V=A+W*(F-A)/re,ve=Cr(V,R);Y+=ve}{var ne=(re+1)/(Y*(F-A));return ne}}}function Ka(R){var A,F,V,J;return A=R,A>=0?A*=3:A*=1.5,A>=.5&&A<=2.5?(J=A-.5,F=8*(J*J-2*J)):F=0,A+=.474,V=15.811389+7.5*A-17.5*Math.sqrt(1+A*A),V<=-60?0:(A=Math.exp((F+V)*H),A/=.6609193,A)}function ai(R){return R<0&&(R=0),R=R*.001,13*Math.atan(.76*R)+3.5*Math.atan(R*R/(7.5*7.5))}function Fc(R,A,F,V,J,N,Y,re,W,ve,ne,pe){var He=Fe(T.CBANDS+1),rt=re/(pe>15?2*576:2*192),Re=mt(T.HBLKSIZE),Ze;re/=W;var ue=0,Xe=0;for(Ze=0;Ze<T.CBANDS;Ze++){var vt,Ae;for(vt=ai(re*ue),He[Ze]=re*ue,Ae=ue;ai(re*Ae)-vt<me&&Ae<=W/2;Ae++);for(R[Ze]=Ae-ue,Xe=Ze+1;ue<Ae;)Ee(ue<T.HBLKSIZE),Re[ue++]=Ze;if(ue>W/2){ue=W/2,++Ze;break}}Ee(Ze<T.CBANDS),He[Ze]=re*ue;for(var We=0;We<pe;We++){var Te,Je,Ft,qe,ct;Ft=ve[We],qe=ve[We+1],Te=0|Math.floor(.5+ne*(Ft-.5)),Te<0&&(Te=0),Je=0|Math.floor(.5+ne*(qe-.5)),Je>W/2&&(Je=W/2),F[We]=(Re[Te]+Re[Je])/2,A[We]=Re[Je];var pt=rt*qe;Y[We]=(pt-He[A[We]])/(He[A[We]+1]-He[A[We]]),Y[We]<0?Y[We]=0:Y[We]>1&&(Y[We]=1),ct=ai(re*ve[We]*ne),ct=Math.min(ct,15.5)/15.5,N[We]=Math.pow(10,1.25*(1-Math.cos(Math.PI*ct))-2.5)}ue=0;for(var Vt=0;Vt<Xe;Vt++){var Xr=R[Vt],vt,Zt;vt=ai(re*ue),Zt=ai(re*(ue+Xr-1)),V[Vt]=.5*(vt+Zt),vt=ai(re*(ue-.5)),Zt=ai(re*(ue+Xr-.5)),J[Vt]=Zt-vt,ue+=Xr}return Xe}function Uc(R,A,F,V,J,N){var Y=ot([T.CBANDS,T.CBANDS]),re,W=0;if(N)for(var ve=0;ve<A;ve++)for(re=0;re<A;re++){var ne=Ka(F[ve]-F[re])*V[re];Y[ve][re]=ne*J[ve]}else for(re=0;re<A;re++)for(var pe=15+Math.min(21/F[re],12),He=ii(pe),ve=0;ve<A;ve++){var ne=He*Cr(F[ve]-F[re],pe)*V[re];Y[ve][re]=ne*J[ve]}for(var ve=0;ve<A;ve++){for(re=0;re<A&&!(Y[ve][re]>0);re++);for(R[ve][0]=re,re=A-1;re>0&&!(Y[ve][re]>0);re--);R[ve][1]=re,W+=R[ve][1]-R[ve][0]+1}for(var rt=Fe(W),Re=0,ve=0;ve<A;ve++)for(re=R[ve][0];re<=R[ve][1];re++)rt[Re++]=Y[ve][re];return rt}function Hc(R){var A=ai(R);return A=Math.min(A,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*A))-2.5)}this.psymodel_init=function(R){var A=R.internal_flags,F,V=!0,J=13,N=24,Y=0,re=0,W=-8.25,ve=-4.5,ne=Fe(T.CBANDS),pe=Fe(T.CBANDS),He=Fe(T.CBANDS),rt=R.out_samplerate;switch(R.experimentalZ){default:case 0:V=!0;break;case 1:V=!(R.VBR==be.vbr_mtrh||R.VBR==be.vbr_mt);break;case 2:V=!1;break;case 3:J=8,Y=-1.75,re=-.0125,W=-8.25,ve=-2.25;break}for(A.ms_ener_ratio_old=.25,A.blocktype_old[0]=A.blocktype_old[1]=T.NORM_TYPE,F=0;F<4;++F){for(var ue=0;ue<T.CBANDS;++ue)A.nb_1[F][ue]=1e20,A.nb_2[F][ue]=1e20,A.nb_s1[F][ue]=A.nb_s2[F][ue]=1;for(var Re=0;Re<T.SBMAX_l;Re++)A.en[F].l[Re]=1e20,A.thm[F].l[Re]=1e20;for(var ue=0;ue<3;++ue){for(var Re=0;Re<T.SBMAX_s;Re++)A.en[F].s[Re][ue]=1e20,A.thm[F].s[Re][ue]=1e20;A.nsPsy.lastAttacks[F]=0}for(var ue=0;ue<9;ue++)A.nsPsy.last_en_subshort[F][ue]=10}for(A.loudness_sq_save[0]=A.loudness_sq_save[1]=0,A.npart_l=Fc(A.numlines_l,A.bo_l,A.bm_l,ne,pe,A.mld_l,A.PSY.bo_l_weight,rt,T.BLKSIZE,A.scalefac_band.l,T.BLKSIZE/(2*576),T.SBMAX_l),Ee(A.npart_l<T.CBANDS),F=0;F<A.npart_l;F++){var Ze=Y;ne[F]>=J&&(Ze=re*(ne[F]-J)/(N-J)+Y*(N-ne[F])/(N-J)),He[F]=Math.pow(10,Ze/10),A.numlines_l[F]>0?A.rnumlines_l[F]=1/A.numlines_l[F]:A.rnumlines_l[F]=0}A.s3_ll=Uc(A.s3ind,A.npart_l,ne,pe,He,V);var ue=0;for(F=0;F<A.npart_l;F++){var Xe;Xe=Ie.MAX_VALUE;for(var vt=0;vt<A.numlines_l[F];vt++,ue++){var Ae=rt*ue/(1e3*T.BLKSIZE),We;We=this.ATHformula(Ae*1e3,R)-20,We=Math.pow(10,.1*We),We*=A.numlines_l[F],Xe>We&&(Xe=We)}A.ATH.cb_l[F]=Xe,Xe=-20+ne[F]*20/10,Xe>6&&(Xe=100),Xe<-15&&(Xe=-15),Xe-=8,A.minval_l[F]=Math.pow(10,Xe/10)*A.numlines_l[F]}for(A.npart_s=Fc(A.numlines_s,A.bo_s,A.bm_s,ne,pe,A.mld_s,A.PSY.bo_s_weight,rt,T.BLKSIZE_s,A.scalefac_band.s,T.BLKSIZE_s/(2*192),T.SBMAX_s),Ee(A.npart_s<T.CBANDS),ue=0,F=0;F<A.npart_s;F++){var Xe,Ze=W;ne[F]>=J&&(Ze=ve*(ne[F]-J)/(N-J)+W*(N-ne[F])/(N-J)),He[F]=Math.pow(10,Ze/10),Xe=Ie.MAX_VALUE;for(var vt=0;vt<A.numlines_s[F];vt++,ue++){var Ae=rt*ue/(1e3*T.BLKSIZE_s),We;We=this.ATHformula(Ae*1e3,R)-20,We=Math.pow(10,.1*We),We*=A.numlines_s[F],Xe>We&&(Xe=We)}A.ATH.cb_s[F]=Xe,Xe=-7+ne[F]*7/12,ne[F]>12&&(Xe*=1+Math.log(1+Xe)*3.1),ne[F]<12&&(Xe*=1+Math.log(1-Xe)*2.3),Xe<-15&&(Xe=-15),Xe-=8,A.minval_s[F]=Math.pow(10,Xe/10)*A.numlines_s[F]}A.s3_ss=Uc(A.s3ind_s,A.npart_s,ne,pe,He,V),m(),C.init_fft(A),A.decay=Math.exp(-1*$/(De*rt/192));{var Te;Te=M,(R.exp_nspsytune&2)!=0&&(Te=1),Math.abs(R.msfix)>0&&(Te=R.msfix),R.msfix=Te;for(var Je=0;Je<A.npart_l;Je++)A.s3ind[Je][1]>A.npart_l-1&&(A.s3ind[Je][1]=A.npart_l-1)}var Ft=576*A.mode_gr/rt;if(A.ATH.decay=Math.pow(10,-12/10*Ft),A.ATH.adjust=.01,A.ATH.adjustLimit=1,Ee(A.bo_l[T.SBMAX_l-1]<=A.npart_l),Ee(A.bo_s[T.SBMAX_s-1]<=A.npart_s),R.ATHtype!=-1){var Ae,qe=R.out_samplerate/T.BLKSIZE,ct=0;for(Ae=0,F=0;F<T.BLKSIZE/2;++F)Ae+=qe,A.ATH.eql_w[F]=1/Math.pow(10,this.ATHformula(Ae,R)/10),ct+=A.ATH.eql_w[F];for(ct=1/ct,F=T.BLKSIZE/2;--F>=0;)A.ATH.eql_w[F]*=ct}{for(var Je=ue=0;Je<A.npart_s;++Je)for(F=0;F<A.numlines_s[Je];++F)++ue;Ee(ue==129);for(var Je=ue=0;Je<A.npart_l;++Je)for(F=0;F<A.numlines_l[Je];++F)++ue;Ee(ue==513)}for(ue=0,F=0;F<A.npart_l;F++){var Ae=rt*(ue+A.numlines_l[F]/2)/(1*T.BLKSIZE);A.mld_cb_l[F]=Hc(Ae),ue+=A.numlines_l[F]}for(;F<T.CBANDS;++F)A.mld_cb_l[F]=1;for(ue=0,F=0;F<A.npart_s;F++){var Ae=rt*(ue+A.numlines_s[F]/2)/(1*T.BLKSIZE_s);A.mld_cb_s[F]=Hc(Ae),ue+=A.numlines_s[F]}for(;F<T.CBANDS;++F)A.mld_cb_s[F]=1;return 0};function na(R,A){R<-.3&&(R=3410),R/=1e3,R=Math.max(.1,R);var F=3.64*Math.pow(R,-.8)-6.8*Math.exp(-.6*Math.pow(R-3.4,2))+6*Math.exp(-.15*Math.pow(R-8.7,2))+(.6+.04*A)*.001*Math.pow(R,4);return F}this.ATHformula=function(R,A){var F;switch(A.ATHtype){case 0:F=na(R,9);break;case 1:F=na(R,-1);break;case 2:F=na(R,0);break;case 3:F=na(R,1)+6;break;case 4:F=na(R,A.ATHcurve);break;default:F=na(R,0);break}return F}}var Ar=br;function yr(C){var $=C;this.ordinal=function(){return $}}yr.STEREO=new yr(0),yr.JOINT_STEREO=new yr(1),yr.DUAL_CHANNEL=new yr(2),yr.MONO=new yr(3),yr.NOT_SET=new yr(4);var ea=yr;function pn(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=ea.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}var a0=pn,Ec={};Ec.SFBMAX=T.SBMAX_s*3;var xi=Ec,Lf=P.new_float,yi=P.new_int;function Ff(){this.xr=Lf(576),this.l3_enc=yi(576),this.scalefac=yi(xi.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=yi(3),this.subblock_gain=yi(3+1),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=yi(xi.SFBMAX),this.window=yi(xi.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=yi(4),this.max_nonzero_coeff=0;var C=this;function $(Z){return new Int32Array(Z)}function ie(Z){return new Float32Array(Z)}this.assign=function(Z){C.xr=ie(Z.xr),C.l3_enc=$(Z.l3_enc),C.scalefac=$(Z.scalefac),C.xrpow_max=Z.xrpow_max,C.part2_3_length=Z.part2_3_length,C.big_values=Z.big_values,C.count1=Z.count1,C.global_gain=Z.global_gain,C.scalefac_compress=Z.scalefac_compress,C.block_type=Z.block_type,C.mixed_block_flag=Z.mixed_block_flag,C.table_select=$(Z.table_select),C.subblock_gain=$(Z.subblock_gain),C.region0_count=Z.region0_count,C.region1_count=Z.region1_count,C.preflag=Z.preflag,C.scalefac_scale=Z.scalefac_scale,C.count1table_select=Z.count1table_select,C.part2_length=Z.part2_length,C.sfb_lmax=Z.sfb_lmax,C.sfb_smin=Z.sfb_smin,C.psy_lmax=Z.psy_lmax,C.sfbmax=Z.sfbmax,C.psymax=Z.psymax,C.sfbdivide=Z.sfbdivide,C.width=$(Z.width),C.window=$(Z.window),C.count1bits=Z.count1bits,C.sfb_partition_table=Z.sfb_partition_table.slice(0),C.slen=$(Z.slen),C.max_nonzero_coeff=Z.max_nonzero_coeff}}var Oo=Ff,wc=P.new_int;function Uf(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[wc(4),wc(4)];for(var C=0;C<2;C++)for(var $=0;$<2;$++)this.tt[C][$]=new Oo}var Hf=Uf,Lo=P.System,Fo=P.new_int;function Vf(C,$,ie,Z){this.l=Fo(1+T.SBMAX_l),this.s=Fo(1+T.SBMAX_s),this.psfb21=Fo(1+T.PSFB21),this.psfb12=Fo(1+T.PSFB12);var ye=this.l,Q=this.s;arguments.length==4&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],Lo.arraycopy(this.arrL,0,ye,0,Math.min(this.arrL.length,this.l.length)),Lo.arraycopy(this.arrS,0,Q,0,Math.min(this.arrS.length,this.s.length)),Lo.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),Lo.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}var Nn=Vf,o0=P.new_float,qf=P.new_float_n,zf=P.new_int;function jf(){this.last_en_subshort=qf([4,9]),this.lastAttacks=zf(4),this.pefirbuf=o0(19),this.longfact=o0(T.SBMAX_l),this.shortfact=o0(T.SBMAX_s),this.attackthre=0,this.attackthre_s=0}var Gf=jf;function Xf(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0}var Kf=Xf,Wf=P.new_byte,Yf=P.new_double,on=P.new_float,Ei=P.new_float_n,hn=P.new_int,Uo=P.new_int_n;jn.MFSIZE=3*1152+T.ENCDELAY-T.MDCTDELAY,jn.MAX_HEADER_BUF=256,jn.MAX_BITS_PER_CHANNEL=4095,jn.MAX_BITS_PER_GRANULE=7680,jn.BPC=320;function jn(){var C=40;this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=Ei([2,jn.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new Hf,this.ms_ratio=on(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=hn(2),this.CurrentStep=hn(2),this.masking_lower=0,this.bv_scf=hn(576),this.pseudohalf=hn(xi.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*jn.BPC+1),this.itime=Yf(2),this.sideinfo_len=0,this.sb_sample=Ei([2,2,18,T.SBLIMIT]),this.amp_filter=on(32);function $(){this.write_timing=0,this.ptr=0,this.buf=Wf(C)}this.header=new Array(jn.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new Nn,this.minval_l=on(T.CBANDS),this.minval_s=on(T.CBANDS),this.nb_1=Ei([4,T.CBANDS]),this.nb_2=Ei([4,T.CBANDS]),this.nb_s1=Ei([4,T.CBANDS]),this.nb_s2=Ei([4,T.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=on(4),this.loudness_sq=Ei([2,2]),this.loudness_sq_save=on(2),this.mld_l=on(T.SBMAX_l),this.mld_s=on(T.SBMAX_s),this.bm_l=hn(T.SBMAX_l),this.bo_l=hn(T.SBMAX_l),this.bm_s=hn(T.SBMAX_s),this.bo_s=hn(T.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=Uo([T.CBANDS,2]),this.s3ind_s=Uo([T.CBANDS,2]),this.numlines_s=hn(T.CBANDS),this.numlines_l=hn(T.CBANDS),this.rnumlines_l=on(T.CBANDS),this.mld_cb_l=on(T.CBANDS),this.mld_cb_s=on(T.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=on(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=hn(2),this.nsPsy=new Gf,this.VBR_seek_table=new Kf,this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=Uo([16,4+1]),this.bitrate_blockType_Hist=Uo([16,4+1+1]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var ie=0;ie<this.en.length;ie++)this.en[ie]=new sr;for(var ie=0;ie<this.thm.length;ie++)this.thm[ie]=new sr;for(var ie=0;ie<this.header.length;ie++)this.header[ie]=new $}var Bt=jn,wi=P.new_float;function $f(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=wi(T.SBMAX_l),this.s=wi(T.SBMAX_s),this.psfb21=wi(T.PSFB21),this.psfb12=wi(T.PSFB12),this.cb_l=wi(T.CBANDS),this.cb_s=wi(T.CBANDS),this.eql_w=wi(T.BLKSIZE/2)}var Zf=$f,Or=P.System,Rc=P.Arrays;Ut.STEPS_per_dB=100,Ut.MAX_dB=120,Ut.GAIN_NOT_ENOUGH_SAMPLES=-24601,Ut.GAIN_ANALYSIS_ERROR=0,Ut.GAIN_ANALYSIS_OK=1,Ut.INIT_GAIN_ANALYSIS_ERROR=0,Ut.INIT_GAIN_ANALYSIS_OK=1,Ut.YULE_ORDER=10,Ut.MAX_ORDER=Ut.YULE_ORDER,Ut.MAX_SAMP_FREQ=48e3,Ut.RMS_WINDOW_TIME_NUMERATOR=1,Ut.RMS_WINDOW_TIME_DENOMINATOR=20,Ut.MAX_SAMPLES_PER_WINDOW=Ut.MAX_SAMP_FREQ*Ut.RMS_WINDOW_TIME_NUMERATOR/Ut.RMS_WINDOW_TIME_DENOMINATOR+1;function Ut(){var C=64.82,$=Ut.YULE_ORDER,ie=.95,Z=Ut.MAX_SAMP_FREQ,ye=Ut.RMS_WINDOW_TIME_NUMERATOR,Q=Ut.RMS_WINDOW_TIME_DENOMINATOR,me=Ut.MAX_SAMPLES_PER_WINDOW,Ne=[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.26408300200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]],De=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function G(o,I,H,O,g,_){for(;g--!=0;)H[O]=1e-10+o[I+0]*_[0]-H[O-1]*_[1]+o[I-1]*_[2]-H[O-2]*_[3]+o[I-2]*_[4]-H[O-3]*_[5]+o[I-3]*_[6]-H[O-4]*_[7]+o[I-4]*_[8]-H[O-5]*_[9]+o[I-5]*_[10]-H[O-6]*_[11]+o[I-6]*_[12]-H[O-7]*_[13]+o[I-7]*_[14]-H[O-8]*_[15]+o[I-8]*_[16]-H[O-9]*_[17]+o[I-9]*_[18]-H[O-10]*_[19]+o[I-10]*_[20],++O,++I}function de(o,I,H,O,g,_){for(;g--!=0;)H[O]=o[I+0]*_[0]-H[O-1]*_[1]+o[I-1]*_[2]-H[O-2]*_[3]+o[I-2]*_[4],++O,++I}function he(o,I){for(var H=0;H<MAX_ORDER;H++)o.linprebuf[H]=o.lstepbuf[H]=o.loutbuf[H]=o.rinprebuf[H]=o.rstepbuf[H]=o.routbuf[H]=0;switch(0|I){case 48e3:o.reqindex=0;break;case 44100:o.reqindex=1;break;case 32e3:o.reqindex=2;break;case 24e3:o.reqindex=3;break;case 22050:o.reqindex=4;break;case 16e3:o.reqindex=5;break;case 12e3:o.reqindex=6;break;case 11025:o.reqindex=7;break;case 8e3:o.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return o.sampleWindow=0|(I*ye+Q-1)/Q,o.lsum=0,o.rsum=0,o.totsamp=0,Rc.ill(o.A,0),INIT_GAIN_ANALYSIS_OK}this.InitGainAnalysis=function(o,I){return he(o,I)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(o.linpre=MAX_ORDER,o.rinpre=MAX_ORDER,o.lstep=MAX_ORDER,o.rstep=MAX_ORDER,o.lout=MAX_ORDER,o.rout=MAX_ORDER,Rc.fill(o.B,0),INIT_GAIN_ANALYSIS_OK)};function M(o){return o*o}this.AnalyzeSamples=function(o,I,H,O,g,_,D){var q,w,c,L,y,u,m;if(_==0)return GAIN_ANALYSIS_OK;switch(m=0,y=_,D){case 1:O=I,g=H;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(_<MAX_ORDER?(Or.arraycopy(I,H,o.linprebuf,MAX_ORDER,_),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER,_)):(Or.arraycopy(I,H,o.linprebuf,MAX_ORDER,MAX_ORDER),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER,MAX_ORDER));y>0;){u=y>o.sampleWindow-o.totsamp?o.sampleWindow-o.totsamp:y,m<MAX_ORDER?(q=o.linpre+m,w=o.linprebuf,c=o.rinpre+m,L=o.rinprebuf,u>MAX_ORDER-m&&(u=MAX_ORDER-m)):(q=H+m,w=I,c=g+m,L=O),G(w,q,o.lstepbuf,o.lstep+o.totsamp,u,Ne[o.reqindex]),G(L,c,o.rstepbuf,o.rstep+o.totsamp,u,Ne[o.reqindex]),de(o.lstepbuf,o.lstep+o.totsamp,o.loutbuf,o.lout+o.totsamp,u,De[o.reqindex]),de(o.rstepbuf,o.rstep+o.totsamp,o.routbuf,o.rout+o.totsamp,u,De[o.reqindex]),q=o.lout+o.totsamp,w=o.loutbuf,c=o.rout+o.totsamp,L=o.routbuf;for(var b=u%8;b--!=0;)o.lsum+=M(w[q++]),o.rsum+=M(L[c++]);for(b=u/8;b--!=0;)o.lsum+=M(w[q+0])+M(w[q+1])+M(w[q+2])+M(w[q+3])+M(w[q+4])+M(w[q+5])+M(w[q+6])+M(w[q+7]),q+=8,o.rsum+=M(L[c+0])+M(L[c+1])+M(L[c+2])+M(L[c+3])+M(L[c+4])+M(L[c+5])+M(L[c+6])+M(L[c+7]),c+=8;if(y-=u,m+=u,o.totsamp+=u,o.totsamp==o.sampleWindow){var l=Ut.STEPS_per_dB*10*Math.log10((o.lsum+o.rsum)/o.totsamp*.5+1e-37),h=l<=0?0:0|l;h>=o.A.length&&(h=o.A.length-1),o.A[h]++,o.lsum=o.rsum=0,Or.arraycopy(o.loutbuf,o.totsamp,o.loutbuf,0,MAX_ORDER),Or.arraycopy(o.routbuf,o.totsamp,o.routbuf,0,MAX_ORDER),Or.arraycopy(o.lstepbuf,o.totsamp,o.lstepbuf,0,MAX_ORDER),Or.arraycopy(o.rstepbuf,o.totsamp,o.rstepbuf,0,MAX_ORDER),o.totsamp=0}if(o.totsamp>o.sampleWindow)return GAIN_ANALYSIS_ERROR}return _<MAX_ORDER?(Or.arraycopy(o.linprebuf,_,o.linprebuf,0,MAX_ORDER-_),Or.arraycopy(o.rinprebuf,_,o.rinprebuf,0,MAX_ORDER-_),Or.arraycopy(I,H,o.linprebuf,MAX_ORDER-_,_),Or.arraycopy(O,g,o.rinprebuf,MAX_ORDER-_,_)):(Or.arraycopy(I,H+_-MAX_ORDER,o.linprebuf,0,MAX_ORDER),Or.arraycopy(O,g+_-MAX_ORDER,o.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK};function K(o,I){var H,O=0;for(H=0;H<I;H++)O+=o[H];if(O==0)return GAIN_NOT_ENOUGH_SAMPLES;var g=0|Math.ceil(O*(1-ie));for(H=I;H-- >0&&!((g-=o[H])<=0););return C-H/Ut.STEPS_per_dB}this.GetTitleGain=function(o){for(var I=K(o.A,o.A.length),H=0;H<o.A.length;H++)o.B[H]+=o.A[H],o.A[H]=0;for(var H=0;H<MAX_ORDER;H++)o.linprebuf[H]=o.lstepbuf[H]=o.loutbuf[H]=o.rinprebuf[H]=o.rstepbuf[H]=o.routbuf[H]=0;return o.totsamp=0,o.lsum=o.rsum=0,I}}var Ir=Ut,ta=P.new_float,Tc=P.new_int;function Qf(){this.linprebuf=ta(Ir.MAX_ORDER*2),this.linpre=0,this.lstepbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.lstep=0,this.loutbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.lout=0,this.rinprebuf=ta(Ir.MAX_ORDER*2),this.rinpre=0,this.rstepbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.rstep=0,this.routbuf=ta(Ir.MAX_SAMPLES_PER_WINDOW+Ir.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=Tc(0|Ir.STEPS_per_dB*Ir.MAX_dB),this.B=Tc(0|Ir.STEPS_per_dB*Ir.MAX_dB)}var Jf=Qf;function ed(C){this.bits=C}var Ac=ed,Ic=P.new_float,td=P.new_int,Cc=P.assert;function rd(C){var $=C;this.quantize=$,this.iteration_loop=function(ie,Z,ye,Q){var me=ie.internal_flags,Ne=Ic(xi.SFBMAX),De=Ic(576),G=td(2),de=0,he,M=me.l3_side,K=new Ac(de);this.quantize.rv.ResvFrameBegin(ie,K),de=K.bits;for(var o=0;o<me.mode_gr;o++){he=this.quantize.qupvt.on_pe(ie,Z,G,de,o,o),me.mode_ext==T.MPG_MD_MS_LR&&(this.quantize.ms_convert(me.l3_side,o),this.quantize.qupvt.reduce_side(G,ye[o],de,he));for(var I=0;I<me.channels_out;I++){var H,O,g=M.tt[o][I];g.block_type!=T.SHORT_TYPE?(H=0,O=me.PSY.mask_adjust-H):(H=0,O=me.PSY.mask_adjust_short-H),me.masking_lower=Math.pow(10,O*.1),this.quantize.init_outer_loop(me,g),this.quantize.init_xrpow(me,g,De)&&(this.quantize.qupvt.calc_xmin(ie,Q[o][I],g,Ne),this.quantize.outer_loop(ie,g,Ne,De,I,G[I])),this.quantize.iteration_finish_one(me,o,I),Cc(g.part2_3_length<=Bt.MAX_BITS_PER_CHANNEL),Cc(g.part2_3_length<=G[I])}}this.quantize.rv.ResvFrameEnd(me,de)}}var nd=rd;function Et(C,$,ie,Z){this.xlen=C,this.linmax=$,this.table=ie,this.hlen=Z}var Me={};Me.t1HB=[1,1,1,0],Me.t2HB=[1,2,1,3,1,1,3,2,0],Me.t3HB=[3,2,1,1,1,1,3,2,0],Me.t5HB=[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],Me.t6HB=[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],Me.t7HB=[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],Me.t8HB=[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],Me.t9HB=[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],Me.t10HB=[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],Me.t11HB=[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],Me.t12HB=[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],Me.t13HB=[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],Me.t15HB=[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],Me.t16HB=[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,865,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],Me.t24HB=[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],Me.t32HB=[1<<0,5<<1,4<<1,5<<2,6<<1,5<<2,4<<2,4<<3,7<<1,3<<2,6<<2,0<<3,7<<2,2<<3,3<<3,1<<4],Me.t33HB=[15<<0,14<<1,13<<1,12<<2,11<<1,10<<2,9<<2,8<<3,7<<1,6<<2,5<<2,4<<3,3<<2,2<<3,1<<3,0<<4],Me.t1l=[1,4,3,5],Me.t2l=[1,4,7,4,5,7,6,7,8],Me.t3l=[2,3,7,4,4,7,6,7,8],Me.t5l=[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],Me.t6l=[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],Me.t7l=[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],Me.t8l=[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],Me.t9l=[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],Me.t10l=[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],Me.t11l=[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],Me.t12l=[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],Me.t13l=[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],Me.t15l=[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],Me.t16_5l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],Me.t16l=[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],Me.t24l=[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],Me.t32l=[1+0,4+1,4+1,5+2,4+1,6+2,5+2,6+3,4+1,5+2,5+2,6+3,5+2,6+3,6+3,6+4],Me.t33l=[4+0,4+1,4+1,4+2,4+1,4+2,4+2,4+3,4+1,4+2,4+2,4+3,4+2,4+3,4+3,4+4],Me.ht=[new Et(0,0,null,null),new Et(2,0,Me.t1HB,Me.t1l),new Et(3,0,Me.t2HB,Me.t2l),new Et(3,0,Me.t3HB,Me.t3l),new Et(0,0,null,null),new Et(4,0,Me.t5HB,Me.t5l),new Et(4,0,Me.t6HB,Me.t6l),new Et(6,0,Me.t7HB,Me.t7l),new Et(6,0,Me.t8HB,Me.t8l),new Et(6,0,Me.t9HB,Me.t9l),new Et(8,0,Me.t10HB,Me.t10l),new Et(8,0,Me.t11HB,Me.t11l),new Et(8,0,Me.t12HB,Me.t12l),new Et(16,0,Me.t13HB,Me.t13l),new Et(0,0,null,Me.t16_5l),new Et(16,0,Me.t15HB,Me.t15l),new Et(1,1,Me.t16HB,Me.t16l),new Et(2,3,Me.t16HB,Me.t16l),new Et(3,7,Me.t16HB,Me.t16l),new Et(4,15,Me.t16HB,Me.t16l),new Et(6,63,Me.t16HB,Me.t16l),new Et(8,255,Me.t16HB,Me.t16l),new Et(10,1023,Me.t16HB,Me.t16l),new Et(13,8191,Me.t16HB,Me.t16l),new Et(4,15,Me.t24HB,Me.t24l),new Et(5,31,Me.t24HB,Me.t24l),new Et(6,63,Me.t24HB,Me.t24l),new Et(7,127,Me.t24HB,Me.t24l),new Et(8,255,Me.t24HB,Me.t24l),new Et(9,511,Me.t24HB,Me.t24l),new Et(11,2047,Me.t24HB,Me.t24l),new Et(13,8191,Me.t24HB,Me.t24l),new Et(0,0,Me.t32HB,Me.t32l),new Et(0,0,Me.t33HB,Me.t33l)],Me.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],Me.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],Me.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],Me.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],Me.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],Me.scfsi_band=[0,6,11,16,21];var bt=Me,Ri=P.VbrMode,Ho=P.Float,s0=P.Util,Ti=P.new_float,id=P.new_int,Gn=P.assert;jr.Q_MAX=256+1,jr.Q_MAX2=116,jr.LARGE_BITS=1e5,jr.IXMAX_VAL=8206;function jr(){var C=null,$=null,ie=null;this.setModules=function(_,D,q){C=_,$=D,ie=q};function Z(_){return Gn(0<=_+jr.Q_MAX2&&_<jr.Q_MAX),M[_+jr.Q_MAX2]}this.IPOW20=function(_){return Gn(0<=_&&_<jr.Q_MAX),K[_]};var ye=2220446049250313e-31,Q=jr.IXMAX_VAL,me=Q+2,Ne=jr.Q_MAX,De=jr.Q_MAX2,G=jr.LARGE_BITS,de=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var he=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=he,this.sfBandIndex=[new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0/3,12/3,24/3,36/3,54/3,78/3,108/3,144/3,186/3,240/3,312/3,402/3,522/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new Nn([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0/3,24/3,48/3,72/3,108/3,156/3,216/3,288/3,372/3,480/3,486/3,492/3,498/3,576/3],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var M=Ti(Ne+De+1),K=Ti(Ne),o=Ti(me),I=Ti(me);this.adj43=I;function H(_,D){var q=ie.ATHformula(D,_);return q-=de,q=Math.pow(10,q/10+_.ATHlower),q}function O(_){for(var D=_.internal_flags.ATH.l,q=_.internal_flags.ATH.psfb21,w=_.internal_flags.ATH.s,c=_.internal_flags.ATH.psfb12,L=_.internal_flags,y=_.out_samplerate,u=0;u<T.SBMAX_l;u++){var m=L.scalefac_band.l[u],b=L.scalefac_band.l[u+1];D[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/1152,x=H(_,h);D[u]=Math.min(D[u],x)}}for(var u=0;u<T.PSFB21;u++){var m=L.scalefac_band.psfb21[u],b=L.scalefac_band.psfb21[u+1];q[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/1152,x=H(_,h);q[u]=Math.min(q[u],x)}}for(var u=0;u<T.SBMAX_s;u++){var m=L.scalefac_band.s[u],b=L.scalefac_band.s[u+1];w[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/384,x=H(_,h);w[u]=Math.min(w[u],x)}w[u]*=L.scalefac_band.s[u+1]-L.scalefac_band.s[u]}for(var u=0;u<T.PSFB12;u++){var m=L.scalefac_band.psfb12[u],b=L.scalefac_band.psfb12[u+1];c[u]=Ho.MAX_VALUE;for(var l=m;l<b;l++){var h=l*y/384,x=H(_,h);c[u]=Math.min(c[u],x)}c[u]*=L.scalefac_band.s[13]-L.scalefac_band.s[12]}if(_.noATH){for(var u=0;u<T.SBMAX_l;u++)D[u]=1e-20;for(var u=0;u<T.PSFB21;u++)q[u]=1e-20;for(var u=0;u<T.SBMAX_s;u++)w[u]=1e-20;for(var u=0;u<T.PSFB12;u++)c[u]=1e-20}L.ATH.floor=10*Math.log10(H(_,-1))}this.iteration_init=function(_){var D=_.internal_flags,q=D.l3_side,w;if(D.iteration_init_init==0){for(D.iteration_init_init=1,q.main_data_begin=0,O(_),o[0]=0,w=1;w<me;w++)o[w]=Math.pow(w,4/3);for(w=0;w<me-1;w++)I[w]=w+1-Math.pow(.5*(o[w]+o[w+1]),.75);for(I[w]=.5,w=0;w<Ne;w++)K[w]=Math.pow(2,(w-210)*-.1875);for(w=0;w<=Ne+De;w++)M[w]=Math.pow(2,(w-210-De)*.25);C.huffman_init(D);{var c,L,y,u;for(w=_.exp_nspsytune>>2&63,w>=32&&(w-=64),c=Math.pow(10,w/4/10),w=_.exp_nspsytune>>8&63,w>=32&&(w-=64),L=Math.pow(10,w/4/10),w=_.exp_nspsytune>>14&63,w>=32&&(w-=64),y=Math.pow(10,w/4/10),w=_.exp_nspsytune>>20&63,w>=32&&(w-=64),u=y*Math.pow(10,w/4/10),w=0;w<T.SBMAX_l;w++){var m;w<=6?m=c:w<=13?m=L:w<=20?m=y:m=u,D.nsPsy.longfact[w]=m}for(w=0;w<T.SBMAX_s;w++){var m;w<=5?m=c:w<=10?m=L:w<=11?m=y:m=u,D.nsPsy.shortfact[w]=m}}}},this.on_pe=function(_,D,q,w,c,L){var y=_.internal_flags,u=0,m,b=id(2),l,h=new Ac(u),x=$.ResvMaxBits(_,w,h,L);u=h.bits;var E=u+x;for(E>Bt.MAX_BITS_PER_GRANULE&&(E=Bt.MAX_BITS_PER_GRANULE),m=0,l=0;l<y.channels_out;++l)q[l]=Math.min(Bt.MAX_BITS_PER_CHANNEL,u/y.channels_out),b[l]=0|q[l]*D[c][l]/700-q[l],b[l]>w*3/4&&(b[l]=w*3/4),b[l]<0&&(b[l]=0),b[l]+q[l]>Bt.MAX_BITS_PER_CHANNEL&&(b[l]=Math.max(0,Bt.MAX_BITS_PER_CHANNEL-q[l])),m+=b[l];if(m>x)for(l=0;l<y.channels_out;++l)b[l]=x*b[l]/m;for(l=0;l<y.channels_out;++l)q[l]+=b[l],x-=b[l];for(m=0,l=0;l<y.channels_out;++l)m+=q[l];if(m>Bt.MAX_BITS_PER_GRANULE){var X=0;for(l=0;l<y.channels_out;++l)q[l]*=Bt.MAX_BITS_PER_GRANULE,q[l]/=m,X+=q[l];Gn(X<=Bt.MAX_BITS_PER_GRANULE)}return E},this.reduce_side=function(_,D,q,w){Gn(w<=Bt.MAX_BITS_PER_GRANULE),Gn(_[0]+_[1]<=Bt.MAX_BITS_PER_GRANULE);var c=.33*(.5-D)/.5;c<0&&(c=0),c>.5&&(c=.5);var L=0|c*.5*(_[0]+_[1]);L>Bt.MAX_BITS_PER_CHANNEL-_[0]&&(L=Bt.MAX_BITS_PER_CHANNEL-_[0]),L<0&&(L=0),_[1]>=125&&(_[1]-L>125?(_[0]<q&&(_[0]+=L),_[1]-=L):(_[0]+=_[1]-125,_[1]=125)),L=_[0]+_[1],L>w&&(_[0]=w*_[0]/L,_[1]=w*_[1]/L),Gn(_[0]<=Bt.MAX_BITS_PER_CHANNEL),Gn(_[1]<=Bt.MAX_BITS_PER_CHANNEL),Gn(_[0]+_[1]<=Bt.MAX_BITS_PER_GRANULE)},this.athAdjust=function(_,D,q){var w=90.30873362,c=94.82444863,L=s0.FAST_LOG10_X(D,10),y=_*_,u=0;return L-=q,y>1e-20&&(u=1+s0.FAST_LOG10_X(y,10/w)),u<0&&(u=0),L*=u,L+=q+w-c,Math.pow(10,.1*L)},this.calc_xmin=function(_,D,q,w){var c=0,L=_.internal_flags,y,u=0,m=0,b=L.ATH,l=q.xr,h=_.VBR==Ri.vbr_mtrh?1:0,x=L.masking_lower;for((_.VBR==Ri.vbr_mtrh||_.VBR==Ri.vbr_mt)&&(x=1),y=0;y<q.psy_lmax;y++){var E,X,U,j,Se,f;_.VBR==Ri.vbr_rh||_.VBR==Ri.vbr_mtrh?X=athAdjust(b.adjust,b.l[y],b.floor):X=b.adjust*b.l[y],Se=q.width[y],U=X/Se,j=ye,f=Se>>1,E=0;do{var S,fe;S=l[u]*l[u],E+=S,j+=S<U?S:U,u++,fe=l[u]*l[u],E+=fe,j+=fe<U?fe:U,u++}while(--f>0);if(E>X&&m++,y==T.SBPSY_l){var _e=X*L.nsPsy.longfact[y];j<_e&&(j=_e)}if(h!=0&&(X=j),!_.ATHonly){var Oe=D.en.l[y];if(Oe>0){var _e;_e=E*D.thm.l[y]*x/Oe,h!=0&&(_e*=L.nsPsy.longfact[y]),X<_e&&(X=_e)}}h!=0?w[c++]=X:w[c++]=X*L.nsPsy.longfact[y]}var Ue=575;if(q.block_type!=T.SHORT_TYPE)for(var je=576;je--!=0&&Xn.EQ(l[je],0);)Ue=je;q.max_nonzero_coeff=Ue;for(var ze=q.sfb_smin;y<q.psymax;ze++,y+=3){var Se,nt,Ke;for(_.VBR==Ri.vbr_rh||_.VBR==Ri.vbr_mtrh?Ke=athAdjust(b.adjust,b.s[ze],b.floor):Ke=b.adjust*b.s[ze],Se=q.width[y],nt=0;nt<3;nt++){var E=0,X,U,j,f=Se>>1;U=Ke/Se,j=ye;do{var S,fe;S=l[u]*l[u],E+=S,j+=S<U?S:U,u++,fe=l[u]*l[u],E+=fe,j+=fe<U?fe:U,u++}while(--f>0);if(E>Ke&&m++,ze==T.SBPSY_s){var _e=Ke*L.nsPsy.shortfact[ze];j<_e&&(j=_e)}if(h!=0?X=j:X=Ke,!_.ATHonly&&!_.ATHshort){var Oe=D.en.s[ze][nt];if(Oe>0){var _e;_e=E*D.thm.s[ze][nt]*x/Oe,h!=0&&(_e*=L.nsPsy.shortfact[ze]),X<_e&&(X=_e)}}h!=0?w[c++]=X:w[c++]=X*L.nsPsy.shortfact[ze]}_.useTemporal&&(w[c-3]>w[c-3+1]&&(w[c-3+1]+=(w[c-3]-w[c-3+1])*L.decay),w[c-3+1]>w[c-3+2]&&(w[c-3+2]+=(w[c-3+1]-w[c-3+2])*L.decay))}return m};function g(_){this.s=_}this.calc_noise_core=function(_,D,q,w){var c=0,L=D.s,y=_.l3_enc;if(L>_.count1)for(;q--!=0;){var u;u=_.xr[L],L++,c+=u*u,u=_.xr[L],L++,c+=u*u}else if(L>_.big_values){var m=Ti(2);for(m[0]=0,m[1]=w;q--!=0;){var u;u=Math.abs(_.xr[L])-m[y[L]],L++,c+=u*u,u=Math.abs(_.xr[L])-m[y[L]],L++,c+=u*u}}else for(;q--!=0;){var u;u=Math.abs(_.xr[L])-o[y[L]]*w,L++,c+=u*u,u=Math.abs(_.xr[L])-o[y[L]]*w,L++,c+=u*u}return D.s=L,c},this.calc_noise=function(_,D,q,w,c){var L=0,y=0,u,m,b=0,l=0,h=0,x=-20,E=0,X=_.scalefac,U=0;for(w.over_SSD=0,u=0;u<_.psymax;u++){var j=_.global_gain-(X[U++]+(_.preflag!=0?he[u]:0)<<_.scalefac_scale+1)-_.subblock_gain[_.window[u]]*8,Se=0;if(c!=null&&c.step[u]==j)Se=c.noise[u],E+=_.width[u],q[L++]=Se/D[y++],Se=c.noise_log[u];else{var f=Z(j);if(m=_.width[u]>>1,E+_.width[u]>_.max_nonzero_coeff){var S;S=_.max_nonzero_coeff-E+1,S>0?m=S>>1:m=0}var fe=new g(E);Se=this.calc_noise_core(_,fe,m,f),E=fe.s,c!=null&&(c.step[u]=j,c.noise[u]=Se),Se=q[L++]=Se/D[y++],Se=s0.FAST_LOG10(Math.max(Se,1e-20)),c!=null&&(c.noise_log[u]=Se)}if(c!=null&&(c.global_gain=_.global_gain),h+=Se,Se>0){var _e;_e=Math.max(0|Se*10+.5,1),w.over_SSD+=_e*_e,b++,l+=Se}x=Math.max(x,Se)}return w.over_count=b,w.tot_noise=h,w.over_noise=l,w.max_noise=x,b},this.set_pinfo=function(_,D,q,w,c){var L=_.internal_flags,y,u,m,b,l,h=D.scalefac_scale==0?.5:1,x=D.scalefac,E=Ti(L3Side.SFBMAX),X=Ti(L3Side.SFBMAX),U=new CalcNoiseResult;calc_xmin(_,q,D,E),calc_noise(D,E,X,U,null);var j=0;for(u=D.sfb_lmax,D.block_type!=T.SHORT_TYPE&&D.mixed_block_flag==0&&(u=22),y=0;y<u;y++){var Se=L.scalefac_band.l[y],f=L.scalefac_band.l[y+1],S=f-Se;for(b=0;j<f;j++)b+=D.xr[j]*D.xr[j];b/=S,l=1e15,L.pinfo.en[w][c][y]=l*b,L.pinfo.xfsf[w][c][y]=l*E[y]*X[y]/S,q.en.l[y]>0&&!_.ATHonly?b=b/q.en.l[y]:b=0,L.pinfo.thr[w][c][y]=l*Math.max(b*q.thm.l[y],L.ATH.l[y]),L.pinfo.LAMEsfb[w][c][y]=0,D.preflag!=0&&y>=11&&(L.pinfo.LAMEsfb[w][c][y]=-h*he[y]),y<T.SBPSY_l&&(Gn(x[y]>=0),L.pinfo.LAMEsfb[w][c][y]-=h*x[y])}if(D.block_type==T.SHORT_TYPE)for(u=y,y=D.sfb_smin;y<T.SBMAX_s;y++)for(var Se=L.scalefac_band.s[y],f=L.scalefac_band.s[y+1],S=f-Se,fe=0;fe<3;fe++){for(b=0,m=Se;m<f;m++)b+=D.xr[j]*D.xr[j],j++;b=Math.max(b/S,1e-20),l=1e15,L.pinfo.en_s[w][c][3*y+fe]=l*b,L.pinfo.xfsf_s[w][c][3*y+fe]=l*E[u]*X[u]/S,q.en.s[y][fe]>0?b=b/q.en.s[y][fe]:b=0,(_.ATHonly||_.ATHshort)&&(b=0),L.pinfo.thr_s[w][c][3*y+fe]=l*Math.max(b*q.thm.s[y][fe],L.ATH.s[y]),L.pinfo.LAMEsfb_s[w][c][3*y+fe]=-2*D.subblock_gain[fe],y<T.SBPSY_s&&(L.pinfo.LAMEsfb_s[w][c][3*y+fe]-=h*x[u]),u++}L.pinfo.LAMEqss[w][c]=D.global_gain,L.pinfo.LAMEmainbits[w][c]=D.part2_3_length+D.part2_length,L.pinfo.LAMEsfbits[w][c]=D.part2_length,L.pinfo.over[w][c]=U.over_count,L.pinfo.max_noise[w][c]=U.max_noise*10,L.pinfo.over_noise[w][c]=U.over_noise*10,L.pinfo.tot_noise[w][c]=U.tot_noise*10,L.pinfo.over_SSD[w][c]=U.over_SSD}}var ti=jr,ad=P.System,od=P.Arrays,za=P.new_int,sn=P.assert;function l0(){var C=null;this.qupvt=null,this.setModules=function(u){this.qupvt=u,C=u};function $(u){this.bits=0|u}var ie=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function Z(u,m,b,l,h,x){var E=.5946/m;for(sn(u>0),u=u>>1;u--!=0;)h[x++]=E>b[l++]?0:1,h[x++]=E>b[l++]?0:1}function ye(u,m,b,l,h,x){sn(u>0),u=u>>1;var E=u%2;for(u=u>>1;u--!=0;){var X,U,j,Se,f,S,fe,_e;X=b[l++]*m,U=b[l++]*m,f=0|X,j=b[l++]*m,S=0|U,Se=b[l++]*m,fe=0|j,X+=C.adj43[f],_e=0|Se,U+=C.adj43[S],h[x++]=0|X,j+=C.adj43[fe],h[x++]=0|U,Se+=C.adj43[_e],h[x++]=0|j,h[x++]=0|Se}if(E!=0){var X,U,f,S;X=b[l++]*m,U=b[l++]*m,f=0|X,S=0|U,X+=C.adj43[f],U+=C.adj43[S],h[x++]=0|X,h[x++]=0|U}}function Q(u,m,b,l,h){var x,E,X=0,U,j=0,Se=0,f=0,S=m,fe=0,_e=S,Oe=0,Ue=u,je=0;for(U=h!=null&&l.global_gain==h.global_gain,l.block_type==T.SHORT_TYPE?E=38:E=21,x=0;x<=E;x++){var ze=-1;if((U||l.block_type==T.NORM_TYPE)&&(ze=l.global_gain-(l.scalefac[x]+(l.preflag!=0?C.pretab[x]:0)<<l.scalefac_scale+1)-l.subblock_gain[l.window[x]]*8),sn(l.width[x]>=0),U&&h.step[x]==ze)j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0),Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0);else{var nt=l.width[x];if(X+l.width[x]>l.max_nonzero_coeff){var Ke;Ke=l.max_nonzero_coeff-X+1,od.fill(m,l.max_nonzero_coeff,576,0),nt=Ke,nt<0&&(nt=0),x=E+1}if(j==0&&Se==0&&(_e=S,Oe=fe,Ue=u,je=f),h!=null&&h.sfb_count1>0&&x>=h.sfb_count1&&h.step[x]>0&&ze>=h.step[x]?(j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0,_e=S,Oe=fe,Ue=u,je=f),Se+=nt):(Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0,_e=S,Oe=fe,Ue=u,je=f),j+=nt),nt<=0){Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0),j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0);break}}x<=E&&(fe+=l.width[x],f+=l.width[x],X+=l.width[x])}j!=0&&(ye(j,b,Ue,je,_e,Oe),j=0),Se!=0&&(Z(Se,b,Ue,je,_e,Oe),Se=0)}function me(u,m,b){var l=0,h=0;do{var x=u[m++],E=u[m++];l<x&&(l=x),h<E&&(h=E)}while(m<b);return l<h&&(l=h),l}function Ne(u,m,b,l,h,x){var E=bt.ht[l].xlen*65536+bt.ht[h].xlen,X=0,U;do{var j=u[m++],Se=u[m++];j!=0&&(j>14&&(j=15,X+=E),j*=16),Se!=0&&(Se>14&&(Se=15,X+=E),j+=Se),X+=bt.largetbl[j]}while(m<b);return U=X&65535,X>>=16,X>U&&(X=U,l=h),x.bits+=X,l}function De(u,m,b,l){var h=0,x=bt.ht[1].hlen;do{var E=u[m+0]*2+u[m+1];m+=2,h+=x[E]}while(m<b);return l.bits+=h,1}function G(u,m,b,l,h){var x=0,E,X=bt.ht[l].xlen,U;l==2?U=bt.table23:U=bt.table56;do{var j=u[m+0]*X+u[m+1];m+=2,x+=U[j]}while(m<b);return E=x&65535,x>>=16,x>E&&(x=E,l++),h.bits+=x,l}function de(u,m,b,l,h){var x=0,E=0,X=0,U=bt.ht[l].xlen,j=bt.ht[l].hlen,Se=bt.ht[l+1].hlen,f=bt.ht[l+2].hlen;do{var S=u[m+0]*U+u[m+1];m+=2,x+=j[S],E+=Se[S],X+=f[S]}while(m<b);var fe=l;return x>E&&(x=E,fe++),x>X&&(x=X,fe=l+2),h.bits+=x,fe}var he=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function M(u,m,b,l){var h=me(u,m,b);switch(h){case 0:return h;case 1:return De(u,m,b,l);case 2:case 3:return G(u,m,b,he[h-1],l);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return de(u,m,b,he[h-1],l);default:if(h>ti.IXMAX_VAL)return l.bits=ti.LARGE_BITS,-1;h-=15;var x;for(x=24;x<32&&!(bt.ht[x].linmax>=h);x++);var E;for(E=x-8;E<24&&!(bt.ht[E].linmax>=h);E++);return Ne(u,m,b,E,x,l)}}this.noquant_count_bits=function(u,m,b){var l=m.l3_enc,h=Math.min(576,m.max_nonzero_coeff+2>>1<<1);for(b!=null&&(b.sfb_count1=0);h>1&&(l[h-1]|l[h-2])==0;h-=2);m.count1=h;for(var x=0,E=0;h>3;h-=4){var X;if(((l[h-1]|l[h-2]|l[h-3]|l[h-4])&2147483647)>1)break;X=((l[h-4]*2+l[h-3])*2+l[h-2])*2+l[h-1],x+=bt.t32l[X],E+=bt.t33l[X]}var U=x;if(m.count1table_select=0,x>E&&(U=E,m.count1table_select=1),m.count1bits=U,m.big_values=h,h==0)return U;if(m.block_type==T.SHORT_TYPE)x=3*u.scalefac_band.s[3],x>m.big_values&&(x=m.big_values),E=m.big_values;else if(m.block_type==T.NORM_TYPE){if(sn(h<=576),x=m.region0_count=u.bv_scf[h-2],E=m.region1_count=u.bv_scf[h-1],sn(x+E+2<T.SBPSY_l),E=u.scalefac_band.l[x+E+2],x=u.scalefac_band.l[x+1],E<h){var j=new $(U);m.table_select[2]=M(l,E,h,j),U=j.bits}}else m.region0_count=7,m.region1_count=T.SBMAX_l-1-7-1,x=u.scalefac_band.l[7+1],E=h,x>E&&(x=E);if(x=Math.min(x,h),E=Math.min(E,h),sn(x>=0),sn(E>=0),0<x){var j=new $(U);m.table_select[0]=M(l,0,x,j),U=j.bits}if(x<E){var j=new $(U);m.table_select[1]=M(l,x,E,j),U=j.bits}if(u.use_best_huffman==2&&(m.part2_3_length=U,best_huffman_divide(u,m),U=m.part2_3_length),b!=null&&m.block_type==T.NORM_TYPE){for(var Se=0;u.scalefac_band.l[Se]<m.big_values;)Se++;b.sfb_count1=Se}return U},this.count_bits=function(u,m,b,l){var h=b.l3_enc,x=ti.IXMAX_VAL/C.IPOW20(b.global_gain);if(b.xrpow_max>x)return ti.LARGE_BITS;if(Q(m,h,C.IPOW20(b.global_gain),b,l),(u.substep_shaping&2)!=0)for(var E=0,X=b.global_gain+b.scalefac_scale,U=.634521682242439/C.IPOW20(X),j=0;j<b.sfbmax;j++){var Se=b.width[j];if(sn(Se>=0),u.pseudohalf[j]==0)E+=Se;else{var f;for(f=E,E+=Se;f<E;++f)h[f]=m[f]>=U?h[f]:0}}return this.noquant_count_bits(u,b,l)};function K(u,m,b,l,h,x,E){for(var X=m.big_values,U=0;U<=7+15;U++)l[U]=ti.LARGE_BITS;for(var U=0;U<16;U++){var j=u.scalefac_band.l[U+1];if(j>=X)break;var Se=0,f=new $(Se),S=M(b,0,j,f);Se=f.bits;for(var fe=0;fe<8;fe++){var _e=u.scalefac_band.l[U+fe+2];if(_e>=X)break;var Oe=Se;f=new $(Oe);var Ue=M(b,j,_e,f);Oe=f.bits,l[U+fe]>Oe&&(l[U+fe]=Oe,h[U+fe]=U,x[U+fe]=S,E[U+fe]=Ue)}}}function o(u,m,b,l,h,x,E,X){for(var U=m.big_values,j=2;j<T.SBMAX_l+1;j++){var Se=u.scalefac_band.l[j];if(Se>=U)break;var f=h[j-2]+m.count1bits;if(b.part2_3_length<=f)break;var S=new $(f),fe=M(l,Se,U,S);f=S.bits,!(b.part2_3_length<=f)&&(b.assign(m),b.part2_3_length=f,b.region0_count=x[j-2],b.region1_count=j-2-x[j-2],b.table_select[0]=E[j-2],b.table_select[1]=X[j-2],b.table_select[2]=fe)}}this.best_huffman_divide=function(u,m){var b=new Oo,l=m.l3_enc,h=za(7+15+1),x=za(7+15+1),E=za(7+15+1),X=za(7+15+1);if(!(m.block_type==T.SHORT_TYPE&&u.mode_gr==1)){b.assign(m),m.block_type==T.NORM_TYPE&&(K(u,m,l,h,x,E,X),o(u,b,m,l,h,x,E,X));var U=b.big_values;if(!(U==0||(l[U-2]|l[U-1])>1)&&(U=m.count1+2,!(U>576))){b.assign(m),b.count1=U;var j=0,Se=0;for(sn(U<=576);U>b.big_values;U-=4){var f=((l[U-4]*2+l[U-3])*2+l[U-2])*2+l[U-1];j+=bt.t32l[f],Se+=bt.t33l[f]}if(b.big_values=U,b.count1table_select=0,j>Se&&(j=Se,b.count1table_select=1),b.count1bits=j,b.block_type==T.NORM_TYPE)o(u,b,m,l,h,x,E,X);else{if(b.part2_3_length=j,j=u.scalefac_band.l[7+1],j>U&&(j=U),j>0){var S=new $(b.part2_3_length);b.table_select[0]=M(l,0,j,S),b.part2_3_length=S.bits}if(U>j){var S=new $(b.part2_3_length);b.table_select[1]=M(l,j,U,S),b.part2_3_length=S.bits}m.part2_3_length>b.part2_3_length&&m.assign(b)}}}};var I=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],H=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],O=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],g=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];l0.slen1_tab=O,l0.slen2_tab=g;function _(u,m){for(var b,l=m.tt[1][u],h=m.tt[0][u],x=0;x<bt.scfsi_band.length-1;x++){for(b=bt.scfsi_band[x];b<bt.scfsi_band[x+1]&&!(h.scalefac[b]!=l.scalefac[b]&&l.scalefac[b]>=0);b++);if(b==bt.scfsi_band[x+1]){for(b=bt.scfsi_band[x];b<bt.scfsi_band[x+1];b++)l.scalefac[b]=-1;m.scfsi[u][x]=1}}var E=0,X=0;for(b=0;b<11;b++)l.scalefac[b]!=-1&&(X++,E<l.scalefac[b]&&(E=l.scalefac[b]));for(var U=0,j=0;b<T.SBPSY_l;b++)l.scalefac[b]!=-1&&(j++,U<l.scalefac[b]&&(U=l.scalefac[b]));for(var x=0;x<16;x++)if(E<I[x]&&U<H[x]){var Se=O[x]*X+g[x]*j;l.part2_length>Se&&(l.part2_length=Se,l.scalefac_compress=x)}}this.best_scalefac_store=function(u,m,b,l){var h=l.tt[m][b],x,E,X,U,j=0;for(X=0,x=0;x<h.sfbmax;x++){var Se=h.width[x];for(sn(Se>=0),X+=Se,U=-Se;U<0&&h.l3_enc[U+X]==0;U++);U==0&&(h.scalefac[x]=j=-2)}if(h.scalefac_scale==0&&h.preflag==0){var f=0;for(x=0;x<h.sfbmax;x++)h.scalefac[x]>0&&(f|=h.scalefac[x]);if((f&1)==0&&f!=0){for(x=0;x<h.sfbmax;x++)h.scalefac[x]>0&&(h.scalefac[x]>>=1);h.scalefac_scale=j=1}}if(h.preflag==0&&h.block_type!=T.SHORT_TYPE&&u.mode_gr==2){for(x=11;x<T.SBPSY_l&&!(h.scalefac[x]<C.pretab[x]&&h.scalefac[x]!=-2);x++);if(x==T.SBPSY_l){for(x=11;x<T.SBPSY_l;x++)h.scalefac[x]>0&&(h.scalefac[x]-=C.pretab[x]);h.preflag=j=1}}for(E=0;E<4;E++)l.scfsi[b][E]=0;for(u.mode_gr==2&&m==1&&l.tt[0][b].block_type!=T.SHORT_TYPE&&l.tt[1][b].block_type!=T.SHORT_TYPE&&(_(b,l),j=0),x=0;x<h.sfbmax;x++)h.scalefac[x]==-2&&(h.scalefac[x]=0);j!=0&&(u.mode_gr==2?this.scale_bitcount(h):this.scale_bitcount_lsf(u,h))};function D(u,m){for(var b=0;b<m;++b)if(u[b]<0)return!1;return!0}var q=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],w=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],c=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(u){var m,b,l=0,h=0,x,E=u.scalefac;if(sn(D(E,u.sfbmax)),u.block_type==T.SHORT_TYPE)x=q,u.mixed_block_flag!=0&&(x=w);else if(x=c,u.preflag==0){for(b=11;b<T.SBPSY_l&&!(E[b]<C.pretab[b]);b++);if(b==T.SBPSY_l)for(u.preflag=1,b=11;b<T.SBPSY_l;b++)E[b]-=C.pretab[b]}for(b=0;b<u.sfbdivide;b++)l<E[b]&&(l=E[b]);for(;b<u.sfbmax;b++)h<E[b]&&(h=E[b]);for(u.part2_length=ti.LARGE_BITS,m=0;m<16;m++)l<I[m]&&h<H[m]&&u.part2_length>x[m]&&(u.part2_length=x[m],u.scalefac_compress=m);return u.part2_length==ti.LARGE_BITS};var L=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(u,m){var b,l,h,x,E,X,U,j,Se=za(4),f=m.scalefac;for(m.preflag!=0?b=2:b=0,U=0;U<4;U++)Se[U]=0;if(m.block_type==T.SHORT_TYPE){l=1;var S=C.nr_of_sfb_block[b][l];for(j=0,h=0;h<4;h++)for(x=S[h]/3,U=0;U<x;U++,j++)for(E=0;E<3;E++)f[j*3+E]>Se[h]&&(Se[h]=f[j*3+E])}else{l=0;var S=C.nr_of_sfb_block[b][l];for(j=0,h=0;h<4;h++)for(x=S[h],U=0;U<x;U++,j++)f[j]>Se[h]&&(Se[h]=f[j])}for(X=!1,h=0;h<4;h++)Se[h]>L[b][h]&&(X=!0);if(!X){var fe,_e,Oe,Ue;for(m.sfb_partition_table=C.nr_of_sfb_block[b][l],h=0;h<4;h++)m.slen[h]=y[Se[h]];switch(fe=m.slen[0],_e=m.slen[1],Oe=m.slen[2],Ue=m.slen[3],b){case 0:m.scalefac_compress=(fe*5+_e<<4)+(Oe<<2)+Ue;break;case 1:m.scalefac_compress=400+(fe*5+_e<<2)+Oe;break;case 2:m.scalefac_compress=500+fe*3+_e;break;default:ad.err.printf(`intensity stereo not implemented yet
2
+ `);break}}if(!X)for(sn(m.sfb_partition_table!=null),m.part2_length=0,h=0;h<4;h++)m.part2_length+=m.slen[h]*m.sfb_partition_table[h];return X};var y=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(u){for(var m=2;m<=576;m+=2){for(var b=0,l;u.scalefac_band.l[++b]<m;);for(l=ie[b][0];u.scalefac_band.l[l+1]>m;)l--;for(l<0&&(l=ie[b][0]),u.bv_scf[m-2]=l,l=ie[b][1];u.scalefac_band.l[l+u.bv_scf[m-2]+2]>m;)l--;l<0&&(l=ie[b][1]),u.bv_scf[m-1]=l}}}var c0=l0,kn=P.System,sd=P.Arrays,ld=P.new_byte,cd=P.new_float_n,ud=P.new_int,dt=P.assert;Vo.EQ=function(C,$){return Math.abs(C)>Math.abs($)?Math.abs(C-$)<=Math.abs(C)*1e-6:Math.abs(C-$)<=Math.abs($)*1e-6},Vo.NEQ=function(C,$){return!Vo.EQ(C,$)};function Vo(){var C=this,$=32773,ie=32,Z=null,ye=null,Q=null,me=null;this.setModules=function(y,u,m,b){Z=y,ye=u,Q=m,me=b};var Ne=null,De=0,G=0,de=0;this.getframebits=function(y){var u=y.internal_flags,m;u.bitrate_index!=0?m=bt.bitrate_table[y.version][u.bitrate_index]:m=y.brate,dt(8<=m&&m<=640);var b=0|(y.version+1)*72e3*m/y.out_samplerate+u.padding;return 8*b};function he(y){kn.arraycopy(y.header[y.w_ptr].buf,0,Ne,G,y.sideinfo_len),G+=y.sideinfo_len,De+=y.sideinfo_len*8,y.w_ptr=y.w_ptr+1&Bt.MAX_HEADER_BUF-1}function M(y,u,m){for(dt(m<ie-2);m>0;){var b;de==0&&(de=8,G++,dt(G<At.LAME_MAXMP3BUFFER),dt(y.header[y.w_ptr].write_timing>=De),y.header[y.w_ptr].write_timing==De&&he(y),Ne[G]=0),b=Math.min(m,de),m-=b,de-=b,dt(m<ie),dt(de<ie),Ne[G]|=u>>m<<de,De+=b}}function K(y,u,m){for(dt(m<ie-2);m>0;){var b;de==0&&(de=8,G++,dt(G<At.LAME_MAXMP3BUFFER),Ne[G]=0),b=Math.min(m,de),m-=b,de-=b,dt(m<ie),dt(de<ie),Ne[G]|=u>>m<<de,De+=b}}function o(y,u){var m=y.internal_flags,b;if(dt(u>=0),u>=8&&(M(m,76,8),u-=8),u>=8&&(M(m,65,8),u-=8),u>=8&&(M(m,77,8),u-=8),u>=8&&(M(m,69,8),u-=8),u>=32){var l=Q.getLameShortVersion();if(u>=32)for(b=0;b<l.length&&u>=8;++b)u-=8,M(m,l.charAt(b),8)}for(;u>=1;u-=1)M(m,m.ancillary_flag,1),m.ancillary_flag^=y.disable_reservoir?0:1;dt(u==0)}function I(y,u,m){for(var b=y.header[y.h_ptr].ptr;m>0;){var l=Math.min(m,8-(b&7));m-=l,dt(m<ie),y.header[y.h_ptr].buf[b>>3]|=u>>m<<8-(b&7)-l,b+=l}y.header[y.h_ptr].ptr=b}function H(y,u){y<<=8;for(var m=0;m<8;m++)y<<=1,u<<=1,((u^y)&65536)!=0&&(u^=$);return u}this.CRC_writeheader=function(y,u){var m=65535;m=H(u[2]&255,m),m=H(u[3]&255,m);for(var b=6;b<y.sideinfo_len;b++)m=H(u[b]&255,m);u[4]=byte(m>>8),u[5]=byte(m&255)};function O(y,u){var m=y.internal_flags,b,l,h;if(b=m.l3_side,m.header[m.h_ptr].ptr=0,sd.fill(m.header[m.h_ptr].buf,0,m.sideinfo_len,0),y.out_samplerate<16e3?I(m,4094,12):I(m,4095,12),I(m,y.version,1),I(m,4-3,2),I(m,y.error_protection?0:1,1),I(m,m.bitrate_index,4),I(m,m.samplerate_index,2),I(m,m.padding,1),I(m,y.extension,1),I(m,y.mode.ordinal(),2),I(m,m.mode_ext,2),I(m,y.copyright,1),I(m,y.original,1),I(m,y.emphasis,2),y.error_protection&&I(m,0,16),y.version==1){for(dt(b.main_data_begin>=0),I(m,b.main_data_begin,9),m.channels_out==2?I(m,b.private_bits,3):I(m,b.private_bits,5),h=0;h<m.channels_out;h++){var x;for(x=0;x<4;x++)I(m,b.scfsi[h][x],1)}for(l=0;l<2;l++)for(h=0;h<m.channels_out;h++){var E=b.tt[l][h];I(m,E.part2_3_length+E.part2_length,12),I(m,E.big_values/2,9),I(m,E.global_gain,8),I(m,E.scalefac_compress,4),E.block_type!=T.NORM_TYPE?(I(m,1,1),I(m,E.block_type,2),I(m,E.mixed_block_flag,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),I(m,E.subblock_gain[0],3),I(m,E.subblock_gain[1],3),I(m,E.subblock_gain[2],3)):(I(m,0,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),E.table_select[2]==14&&(E.table_select[2]=16),I(m,E.table_select[2],5),dt(0<=E.region0_count&&E.region0_count<16),dt(0<=E.region1_count&&E.region1_count<8),I(m,E.region0_count,4),I(m,E.region1_count,3)),I(m,E.preflag,1),I(m,E.scalefac_scale,1),I(m,E.count1table_select,1)}}else for(dt(b.main_data_begin>=0),I(m,b.main_data_begin,8),I(m,b.private_bits,m.channels_out),l=0,h=0;h<m.channels_out;h++){var E=b.tt[l][h];I(m,E.part2_3_length+E.part2_length,12),I(m,E.big_values/2,9),I(m,E.global_gain,8),I(m,E.scalefac_compress,9),E.block_type!=T.NORM_TYPE?(I(m,1,1),I(m,E.block_type,2),I(m,E.mixed_block_flag,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),I(m,E.subblock_gain[0],3),I(m,E.subblock_gain[1],3),I(m,E.subblock_gain[2],3)):(I(m,0,1),E.table_select[0]==14&&(E.table_select[0]=16),I(m,E.table_select[0],5),E.table_select[1]==14&&(E.table_select[1]=16),I(m,E.table_select[1],5),E.table_select[2]==14&&(E.table_select[2]=16),I(m,E.table_select[2],5),dt(0<=E.region0_count&&E.region0_count<16),dt(0<=E.region1_count&&E.region1_count<8),I(m,E.region0_count,4),I(m,E.region1_count,3)),I(m,E.scalefac_scale,1),I(m,E.count1table_select,1)}y.error_protection&&CRC_writeheader(m,m.header[m.h_ptr].buf);{var X=m.h_ptr;dt(m.header[X].ptr==m.sideinfo_len*8),m.h_ptr=X+1&Bt.MAX_HEADER_BUF-1,m.header[m.h_ptr].write_timing=m.header[X].write_timing+u,m.h_ptr==m.w_ptr&&kn.err.println(`Error: MAX_HEADER_BUF too small in bitstream.c
3
+ `)}}function g(y,u){var m=bt.ht[u.count1table_select+32],b,l=0,h=u.big_values,x=u.big_values;for(dt(u.count1table_select<2),b=(u.count1-u.big_values)/4;b>0;--b){var E=0,X=0,U;U=u.l3_enc[h+0],U!=0&&(X+=8,u.xr[x+0]<0&&E++,dt(U<=1)),U=u.l3_enc[h+1],U!=0&&(X+=4,E*=2,u.xr[x+1]<0&&E++,dt(U<=1)),U=u.l3_enc[h+2],U!=0&&(X+=2,E*=2,u.xr[x+2]<0&&E++,dt(U<=1)),U=u.l3_enc[h+3],U!=0&&(X++,E*=2,u.xr[x+3]<0&&E++,dt(U<=1)),h+=4,x+=4,M(y,E+m.table[X],m.hlen[X]),l+=m.hlen[X]}return l}function _(y,u,m,b,l){var h=bt.ht[u],x=0;if(dt(u<32),u==0)return x;for(var E=m;E<b;E+=2){var X=0,U=0,j=h.xlen,Se=h.xlen,f=0,S=l.l3_enc[E],fe=l.l3_enc[E+1];if(S!=0&&(l.xr[E]<0&&f++,X--),u>15){if(S>14){var _e=S-15;dt(_e<=h.linmax),f|=_e<<1,U=j,S=15}if(fe>14){var Oe=fe-15;dt(Oe<=h.linmax),f<<=j,f|=Oe,U+=j,fe=15}Se=16}fe!=0&&(f<<=1,l.xr[E+1]<0&&f++,X--),dt((S|fe)<16),S=S*Se+fe,U-=X,X+=h.hlen[S],dt(X<=ie),dt(U<=ie),M(y,h.table[S],X),M(y,f,U),x+=X+U}return x}function D(y,u){var m=3*y.scalefac_band.s[3];m>u.big_values&&(m=u.big_values);var b=_(y,u.table_select[0],0,m,u);return b+=_(y,u.table_select[1],m,u.big_values,u),b}function q(y,u){var m,b,l,h;m=u.big_values,dt(0<=m&&m<=576);var x=u.region0_count+1;return dt(0<=x),dt(x<y.scalefac_band.l.length),l=y.scalefac_band.l[x],x+=u.region1_count+1,dt(0<=x),dt(x<y.scalefac_band.l.length),h=y.scalefac_band.l[x],l>m&&(l=m),h>m&&(h=m),b=_(y,u.table_select[0],0,l,u),b+=_(y,u.table_select[1],l,h,u),b+=_(y,u.table_select[2],h,m,u),b}function w(y){var u,m,b,l,h=0,x=y.internal_flags,E=x.l3_side;if(y.version==1)for(u=0;u<2;u++)for(m=0;m<x.channels_out;m++){var X=E.tt[u][m],U=c0.slen1_tab[X.scalefac_compress],j=c0.slen2_tab[X.scalefac_compress];for(l=0,b=0;b<X.sfbdivide;b++)X.scalefac[b]!=-1&&(M(x,X.scalefac[b],U),l+=U);for(;b<X.sfbmax;b++)X.scalefac[b]!=-1&&(M(x,X.scalefac[b],j),l+=j);dt(l==X.part2_length),X.block_type==T.SHORT_TYPE?l+=D(x,X):l+=q(x,X),l+=g(x,X),dt(l==X.part2_3_length+X.part2_length),h+=l}else for(u=0,m=0;m<x.channels_out;m++){var X=E.tt[u][m],Se,f,S=0;if(dt(X.sfb_partition_table!=null),l=0,b=0,f=0,X.block_type==T.SHORT_TYPE){for(;f<4;f++){var fe=X.sfb_partition_table[f]/3,_e=X.slen[f];for(Se=0;Se<fe;Se++,b++)M(x,Math.max(X.scalefac[b*3+0],0),_e),M(x,Math.max(X.scalefac[b*3+1],0),_e),M(x,Math.max(X.scalefac[b*3+2],0),_e),S+=3*_e}l+=D(x,X)}else{for(;f<4;f++){var fe=X.sfb_partition_table[f],_e=X.slen[f];for(Se=0;Se<fe;Se++,b++)M(x,Math.max(X.scalefac[b],0),_e),S+=_e}l+=q(x,X)}l+=g(x,X),dt(l==X.part2_3_length),dt(S==X.part2_length),h+=S+l}return h}function c(){this.total=0}function L(y,u){var m=y.internal_flags,b,l,h,x,E;return E=m.w_ptr,x=m.h_ptr-1,x==-1&&(x=Bt.MAX_HEADER_BUF-1),b=m.header[x].write_timing-De,u.total=b,b>=0&&(l=1+x-E,x<E&&(l=1+x-E+Bt.MAX_HEADER_BUF),b-=l*8*m.sideinfo_len),h=C.getframebits(y),b+=h,u.total+=h,u.total%8!=0?u.total=1+u.total/8:u.total=u.total/8,u.total+=G+1,b<0&&kn.err.println(`strange error flushing buffer ...
4
+ `),b}this.flush_bitstream=function(y){var u=y.internal_flags,m,b,l=u.h_ptr-1;if(l==-1&&(l=Bt.MAX_HEADER_BUF-1),m=u.l3_side,!((b=L(y,new c))<0)){if(o(y,b),dt(u.header[l].write_timing+this.getframebits(y)==De),u.ResvSize=0,m.main_data_begin=0,u.findReplayGain){var h=Z.GetTitleGain(u.rgdata);dt(NEQ(h,Xa.GAIN_NOT_ENOUGH_SAMPLES)),u.RadioGain=Math.floor(h*10+.5)|0}u.findPeakSample&&(u.noclipGainChange=Math.ceil(Math.log10(u.PeakSample/32767)*20*10)|0,u.noclipGainChange>0&&(EQ(y.scale,1)||EQ(y.scale,0))?u.noclipScale=Math.floor(32767/u.PeakSample*100)/100:u.noclipScale=-1)}},this.add_dummy_byte=function(y,u,m){for(var b=y.internal_flags,l;m-- >0;)for(K(b,u,8),l=0;l<Bt.MAX_HEADER_BUF;++l)b.header[l].write_timing+=8},this.format_bitstream=function(y){var u=y.internal_flags,m;m=u.l3_side;var b=this.getframebits(y);o(y,m.resvDrain_pre),O(y,b);var l=8*u.sideinfo_len;if(l+=w(y),o(y,m.resvDrain_post),l+=m.resvDrain_post,m.main_data_begin+=(b-l)/8,L(y,new c)!=u.ResvSize&&kn.err.println("Internal buffer inconsistency. flushbits <> ResvSize"),m.main_data_begin*8!=u.ResvSize&&(kn.err.printf(`bit reservoir error:
5
5
  l3_side.main_data_begin: %d
6
6
  Resvoir size: %d
7
7
  resv drain (post) %d
@@ -10,29 +10,29 @@ header and sideinfo: %d
10
10
  data bits: %d
11
11
  total bits: %d (remainder: %d)
12
12
  bitsperframe: %d
13
- `,8*m.main_data_begin,u.ResvSize,m.resvDrain_post,m.resvDrain_pre,8*u.sideinfo_len,l-m.resvDrain_post-8*u.sideinfo_len,l,l%8,b),Dn.err.println("This is a fatal error. It has several possible causes:"),Dn.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),Dn.err.println(" 9%% Your system is overclocked"),Dn.err.println(" 1%% bug in LAME encoding library"),u.ResvSize=m.main_data_begin*8),dt(ke%8==0),ke>1e9){var h;for(h=0;h<Bt.MAX_HEADER_BUF;++h)u.header[h].write_timing-=ke;ke=0}return 0},this.copy_buffer=function(y,u,m,b,l){var h=G+1;if(h<=0)return 0;if(b!=0&&h>b)return-1;if(Dn.arraycopy(Ne,0,u,m,h),G=-1,de=0,l!=0){var x=ud(1);if(x[0]=y.nMusicCRC,me.updateMusicCRC(x,u,m,h),y.nMusicCRC=x[0],h>0&&(y.VBR_seek_table.nBytesWritten+=h),y.decode_on_the_fly){for(var E=cd([2,1152]),X=h,U=-1,j;U!=0;)if(U=ye.hip_decode1_unclipped(y.hip,u,m,X,E[0],E[1]),X=0,U==-1&&(U=0),U>0){if(dt(U<=1152),y.findPeakSample){for(j=0;j<U;j++)E[0][j]>y.PeakSample?y.PeakSample=E[0][j]:-E[0][j]>y.PeakSample&&(y.PeakSample=-E[0][j]);if(y.channels_out>1)for(j=0;j<U;j++)E[1][j]>y.PeakSample?y.PeakSample=E[1][j]:-E[1][j]>y.PeakSample&&(y.PeakSample=-E[1][j])}if(y.findReplayGain&&Z.AnalyzeSamples(y.rgdata,E[0],0,E[1],0,U,y.channels_out)==Xa.GAIN_ANALYSIS_ERROR)return-6}}}return h},this.init_bit_stream_w=function(y){Ne=ld(At.LAME_MAXMP3BUFFER),y.h_ptr=y.w_ptr=0,y.header[y.h_ptr].write_timing=0,G=-1,de=0,ke=0}}var ri=Vo,fd=P.System,Dt=P.VbrMode,u0=P.ShortBlock,Ai=P.new_float,Mc=P.new_int_n,dd=P.new_short_n,Gr=P.assert;function rr(){var C=this,$=128*1024;rr.V9=410,rr.V8=420,rr.V7=430,rr.V6=440,rr.V5=450,rr.V4=460,rr.V3=470,rr.V2=480,rr.V1=490,rr.V0=500,rr.R3MIX=1e3,rr.STANDARD=1001,rr.EXTREME=1002,rr.INSANE=1003,rr.STANDARD_FAST=1004,rr.EXTREME_FAST=1005,rr.MEDIUM=1006,rr.MEDIUM_FAST=1007;var ie=16384+$;rr.LAME_MAXMP3BUFFER=ie;var Z,ye,Q,me,Ne,ke=new Ar,G,de,he,M;this.enc=new T,this.setModules=function(f,S,fe,_e,Oe,Ue,je,ze,nt){Z=f,ye=S,Q=fe,me=_e,Ne=Oe,G=Ue,de=je,he=ze,M=nt,this.enc.setModules(ye,ke,me,G)};function K(){this.mask_adjust=0,this.mask_adjust_short=0,this.bo_l_weight=Ai(T.SBMAX_l),this.bo_s_weight=Ai(T.SBMAX_s)}function o(){this.lowerlimit=0}function I(f,S){this.lowpass=S}var H=4294479419;function O(f){var S;return f.class_id=H,S=f.internal_flags=new Bt,f.mode=nr.NOT_SET,f.original=1,f.in_samplerate=44100,f.num_channels=2,f.num_samples=-1,f.bWriteVbrTag=!0,f.quality=-1,f.short_blocks=null,S.subblock_gain=-1,f.lowpassfreq=0,f.highpassfreq=0,f.lowpasswidth=-1,f.highpasswidth=-1,f.VBR=Dt.vbr_off,f.VBR_q=4,f.ATHcurve=-1,f.VBR_mean_bitrate_kbps=128,f.VBR_min_bitrate_kbps=0,f.VBR_max_bitrate_kbps=0,f.VBR_hard_min=0,S.VBR_min_bitrate=1,S.VBR_max_bitrate=13,f.quant_comp=-1,f.quant_comp_short=-1,f.msfix=-1,S.resample_ratio=1,S.OldValue[0]=180,S.OldValue[1]=180,S.CurrentStep[0]=4,S.CurrentStep[1]=4,S.masking_lower=1,S.nsPsy.attackthre=-1,S.nsPsy.attackthre_s=-1,f.scale=-1,f.athaa_type=-1,f.ATHtype=-1,f.athaa_loudapprox=-1,f.athaa_sensitivity=0,f.useTemporal=null,f.interChRatio=-1,S.mf_samples_to_encode=T.ENCDELAY+T.POSTDELAY,f.encoder_padding=0,S.mf_size=T.ENCDELAY-T.MDCTDELAY,f.findReplayGain=!1,f.decode_on_the_fly=!1,S.decode_on_the_fly=!1,S.findReplayGain=!1,S.findPeakSample=!1,S.RadioGain=0,S.AudiophileGain=0,S.noclipGainChange=0,S.noclipScale=-1,f.preset=0,f.write_id3tag_automatic=!0,0}this.lame_init=function(){var f=new a0,S=O(f);return S!=0?null:(f.lame_allocated_gfp=1,f)};function g(f){return f>1?0:f<=0?1:Math.cos(Math.PI/2*f)}this.nearestBitrateFullIndex=function(f){var S=[8,16,24,32,40,48,56,64,80,96,112,128,160,192,224,256,320],fe=0,_e=0,Oe=0,Ue=0;Ue=S[16],Oe=16,_e=S[16],fe=16;for(var je=0;je<16;je++)if(Math.max(f,S[je+1])!=f){Ue=S[je+1],Oe=je+1,_e=S[je],fe=je;break}return Ue-f>f-_e?fe:Oe};function _(f,S){var fe=44100;return S>=48e3?fe=48e3:S>=44100?fe=44100:S>=32e3?fe=32e3:S>=24e3?fe=24e3:S>=22050?fe=22050:S>=16e3?fe=16e3:S>=12e3?fe=12e3:S>=11025?fe=11025:S>=8e3&&(fe=8e3),f==-1?fe:(f<=15960&&(fe=44100),f<=15250&&(fe=32e3),f<=11220&&(fe=24e3),f<=9970&&(fe=22050),f<=7230&&(fe=16e3),f<=5420&&(fe=12e3),f<=4510&&(fe=11025),f<=3970&&(fe=8e3),S<fe?S>44100?48e3:S>32e3?44100:S>24e3?32e3:S>22050?24e3:S>16e3?22050:S>12e3?16e3:S>11025?12e3:S>8e3?11025:8e3:fe)}function k(f,S){switch(f){case 44100:return S.version=1,0;case 48e3:return S.version=1,1;case 32e3:return S.version=1,2;case 22050:return S.version=0,0;case 24e3:return S.version=0,1;case 16e3:return S.version=0,2;case 11025:return S.version=0,0;case 12e3:return S.version=0,1;case 8e3:return S.version=0,2;default:return S.version=0,-1}}function q(f,S,fe){fe<16e3&&(S=2);for(var _e=bt.bitrate_table[S][1],Oe=2;Oe<=14;Oe++)bt.bitrate_table[S][Oe]>0&&Math.abs(bt.bitrate_table[S][Oe]-f)<Math.abs(_e-f)&&(_e=bt.bitrate_table[S][Oe]);return _e}function w(f,S,fe){fe<16e3&&(S=2);for(var _e=0;_e<=14;_e++)if(bt.bitrate_table[S][_e]>0&&bt.bitrate_table[S][_e]==f)return _e;return-1}function c(f,S){var fe=[new I(8,2e3),new I(16,3700),new I(24,3900),new I(32,5500),new I(40,7e3),new I(48,7500),new I(56,1e4),new I(64,11e3),new I(80,13500),new I(96,15100),new I(112,15600),new I(128,17e3),new I(160,17500),new I(192,18600),new I(224,19400),new I(256,19700),new I(320,20500)],_e=C.nearestBitrateFullIndex(S);f.lowerlimit=fe[_e].lowpass}function L(f){var S=f.internal_flags,fe=32,_e=-1;if(S.lowpass1>0){for(var Oe=999,Ue=0;Ue<=31;Ue++){var je=Ue/31;je>=S.lowpass2&&(fe=Math.min(fe,Ue)),S.lowpass1<je&&je<S.lowpass2&&(Oe=Math.min(Oe,Ue))}Oe==999?S.lowpass1=(fe-.75)/31:S.lowpass1=(Oe-.75)/31,S.lowpass2=fe/31}if(S.highpass2>0&&S.highpass2<.9*(.75/31)&&(S.highpass1=0,S.highpass2=0,fd.err.println(`Warning: highpass filter disabled. highpass frequency too small
14
- `)),S.highpass2>0){for(var ze=-1,Ue=0;Ue<=31;Ue++){var je=Ue/31;je<=S.highpass1&&(_e=Math.max(_e,Ue)),S.highpass1<je&&je<S.highpass2&&(ze=Math.max(ze,Ue))}S.highpass1=_e/31,ze==-1?S.highpass2=(_e+.75)/31:S.highpass2=(ze+.75)/31}for(var Ue=0;Ue<32;Ue++){var nt,Ke,je=Ue/31;S.highpass2>S.highpass1?nt=g((S.highpass2-je)/(S.highpass2-S.highpass1+1e-20)):nt=1,S.lowpass2>S.lowpass1?Ke=g((je-S.lowpass1)/(S.lowpass2-S.lowpass1+1e-20)):Ke=1,S.amp_filter[Ue]=nt*Ke}}function y(f){var S=f.internal_flags;switch(f.quality){default:case 9:S.psymodel=0,S.noise_shaping=0,S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.use_best_huffman=0,S.full_outer_loop=0;break;case 8:f.quality=7;case 7:S.psymodel=1,S.noise_shaping=0,S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.use_best_huffman=0,S.full_outer_loop=0;break;case 6:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=0,S.full_outer_loop=0;break;case 5:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=0,S.full_outer_loop=0;break;case 4:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 3:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=1,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 2:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=1,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 1:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=2,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 0:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=2,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break}}function u(f){var S=f.internal_flags;f.frameNum=0,f.write_id3tag_automatic&&he.id3tag_write_v2(f),S.bitrate_stereoMode_Hist=Mc([16,4+1]),S.bitrate_blockType_Hist=Mc([16,4+1+1]),S.PeakSample=0,f.bWriteVbrTag&&G.InitVbrTag(f)}this.lame_init_params=function(f){var S=f.internal_flags;if(S.Class_ID=0,S.ATH==null&&(S.ATH=new Zf),S.PSY==null&&(S.PSY=new K),S.rgdata==null&&(S.rgdata=new Jf),S.channels_in=f.num_channels,S.channels_in==1&&(f.mode=nr.MONO),S.channels_out=f.mode==nr.MONO?1:2,S.mode_ext=T.MPG_MD_MS_LR,f.mode==nr.MONO&&(f.force_ms=!1),f.VBR==Dt.vbr_off&&f.VBR_mean_bitrate_kbps!=128&&f.brate==0&&(f.brate=f.VBR_mean_bitrate_kbps),f.VBR==Dt.vbr_off||f.VBR==Dt.vbr_mtrh||f.VBR==Dt.vbr_mt||(f.free_format=!1),f.VBR==Dt.vbr_off&&f.brate==0&&ri.EQ(f.compression_ratio,0)&&(f.compression_ratio=11.025),f.VBR==Dt.vbr_off&&f.compression_ratio>0&&(f.out_samplerate==0&&(f.out_samplerate=map2MP3Frequency(int(.97*f.in_samplerate))),f.brate=0|f.out_samplerate*16*S.channels_out/(1e3*f.compression_ratio),S.samplerate_index=k(f.out_samplerate,f),f.free_format||(f.brate=q(f.brate,f.version,f.out_samplerate))),f.out_samplerate!=0&&(f.out_samplerate<16e3?(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,8),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,64)):f.out_samplerate<32e3?(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,8),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,160)):(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,32),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,320))),f.lowpassfreq==0){var fe=16e3;switch(f.VBR){case Dt.vbr_off:{var _e=new o;c(_e,f.brate),fe=_e.lowerlimit;break}case Dt.vbr_abr:{var _e=new o;c(_e,f.VBR_mean_bitrate_kbps),fe=_e.lowerlimit;break}case Dt.vbr_rh:{var Oe=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=f.VBR_q&&f.VBR_q<=9){var Ue=Oe[f.VBR_q],je=Oe[f.VBR_q+1],ze=f.VBR_q_frac;fe=linear_int(Ue,je,ze)}else fe=19500;break}default:{var Oe=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=f.VBR_q&&f.VBR_q<=9){var Ue=Oe[f.VBR_q],je=Oe[f.VBR_q+1],ze=f.VBR_q_frac;fe=linear_int(Ue,je,ze)}else fe=19500}}f.mode==nr.MONO&&(f.VBR==Dt.vbr_off||f.VBR==Dt.vbr_abr)&&(fe*=1.5),f.lowpassfreq=fe|0}if(f.out_samplerate==0&&(2*f.lowpassfreq>f.in_samplerate&&(f.lowpassfreq=f.in_samplerate/2),f.out_samplerate=_(f.lowpassfreq|0,f.in_samplerate)),f.lowpassfreq=Math.min(20500,f.lowpassfreq),f.lowpassfreq=Math.min(f.out_samplerate/2,f.lowpassfreq),f.VBR==Dt.vbr_off&&(f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.brate)),f.VBR==Dt.vbr_abr&&(f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.VBR_mean_bitrate_kbps)),f.bWriteVbrTag||(f.findReplayGain=!1,f.decode_on_the_fly=!1,S.findPeakSample=!1),S.findReplayGain=f.findReplayGain,S.decode_on_the_fly=f.decode_on_the_fly,S.decode_on_the_fly&&(S.findPeakSample=!0),S.findReplayGain&&Z.InitGainAnalysis(S.rgdata,f.out_samplerate)==Xa.INIT_GAIN_ANALYSIS_ERROR)return f.internal_flags=null,-6;switch(S.decode_on_the_fly&&!f.decode_only&&(S.hip!=null&&M.hip_decode_exit(S.hip),S.hip=M.hip_decode_init()),S.mode_gr=f.out_samplerate<=24e3?1:2,f.framesize=576*S.mode_gr,f.encoder_delay=T.ENCDELAY,S.resample_ratio=f.in_samplerate/f.out_samplerate,f.VBR){case Dt.vbr_mt:case Dt.vbr_rh:case Dt.vbr_mtrh:{var nt=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5];f.compression_ratio=nt[f.VBR_q]}break;case Dt.vbr_abr:f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.VBR_mean_bitrate_kbps);break;default:f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.brate);break}if(f.mode==nr.NOT_SET&&(f.mode=nr.JOINT_STEREO),f.highpassfreq>0?(S.highpass1=2*f.highpassfreq,f.highpasswidth>=0?S.highpass2=2*(f.highpassfreq+f.highpasswidth):S.highpass2=(1+0)*2*f.highpassfreq,S.highpass1/=f.out_samplerate,S.highpass2/=f.out_samplerate):(S.highpass1=0,S.highpass2=0),f.lowpassfreq>0?(S.lowpass2=2*f.lowpassfreq,f.lowpasswidth>=0?(S.lowpass1=2*(f.lowpassfreq-f.lowpasswidth),S.lowpass1<0&&(S.lowpass1=0)):S.lowpass1=(1-0)*2*f.lowpassfreq,S.lowpass1/=f.out_samplerate,S.lowpass2/=f.out_samplerate):(S.lowpass1=0,S.lowpass2=0),L(f),S.samplerate_index=k(f.out_samplerate,f),S.samplerate_index<0)return f.internal_flags=null,-1;if(f.VBR==Dt.vbr_off){if(f.free_format)S.bitrate_index=0;else if(f.brate=q(f.brate,f.version,f.out_samplerate),S.bitrate_index=w(f.brate,f.version,f.out_samplerate),S.bitrate_index<=0)return f.internal_flags=null,-1}else S.bitrate_index=1;f.analysis&&(f.bWriteVbrTag=!1),S.pinfo!=null&&(f.bWriteVbrTag=!1),ye.init_bit_stream_w(S);for(var Ke=S.samplerate_index+3*f.version+6*(f.out_samplerate<16e3?1:0),Ve=0;Ve<T.SBMAX_l+1;Ve++)S.scalefac_band.l[Ve]=me.sfBandIndex[Ke].l[Ve];for(var Ve=0;Ve<T.PSFB21+1;Ve++){var xt=(S.scalefac_band.l[22]-S.scalefac_band.l[21])/T.PSFB21,Ot=S.scalefac_band.l[21]+Ve*xt;S.scalefac_band.psfb21[Ve]=Ot}S.scalefac_band.psfb21[T.PSFB21]=576;for(var Ve=0;Ve<T.SBMAX_s+1;Ve++)S.scalefac_band.s[Ve]=me.sfBandIndex[Ke].s[Ve];for(var Ve=0;Ve<T.PSFB12+1;Ve++){var xt=(S.scalefac_band.s[13]-S.scalefac_band.s[12])/T.PSFB12,Ot=S.scalefac_band.s[12]+Ve*xt;S.scalefac_band.psfb12[Ve]=Ot}S.scalefac_band.psfb12[T.PSFB12]=192,f.version==1?S.sideinfo_len=S.channels_out==1?4+17:4+32:S.sideinfo_len=S.channels_out==1?4+9:4+17,f.error_protection&&(S.sideinfo_len+=2),u(f),S.Class_ID=H;{var Rt;for(Rt=0;Rt<19;Rt++)S.nsPsy.pefirbuf[Rt]=700*S.mode_gr*S.channels_out;f.ATHtype==-1&&(f.ATHtype=4)}switch(Gr(f.VBR_q<=9),Gr(f.VBR_q>=0),f.VBR){case Dt.vbr_mt:f.VBR=Dt.vbr_mtrh;case Dt.vbr_mtrh:{f.useTemporal==null&&(f.useTemporal=!1),Q.apply_preset(f,500-f.VBR_q*10,0),f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),f.quality<5&&(f.quality=0),f.quality>5&&(f.quality=5),S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,f.experimentalY?S.sfb21_extra=!1:S.sfb21_extra=f.out_samplerate>44e3,S.iteration_loop=new VBRNewIterationLoop(Ne);break}case Dt.vbr_rh:{Q.apply_preset(f,500-f.VBR_q*10,0),S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,f.experimentalY?S.sfb21_extra=!1:S.sfb21_extra=f.out_samplerate>44e3,f.quality>6&&(f.quality=6),f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),S.iteration_loop=new VBROldIterationLoop(Ne);break}default:{var Lt;S.sfb21_extra=!1,f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),Lt=f.VBR,Lt==Dt.vbr_off&&(f.VBR_mean_bitrate_kbps=f.brate),Q.apply_preset(f,f.VBR_mean_bitrate_kbps,0),f.VBR=Lt,S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,Lt==Dt.vbr_off?S.iteration_loop=new nd(Ne):S.iteration_loop=new ABRIterationLoop(Ne);break}}if(Gr(f.scale>=0),f.VBR!=Dt.vbr_off){if(S.VBR_min_bitrate=1,S.VBR_max_bitrate=14,f.out_samplerate<16e3&&(S.VBR_max_bitrate=8),f.VBR_min_bitrate_kbps!=0&&(f.VBR_min_bitrate_kbps=q(f.VBR_min_bitrate_kbps,f.version,f.out_samplerate),S.VBR_min_bitrate=w(f.VBR_min_bitrate_kbps,f.version,f.out_samplerate),S.VBR_min_bitrate<0)||f.VBR_max_bitrate_kbps!=0&&(f.VBR_max_bitrate_kbps=q(f.VBR_max_bitrate_kbps,f.version,f.out_samplerate),S.VBR_max_bitrate=w(f.VBR_max_bitrate_kbps,f.version,f.out_samplerate),S.VBR_max_bitrate<0))return-1;f.VBR_min_bitrate_kbps=bt.bitrate_table[f.version][S.VBR_min_bitrate],f.VBR_max_bitrate_kbps=bt.bitrate_table[f.version][S.VBR_max_bitrate],f.VBR_mean_bitrate_kbps=Math.min(bt.bitrate_table[f.version][S.VBR_max_bitrate],f.VBR_mean_bitrate_kbps),f.VBR_mean_bitrate_kbps=Math.max(bt.bitrate_table[f.version][S.VBR_min_bitrate],f.VBR_mean_bitrate_kbps)}return f.tune&&(S.PSY.mask_adjust+=f.tune_value_a,S.PSY.mask_adjust_short+=f.tune_value_a),y(f),Gr(f.scale>=0),f.athaa_type<0?S.ATH.useAdjust=3:S.ATH.useAdjust=f.athaa_type,S.ATH.aaSensitivityP=Math.pow(10,f.athaa_sensitivity/-10),f.short_blocks==null&&(f.short_blocks=u0.short_block_allowed),f.short_blocks==u0.short_block_allowed&&(f.mode==nr.JOINT_STEREO||f.mode==nr.STEREO)&&(f.short_blocks=u0.short_block_coupled),f.quant_comp<0&&(f.quant_comp=1),f.quant_comp_short<0&&(f.quant_comp_short=0),f.msfix<0&&(f.msfix=0),f.exp_nspsytune=f.exp_nspsytune|1,f.internal_flags.nsPsy.attackthre<0&&(f.internal_flags.nsPsy.attackthre=Ar.NSATTACKTHRE),f.internal_flags.nsPsy.attackthre_s<0&&(f.internal_flags.nsPsy.attackthre_s=Ar.NSATTACKTHRE_S),Gr(f.scale>=0),f.scale<0&&(f.scale=1),f.ATHtype<0&&(f.ATHtype=4),f.ATHcurve<0&&(f.ATHcurve=4),f.athaa_loudapprox<0&&(f.athaa_loudapprox=2),f.interChRatio<0&&(f.interChRatio=0),f.useTemporal==null&&(f.useTemporal=!0),S.slot_lag=S.frac_SpF=0,f.VBR==Dt.vbr_off&&(S.slot_lag=S.frac_SpF=(f.version+1)*72e3*f.brate%f.out_samplerate|0),me.iteration_init(f),ke.psymodel_init(f),Gr(f.scale>=0),0};function m(f,S){(f.in_buffer_0==null||f.in_buffer_nsamples<S)&&(f.in_buffer_0=Ai(S),f.in_buffer_1=Ai(S),f.in_buffer_nsamples=S)}this.lame_encode_flush=function(f,S,fe,_e){var Oe=f.internal_flags,Ue=dd([2,1152]),je=0,ze,nt,Ke,Ve,xt=Oe.mf_samples_to_encode-T.POSTDELAY,Ot=b(f);if(Oe.mf_samples_to_encode<1)return 0;for(ze=0,f.in_samplerate!=f.out_samplerate&&(xt+=16*f.out_samplerate/f.in_samplerate),Ke=f.framesize-xt%f.framesize,Ke<576&&(Ke+=f.framesize),f.encoder_padding=Ke,Ve=(xt+Ke)/f.framesize;Ve>0&&je>=0;){var Rt=Ot-Oe.mf_size,Lt=f.frameNum;Rt*=f.in_samplerate,Rt/=f.out_samplerate,Rt>1152&&(Rt=1152),Rt<1&&(Rt=1),nt=_e-ze,_e==0&&(nt=0),je=this.lame_encode_buffer(f,Ue[0],Ue[1],Rt,S,fe,nt),fe+=je,ze+=je,Ve-=Lt!=f.frameNum?1:0}if(Oe.mf_samples_to_encode=0,je<0||(nt=_e-ze,_e==0&&(nt=0),ye.flush_bitstream(f),je=ye.copy_buffer(Oe,S,fe,nt,1),je<0))return je;if(fe+=je,ze+=je,nt=_e-ze,_e==0&&(nt=0),f.write_id3tag_automatic){if(he.id3tag_write_v1(f),je=ye.copy_buffer(Oe,S,fe,nt,0),je<0)return je;ze+=je}return ze},this.lame_encode_buffer=function(f,S,fe,_e,Oe,Ue,je){var ze=f.internal_flags,nt=[null,null];if(ze.Class_ID!=H)return-3;if(_e==0)return 0;m(ze,_e),nt[0]=ze.in_buffer_0,nt[1]=ze.in_buffer_1;for(var Ke=0;Ke<_e;Ke++)nt[0][Ke]=S[Ke],ze.channels_in>1&&(nt[1][Ke]=fe[Ke]);return l(f,nt[0],nt[1],_e,Oe,Ue,je)};function b(f){var S=T.BLKSIZE+f.framesize-T.FFTOFFSET;return S=Math.max(S,512+f.framesize-32),Gr(Bt.MFSIZE>=S),S}function l(f,S,fe,_e,Oe,Ue,je){var ze=f.internal_flags,nt=0,Ke,Ve,xt,Ot,Rt,Lt=[null,null],jt=[null,null];if(ze.Class_ID!=H)return-3;if(_e==0)return 0;if(Rt=ye.copy_buffer(ze,Oe,Ue,je,0),Rt<0)return Rt;if(Ue+=Rt,nt+=Rt,jt[0]=S,jt[1]=fe,ri.NEQ(f.scale,0)&&ri.NEQ(f.scale,1))for(Ve=0;Ve<_e;++Ve)jt[0][Ve]*=f.scale,ze.channels_out==2&&(jt[1][Ve]*=f.scale);if(ri.NEQ(f.scale_left,0)&&ri.NEQ(f.scale_left,1))for(Ve=0;Ve<_e;++Ve)jt[0][Ve]*=f.scale_left;if(ri.NEQ(f.scale_right,0)&&ri.NEQ(f.scale_right,1))for(Ve=0;Ve<_e;++Ve)jt[1][Ve]*=f.scale_right;if(f.num_channels==2&&ze.channels_out==1)for(Ve=0;Ve<_e;++Ve)jt[0][Ve]=.5*(jt[0][Ve]+jt[1][Ve]),jt[1][Ve]=0;Ot=b(f),Lt[0]=ze.mfbuf[0],Lt[1]=ze.mfbuf[1];for(var Kt=0;_e>0;){var _r=[null,null],Ln=0,Lr=0;_r[0]=jt[0],_r[1]=jt[1];var Fr=new x;if(Se(f,Lt,_r,Kt,_e,Fr),Ln=Fr.n_in,Lr=Fr.n_out,ze.findReplayGain&&!ze.decode_on_the_fly&&Z.AnalyzeSamples(ze.rgdata,Lt[0],ze.mf_size,Lt[1],ze.mf_size,Lr,ze.channels_out)==Xa.GAIN_ANALYSIS_ERROR)return-6;if(_e-=Ln,Kt+=Ln,ze.channels_out==2,ze.mf_size+=Lr,Gr(ze.mf_size<=Bt.MFSIZE),ze.mf_samples_to_encode<1&&(ze.mf_samples_to_encode=T.ENCDELAY+T.POSTDELAY),ze.mf_samples_to_encode+=Lr,ze.mf_size>=Ot){var _n=je-nt;if(je==0&&(_n=0),Ke=h(f,Lt[0],Lt[1],Oe,Ue,_n),Ke<0)return Ke;for(Ue+=Ke,nt+=Ke,ze.mf_size-=f.framesize,ze.mf_samples_to_encode-=f.framesize,xt=0;xt<ze.channels_out;xt++)for(Ve=0;Ve<ze.mf_size;Ve++)Lt[xt][Ve]=Lt[xt][Ve+f.framesize]}}return Gr(_e==0),nt}function h(f,S,fe,_e,Oe,Ue){var je=C.enc.lame_encode_mp3_frame(f,S,fe,_e,Oe,Ue);return f.frameNum++,je}function x(){this.n_in=0,this.n_out=0}function E(){this.num_used=0}function X(f,S){return S!=0?X(S,f%S):f}function U(f,S,fe){var _e=Math.PI*S;f/=fe,f<0&&(f=0),f>1&&(f=1);var Oe=f-.5,Ue=.42-.5*Math.cos(2*f*Math.PI)+.08*Math.cos(4*f*Math.PI);return Math.abs(Oe)<1e-9?_e/Math.PI:Ue*Math.sin(fe*_e*Oe)/(Math.PI*fe*Oe)}function j(f,S,fe,_e,Oe,Ue,je,ze,nt){var Ke=f.internal_flags,Ve,xt=0,Ot,Rt=f.out_samplerate/X(f.out_samplerate,f.in_samplerate);Rt>Bt.BPC&&(Rt=Bt.BPC);var Lt=Math.abs(Ke.resample_ratio-Math.floor(.5+Ke.resample_ratio))<1e-4?1:0,jt=1/Ke.resample_ratio;jt>1&&(jt=1);var Kt=31;Kt%2==0&&--Kt,Kt+=Lt;var _r=Kt+1;if(Ke.fill_buffer_resample_init==0){for(Ke.inbuf_old[0]=Ai(_r),Ke.inbuf_old[1]=Ai(_r),Ve=0;Ve<=2*Rt;++Ve)Ke.blackfilt[Ve]=Ai(_r);for(Ke.itime[0]=0,Ke.itime[1]=0,xt=0;xt<=2*Rt;xt++){var Ln=0,Lr=(xt-Rt)/(2*Rt);for(Ve=0;Ve<=Kt;Ve++)Ln+=Ke.blackfilt[xt][Ve]=U(Ve-Lr,jt,Kt);for(Ve=0;Ve<=Kt;Ve++)Ke.blackfilt[xt][Ve]/=Ln}Ke.fill_buffer_resample_init=1}var Fr=Ke.inbuf_old[nt];for(Ot=0;Ot<_e;Ot++){var _n,Ii;if(_n=Ot*Ke.resample_ratio,xt=0|Math.floor(_n-Ke.itime[nt]),Kt+xt-Kt/2>=je)break;var Lr=_n-Ke.itime[nt]-(xt+.5*(Kt%2));Gr(Math.abs(Lr)<=.501),Ii=0|Math.floor(Lr*2*Rt+Rt+.5);var Ci=0;for(Ve=0;Ve<=Kt;++Ve){var Sn=Ve+xt-Kt/2,Cr;Gr(Sn<je),Gr(Sn+_r>=0),Cr=Sn<0?Fr[_r+Sn]:Oe[Ue+Sn],Ci+=Cr*Ke.blackfilt[Ii][Ve]}S[fe+Ot]=Ci}if(ze.num_used=Math.min(je,Kt+xt-Kt/2),Ke.itime[nt]+=ze.num_used-Ot*Ke.resample_ratio,ze.num_used>=_r)for(Ve=0;Ve<_r;Ve++)Fr[Ve]=Oe[Ue+ze.num_used+Ve-_r];else{var ii=_r-ze.num_used;for(Ve=0;Ve<ii;++Ve)Fr[Ve]=Fr[Ve+ze.num_used];for(xt=0;Ve<_r;++Ve,++xt)Fr[Ve]=Oe[Ue+xt];Gr(xt==ze.num_used)}return Ot}function Se(f,S,fe,_e,Oe,Ue){var je=f.internal_flags;if(je.resample_ratio<.9999||je.resample_ratio>1.0001)for(var ze=0;ze<je.channels_out;ze++){var nt=new E;Ue.n_out=j(f,S[ze],je.mf_size,f.framesize,fe[ze],_e,Oe,nt,ze),Ue.n_in=nt.num_used}else{Ue.n_out=Math.min(f.framesize,Oe),Ue.n_in=Ue.n_out;for(var Ke=0;Ke<Ue.n_out;++Ke)S[0][je.mf_size+Ke]=fe[0][_e+Ke],je.channels_out==2&&(S[1][je.mf_size+Ke]=fe[1][_e+Ke])}}}var vd=rr,kn=P.VbrMode;function md(){function C(G,de,he,M,K,o,I,H,O,g,_,k,q,w,c){this.vbr_q=G,this.quant_comp=de,this.quant_comp_s=he,this.expY=M,this.st_lrm=K,this.st_s=o,this.masking_adj=I,this.masking_adj_short=H,this.ath_lower=O,this.ath_curve=g,this.ath_sensitivity=_,this.interch=k,this.safejoint=q,this.sfb21mod=w,this.msfix=c}function $(G,de,he,M,K,o,I,H,O,g,_,k,q,w){this.quant_comp=de,this.quant_comp_s=he,this.safejoint=M,this.nsmsfix=K,this.st_lrm=o,this.st_s=I,this.nsbass=H,this.scale=O,this.masking_adj=g,this.ath_lower=_,this.ath_curve=k,this.interch=q,this.sfscale=w}var ie;this.setModules=function(G){ie=G};var Z=[new C(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new C(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new C(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new C(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new C(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new C(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new C(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new C(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new C(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new C(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new C(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],ye=[new C(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new C(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new C(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new C(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new C(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new C(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new C(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new C(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new C(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new C(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new C(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function Q(G,de,he){var M=G.VBR==kn.vbr_rh?Z:ye,K=G.VBR_q_frac,o=M[de],I=M[de+1],H=o;o.st_lrm=o.st_lrm+K*(I.st_lrm-o.st_lrm),o.st_s=o.st_s+K*(I.st_s-o.st_s),o.masking_adj=o.masking_adj+K*(I.masking_adj-o.masking_adj),o.masking_adj_short=o.masking_adj_short+K*(I.masking_adj_short-o.masking_adj_short),o.ath_lower=o.ath_lower+K*(I.ath_lower-o.ath_lower),o.ath_curve=o.ath_curve+K*(I.ath_curve-o.ath_curve),o.ath_sensitivity=o.ath_sensitivity+K*(I.ath_sensitivity-o.ath_sensitivity),o.interch=o.interch+K*(I.interch-o.interch),o.msfix=o.msfix+K*(I.msfix-o.msfix),ke(G,H.vbr_q),he!=0?G.quant_comp=H.quant_comp:Math.abs(G.quant_comp- -1)>0||(G.quant_comp=H.quant_comp),he!=0?G.quant_comp_short=H.quant_comp_s:Math.abs(G.quant_comp_short- -1)>0||(G.quant_comp_short=H.quant_comp_s),H.expY!=0&&(G.experimentalY=H.expY!=0),he!=0?G.internal_flags.nsPsy.attackthre=H.st_lrm:Math.abs(G.internal_flags.nsPsy.attackthre- -1)>0||(G.internal_flags.nsPsy.attackthre=H.st_lrm),he!=0?G.internal_flags.nsPsy.attackthre_s=H.st_s:Math.abs(G.internal_flags.nsPsy.attackthre_s- -1)>0||(G.internal_flags.nsPsy.attackthre_s=H.st_s),he!=0?G.maskingadjust=H.masking_adj:Math.abs(G.maskingadjust-0)>0||(G.maskingadjust=H.masking_adj),he!=0?G.maskingadjust_short=H.masking_adj_short:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=H.masking_adj_short),he!=0?G.ATHlower=-H.ath_lower/10:Math.abs(-G.ATHlower*10-0)>0||(G.ATHlower=-H.ath_lower/10),he!=0?G.ATHcurve=H.ath_curve:Math.abs(G.ATHcurve- -1)>0||(G.ATHcurve=H.ath_curve),he!=0?G.athaa_sensitivity=H.ath_sensitivity:Math.abs(G.athaa_sensitivity- -1)>0||(G.athaa_sensitivity=H.ath_sensitivity),H.interch>0&&(he!=0?G.interChRatio=H.interch:Math.abs(G.interChRatio- -1)>0||(G.interChRatio=H.interch)),H.safejoint>0&&(G.exp_nspsytune=G.exp_nspsytune|H.safejoint),H.sfb21mod>0&&(G.exp_nspsytune=G.exp_nspsytune|H.sfb21mod<<20),he!=0?G.msfix=H.msfix:Math.abs(G.msfix- -1)>0||(G.msfix=H.msfix),he==0&&(G.VBR_q=de,G.VBR_q_frac=K)}var me=[new $(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new $(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new $(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new $(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new $(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new $(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new $(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new $(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new $(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new $(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new $(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new $(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new $(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new $(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new $(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new $(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new $(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function Ne(G,de,he){var M=de,K=ie.nearestBitrateFullIndex(de);if(G.VBR=kn.vbr_abr,G.VBR_mean_bitrate_kbps=M,G.VBR_mean_bitrate_kbps=Math.min(G.VBR_mean_bitrate_kbps,320),G.VBR_mean_bitrate_kbps=Math.max(G.VBR_mean_bitrate_kbps,8),G.brate=G.VBR_mean_bitrate_kbps,G.VBR_mean_bitrate_kbps>320&&(G.disable_reservoir=!0),me[K].safejoint>0&&(G.exp_nspsytune=G.exp_nspsytune|2),me[K].sfscale>0&&(G.internal_flags.noise_shaping=2),Math.abs(me[K].nsbass)>0){var o=int(me[K].nsbass*4);o<0&&(o+=64),G.exp_nspsytune=G.exp_nspsytune|o<<2}return he!=0?G.quant_comp=me[K].quant_comp:Math.abs(G.quant_comp- -1)>0||(G.quant_comp=me[K].quant_comp),he!=0?G.quant_comp_short=me[K].quant_comp_s:Math.abs(G.quant_comp_short- -1)>0||(G.quant_comp_short=me[K].quant_comp_s),he!=0?G.msfix=me[K].nsmsfix:Math.abs(G.msfix- -1)>0||(G.msfix=me[K].nsmsfix),he!=0?G.internal_flags.nsPsy.attackthre=me[K].st_lrm:Math.abs(G.internal_flags.nsPsy.attackthre- -1)>0||(G.internal_flags.nsPsy.attackthre=me[K].st_lrm),he!=0?G.internal_flags.nsPsy.attackthre_s=me[K].st_s:Math.abs(G.internal_flags.nsPsy.attackthre_s- -1)>0||(G.internal_flags.nsPsy.attackthre_s=me[K].st_s),he!=0?G.scale=me[K].scale:Math.abs(G.scale- -1)>0||(G.scale=me[K].scale),he!=0?G.maskingadjust=me[K].masking_adj:Math.abs(G.maskingadjust-0)>0||(G.maskingadjust=me[K].masking_adj),me[K].masking_adj>0?he!=0?G.maskingadjust_short=me[K].masking_adj*.9:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=me[K].masking_adj*.9):he!=0?G.maskingadjust_short=me[K].masking_adj*1.1:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=me[K].masking_adj*1.1),he!=0?G.ATHlower=-me[K].ath_lower/10:Math.abs(-G.ATHlower*10-0)>0||(G.ATHlower=-me[K].ath_lower/10),he!=0?G.ATHcurve=me[K].ath_curve:Math.abs(G.ATHcurve- -1)>0||(G.ATHcurve=me[K].ath_curve),he!=0?G.interChRatio=me[K].interch:Math.abs(G.interChRatio- -1)>0||(G.interChRatio=me[K].interch),de}this.apply_preset=function(G,de,he){switch(de){case At.R3MIX:{de=At.V3,G.VBR=kn.vbr_mtrh;break}case At.MEDIUM:{de=At.V4,G.VBR=kn.vbr_rh;break}case At.MEDIUM_FAST:{de=At.V4,G.VBR=kn.vbr_mtrh;break}case At.STANDARD:{de=At.V2,G.VBR=kn.vbr_rh;break}case At.STANDARD_FAST:{de=At.V2,G.VBR=kn.vbr_mtrh;break}case At.EXTREME:{de=At.V0,G.VBR=kn.vbr_rh;break}case At.EXTREME_FAST:{de=At.V0,G.VBR=kn.vbr_mtrh;break}case At.INSANE:return de=320,G.preset=de,Ne(G,de,he),G.VBR=kn.vbr_off,de}switch(G.preset=de,de){case At.V9:return Q(G,9,he),de;case At.V8:return Q(G,8,he),de;case At.V7:return Q(G,7,he),de;case At.V6:return Q(G,6,he),de;case At.V5:return Q(G,5,he),de;case At.V4:return Q(G,4,he),de;case At.V3:return Q(G,3,he),de;case At.V2:return Q(G,2,he),de;case At.V1:return Q(G,1,he),de;case At.V0:return Q(G,0,he),de;default:break}return 8<=de&&de<=320?Ne(G,de,he):(G.preset=0,de)};function ke(G,de){var he=0;return 0>de&&(he=-1,de=0),9<de&&(he=-1,de=9),G.VBR_q=de,G.VBR_q_frac=0,he}}var pd=md;function hd(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}var _d=hd;function Sd(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}var f0=Sd,Pc=P.new_float,gd=P.new_int;function bd(){this.global_gain=0,this.sfb_count1=0,this.step=gd(39),this.noise=Pc(39),this.noise_log=Pc(39)}var xd=bd,ni=P.System,Bc=P.VbrMode,d0=P.Util,ra=P.Arrays,ja=P.new_float,ln=P.assert;function yd(){var C;this.rv=null;var $;this.qupvt=null;var ie,Z=new _d,ye;this.setModules=function(O,g,_,k){C=O,$=g,this.rv=g,ie=_,this.qupvt=_,ye=k,Z.setModules(ie,ye)},this.ms_convert=function(O,g){for(var _=0;_<576;++_){var k=O.tt[g][0].xr[_],q=O.tt[g][1].xr[_];O.tt[g][0].xr[_]=(k+q)*(d0.SQRT2*.5),O.tt[g][1].xr[_]=(k-q)*(d0.SQRT2*.5)}};function Q(O,g,_,k){k=0;for(var q=0;q<=_;++q){var w=Math.abs(O.xr[q]);k+=w,g[q]=Math.sqrt(w*Math.sqrt(w)),g[q]>O.xrpow_max&&(O.xrpow_max=g[q])}return k}this.init_xrpow=function(O,g,_){var k=0,q=0|g.max_nonzero_coeff;if(ln(_!=null),g.xrpow_max=0,ln(0<=q&&q<=575),ra.fill(_,q,576,0),k=Q(g,_,q,k),k>1e-20){var w=0;(O.substep_shaping&2)!=0&&(w=1);for(var c=0;c<g.psymax;c++)O.pseudohalf[c]=w;return!0}return ra.fill(g.l3_enc,0,576,0),!1};function me(O,g){var _=O.ATH,k=g.xr;if(g.block_type!=T.SHORT_TYPE)for(var q=!1,w=T.PSFB21-1;w>=0&&!q;w--){var c=O.scalefac_band.psfb21[w],L=O.scalefac_band.psfb21[w+1],y=ie.athAdjust(_.adjust,_.psfb21[w],_.floor);O.nsPsy.longfact[21]>1e-12&&(y*=O.nsPsy.longfact[21]);for(var u=L-1;u>=c;u--)if(Math.abs(k[u])<y)k[u]=0;else{q=!0;break}}else for(var m=0;m<3;m++)for(var q=!1,w=T.PSFB12-1;w>=0&&!q;w--){var c=O.scalefac_band.s[12]*3+(O.scalefac_band.s[13]-O.scalefac_band.s[12])*m+(O.scalefac_band.psfb12[w]-O.scalefac_band.psfb12[0]),L=c+(O.scalefac_band.psfb12[w+1]-O.scalefac_band.psfb12[w]),b=ie.athAdjust(_.adjust,_.psfb12[w],_.floor);O.nsPsy.shortfact[12]>1e-12&&(b*=O.nsPsy.shortfact[12]);for(var u=L-1;u>=c;u--)if(Math.abs(k[u])<b)k[u]=0;else{q=!0;break}}}this.init_outer_loop=function(O,g){g.part2_3_length=0,g.big_values=0,g.count1=0,g.global_gain=210,g.scalefac_compress=0,g.table_select[0]=0,g.table_select[1]=0,g.table_select[2]=0,g.subblock_gain[0]=0,g.subblock_gain[1]=0,g.subblock_gain[2]=0,g.subblock_gain[3]=0,g.region0_count=0,g.region1_count=0,g.preflag=0,g.scalefac_scale=0,g.count1table_select=0,g.part2_length=0,g.sfb_lmax=T.SBPSY_l,g.sfb_smin=T.SBPSY_s,g.psy_lmax=O.sfb21_extra?T.SBMAX_l:T.SBPSY_l,g.psymax=g.psy_lmax,g.sfbmax=g.sfb_lmax,g.sfbdivide=11;for(var _=0;_<T.SBMAX_l;_++)g.width[_]=O.scalefac_band.l[_+1]-O.scalefac_band.l[_],g.window[_]=3;if(g.block_type==T.SHORT_TYPE){var k=ja(576);g.sfb_smin=0,g.sfb_lmax=0,g.mixed_block_flag!=0&&(g.sfb_smin=3,g.sfb_lmax=O.mode_gr*2+4),g.psymax=g.sfb_lmax+3*((O.sfb21_extra?T.SBMAX_s:T.SBPSY_s)-g.sfb_smin),g.sfbmax=g.sfb_lmax+3*(T.SBPSY_s-g.sfb_smin),g.sfbdivide=g.sfbmax-18,g.psy_lmax=g.sfb_lmax;var q=O.scalefac_band.l[g.sfb_lmax];ni.arraycopy(g.xr,0,k,0,576);for(var _=g.sfb_smin;_<T.SBMAX_s;_++)for(var w=O.scalefac_band.s[_],c=O.scalefac_band.s[_+1],L=0;L<3;L++)for(var y=w;y<c;y++)g.xr[q++]=k[3*y+L];for(var u=g.sfb_lmax,_=g.sfb_smin;_<T.SBMAX_s;_++)g.width[u]=g.width[u+1]=g.width[u+2]=O.scalefac_band.s[_+1]-O.scalefac_band.s[_],g.window[u]=0,g.window[u+1]=1,g.window[u+2]=2,u+=3}g.count1bits=0,g.sfb_partition_table=ie.nr_of_sfb_block[0][0],g.slen[0]=0,g.slen[1]=0,g.slen[2]=0,g.slen[3]=0,g.max_nonzero_coeff=575,ra.fill(g.scalefac,0),me(O,g)};function Ne(O){this.ordinal=O}Ne.BINSEARCH_NONE=new Ne(0),Ne.BINSEARCH_UP=new Ne(1),Ne.BINSEARCH_DOWN=new Ne(2);function ke(O,g,_,k,q){var w,c=O.CurrentStep[k],L=!1,y=O.OldValue[k],u=Ne.BINSEARCH_NONE;for(g.global_gain=y,_-=g.part2_length,ln(c!=0);;){var m;if(w=ye.count_bits(O,q,g,null),c==1||w==_)break;w>_?(u==Ne.BINSEARCH_DOWN&&(L=!0),L&&(c/=2),u=Ne.BINSEARCH_UP,m=c):(u==Ne.BINSEARCH_UP&&(L=!0),L&&(c/=2),u=Ne.BINSEARCH_DOWN,m=-c),g.global_gain+=m,g.global_gain<0&&(g.global_gain=0,L=!0),g.global_gain>255&&(g.global_gain=255,L=!0)}for(ln(g.global_gain>=0),ln(g.global_gain<256);w>_&&g.global_gain<255;)g.global_gain++,w=ye.count_bits(O,q,g,null);return O.CurrentStep[k]=y-g.global_gain>=4?4:2,O.OldValue[k]=g.global_gain,g.part2_3_length=w,w}this.trancate_smallspectrums=function(O,g,_,k){var q=ja(xi.SFBMAX);if(!((O.substep_shaping&4)==0&&g.block_type==T.SHORT_TYPE||(O.substep_shaping&128)!=0)){ie.calc_noise(g,_,q,new f0,null);for(var c=0;c<576;c++){var w=0;g.l3_enc[c]!=0&&(w=Math.abs(g.xr[c])),k[c]=w}var c=0,L=8;g.block_type==T.SHORT_TYPE&&(L=6);do{var y,u,m,b,l=g.width[L];if(c+=l,!(q[L]>=1)&&(ra.sort(k,c-l,l),!Xn.EQ(k[c-1],0))){y=(1-q[L])*_[L],u=0,b=0;do{var h;for(m=1;b+m<l&&!Xn.NEQ(k[b+c-l],k[b+c+m-l]);m++);if(h=k[b+c-l]*k[b+c-l]*m,y<h){b!=0&&(u=k[b+c-l-1]);break}y-=h,b+=m}while(b<l);if(!Xn.EQ(u,0))do Math.abs(g.xr[c-l])<=u&&(g.l3_enc[c-l]=0);while(--l>0)}}while(++L<g.psymax);g.part2_3_length=ye.noquant_count_bits(O,g,null)}};function G(O){for(var g=0;g<O.sfbmax;g++)if(O.scalefac[g]+O.subblock_gain[O.window[g]]==0)return!1;return!0}function de(O){return d0.FAST_LOG10(.368+.632*O*O*O)}function he(O,g){for(var _=1e-37,k=0;k<g.psymax;k++)_+=de(O[k]);return Math.max(1e-20,_)}function M(O,g,_,k,q){var w;switch(O){default:case 9:{g.over_count>0?(w=_.over_SSD<=g.over_SSD,_.over_SSD==g.over_SSD&&(w=_.bits<g.bits)):w=_.max_noise<0&&_.max_noise*10+_.bits<=g.max_noise*10+g.bits;break}case 0:w=_.over_count<g.over_count||_.over_count==g.over_count&&_.over_noise<g.over_noise||_.over_count==g.over_count&&Xn.EQ(_.over_noise,g.over_noise)&&_.tot_noise<g.tot_noise;break;case 8:_.max_noise=he(q,k);case 1:w=_.max_noise<g.max_noise;break;case 2:w=_.tot_noise<g.tot_noise;break;case 3:w=_.tot_noise<g.tot_noise&&_.max_noise<g.max_noise;break;case 4:w=_.max_noise<=0&&g.max_noise>.2||_.max_noise<=0&&g.max_noise<0&&g.max_noise>_.max_noise-.2&&_.tot_noise<g.tot_noise||_.max_noise<=0&&g.max_noise>0&&g.max_noise>_.max_noise-.2&&_.tot_noise<g.tot_noise+g.over_noise||_.max_noise>0&&g.max_noise>-.05&&g.max_noise>_.max_noise-.1&&_.tot_noise+_.over_noise<g.tot_noise+g.over_noise||_.max_noise>0&&g.max_noise>-.1&&g.max_noise>_.max_noise-.15&&_.tot_noise+_.over_noise+_.over_noise<g.tot_noise+g.over_noise+g.over_noise;break;case 5:w=_.over_noise<g.over_noise||Xn.EQ(_.over_noise,g.over_noise)&&_.tot_noise<g.tot_noise;break;case 6:w=_.over_noise<g.over_noise||Xn.EQ(_.over_noise,g.over_noise)&&(_.max_noise<g.max_noise||Xn.EQ(_.max_noise,g.max_noise)&&_.tot_noise<=g.tot_noise);break;case 7:w=_.over_count<g.over_count||_.over_noise<g.over_noise;break}return g.over_count==0&&(w=w&&_.bits<g.bits),w}function K(O,g,_,k,q){var w=O.internal_flags,c;g.scalefac_scale==0?c=1.2968395546510096:c=1.6817928305074292;for(var L=0,y=0;y<g.sfbmax;y++)L<_[y]&&(L=_[y]);var u=w.noise_shaping_amp;switch(u==3&&(q?u=2:u=1),u){case 2:break;case 1:L>1?L=Math.pow(L,.5):L*=.95;break;case 0:default:L>1?L=1:L*=.95;break}for(var m=0,y=0;y<g.sfbmax;y++){var b=g.width[y],l;if(m+=b,!(_[y]<L)){if((w.substep_shaping&2)!=0&&(w.pseudohalf[y]=w.pseudohalf[y]==0?1:0,w.pseudohalf[y]==0&&w.noise_shaping_amp==2))return;for(g.scalefac[y]++,l=-b;l<0;l++)k[m+l]*=c,k[m+l]>g.xrpow_max&&(g.xrpow_max=k[m+l]);if(w.noise_shaping_amp==2)return}}}function o(O,g){for(var _=1.2968395546510096,k=0,q=0;q<O.sfbmax;q++){var w=O.width[q],c=O.scalefac[q];if(O.preflag!=0&&(c+=ie.pretab[q]),k+=w,(c&1)!=0){c++;for(var L=-w;L<0;L++)g[k+L]*=_,g[k+L]>O.xrpow_max&&(O.xrpow_max=g[k+L])}O.scalefac[q]=c>>1}O.preflag=0,O.scalefac_scale=1}function I(O,g,_){var k,q=g.scalefac;for(k=0;k<g.sfb_lmax;k++)if(q[k]>=16)return!0;for(var w=0;w<3;w++){var c=0,L=0;for(k=g.sfb_lmax+w;k<g.sfbdivide;k+=3)c<q[k]&&(c=q[k]);for(;k<g.sfbmax;k+=3)L<q[k]&&(L=q[k]);if(!(c<16&&L<8)){if(g.subblock_gain[w]>=7)return!0;g.subblock_gain[w]++;var y=O.scalefac_band.l[g.sfb_lmax];for(k=g.sfb_lmax+w;k<g.sfbmax;k+=3){var u,m=g.width[k],b=q[k];if(ln(b>=0),b=b-(4>>g.scalefac_scale),b>=0){q[k]=b,y+=m*3;continue}q[k]=0;{var l=210+(b<<g.scalefac_scale+1);u=ie.IPOW20(l)}y+=m*(w+1);for(var h=-m;h<0;h++)_[y+h]*=u,_[y+h]>g.xrpow_max&&(g.xrpow_max=_[y+h]);y+=m*(3-w-1)}{var u=ie.IPOW20(202);y+=g.width[k]*(w+1);for(var h=-g.width[k];h<0;h++)_[y+h]*=u,_[y+h]>g.xrpow_max&&(g.xrpow_max=_[y+h])}}}return!1}function H(O,g,_,k,q){var w=O.internal_flags;K(O,g,_,k,q);var c=G(g);return c?!1:(w.mode_gr==2?c=ye.scale_bitcount(g):c=ye.scale_bitcount_lsf(w,g),c?(w.noise_shaping>1&&(ra.fill(w.pseudohalf,0),g.scalefac_scale==0?(o(g,k),c=!1):g.block_type==T.SHORT_TYPE&&w.subblock_gain>0&&(c=I(w,g,k)||G(g))),c||(w.mode_gr==2?c=ye.scale_bitcount(g):c=ye.scale_bitcount_lsf(w,g)),!c):!0)}this.outer_loop=function(O,g,_,k,q,w){var c=O.internal_flags,L=new Oo,y=ja(576),u=ja(xi.SFBMAX),m=new f0,b,l=new xd,h=9999999,x=!1,E=!1,X=0;if(ke(c,g,w,q,k),c.noise_shaping==0)return 100;ie.calc_noise(g,_,u,m,l),m.bits=g.part2_3_length,L.assign(g);var U=0;for(ni.arraycopy(k,0,y,0,576);!x;){do{var j=new f0,Se,f=255;if((c.substep_shaping&2)!=0?Se=20:Se=3,c.sfb21_extra&&(u[L.sfbmax]>1||L.block_type==T.SHORT_TYPE&&(u[L.sfbmax+1]>1||u[L.sfbmax+2]>1))||!H(O,L,u,k,E))break;L.scalefac_scale!=0&&(f=254);var S=w-L.part2_length;if(S<=0)break;for(;(L.part2_3_length=ye.count_bits(c,k,L,l))>S&&L.global_gain<=f;)L.global_gain++;if(L.global_gain>f)break;if(m.over_count==0){for(;(L.part2_3_length=ye.count_bits(c,k,L,l))>h&&L.global_gain<=f;)L.global_gain++;if(L.global_gain>f)break}if(ie.calc_noise(L,_,u,j,l),j.bits=L.part2_3_length,g.block_type!=T.SHORT_TYPE?b=O.quant_comp:b=O.quant_comp_short,b=M(b,m,j,L,u)?1:0,b!=0)h=g.part2_3_length,m=j,g.assign(L),U=0,ni.arraycopy(k,0,y,0,576);else if(c.full_outer_loop==0&&(++U>Se&&m.over_count==0||c.noise_shaping_amp==3&&E&&U>30||c.noise_shaping_amp==3&&E&&L.global_gain-X>15))break}while(L.global_gain+L.scalefac_scale<255);c.noise_shaping_amp==3?E?x=!0:(L.assign(g),ni.arraycopy(y,0,k,0,576),U=0,X=L.global_gain,E=!0):x=!0}return ln(g.global_gain+g.scalefac_scale<=255),O.VBR==Bc.vbr_rh||O.VBR==Bc.vbr_mtrh?ni.arraycopy(y,0,k,0,576):(c.substep_shaping&1)!=0&&trancate_smallspectrums(c,g,_,k),m.over_count},this.iteration_finish_one=function(O,g,_){var k=O.l3_side,q=k.tt[g][_];ye.best_scalefac_store(O,g,_,k),O.use_best_huffman==1&&ye.best_huffman_divide(O,q),$.ResvAdjust(O,q)},this.VBR_encode_granule=function(O,g,_,k,q,w,c){var L=O.internal_flags,y=new Oo,u=ja(576),m=c,b=c+1,l=(c+w)/2,h,x,E=0,X=L.sfb21_extra;ln(m<=LameInternalFlags.MAX_BITS_PER_CHANNEL),ra.fill(y.l3_enc,0);do ln(l>=w),ln(l<=c),ln(w<=c),l>m-42?L.sfb21_extra=!1:L.sfb21_extra=X,x=outer_loop(O,g,_,k,q,l),x<=0?(E=1,b=g.part2_3_length,y.assign(g),ni.arraycopy(k,0,u,0,576),c=b-32,h=c-w,l=(c+w)/2):(w=l+32,h=c-w,l=(c+w)/2,E!=0&&(E=2,g.assign(y),ni.arraycopy(u,0,k,0,576)));while(h>12);L.sfb21_extra=X,E==2&&ni.arraycopy(y.l3_enc,0,g.l3_enc,0,576),ln(g.part2_3_length<=m)},this.get_framebits=function(O,g){var _=O.internal_flags;_.bitrate_index=_.VBR_min_bitrate;var k=C.getframebits(O);_.bitrate_index=1,k=C.getframebits(O);for(var q=1;q<=_.VBR_max_bitrate;q++){_.bitrate_index=q;var w=new MeanBits(k);g[q]=$.ResvFrameBegin(O,w),k=w.bits}},this.VBR_old_prepare=function(O,g,_,k,q,w,c,L,y){var u=O.internal_flags,m,b=0,l=1,h=0;u.bitrate_index=u.VBR_max_bitrate;var x=$.ResvFrameBegin(O,new MeanBits(0))/u.mode_gr;get_framebits(O,w);for(var E=0;E<u.mode_gr;E++){var X=ie.on_pe(O,g,L[E],x,E,0);u.mode_ext==T.MPG_MD_MS_LR&&(ms_convert(u.l3_side,E),ie.reduce_side(L[E],_[E],x,X));for(var U=0;U<u.channels_out;++U){var j=u.l3_side.tt[E][U];j.block_type!=T.SHORT_TYPE?(b=1.28/(1+Math.exp(3.5-g[E][U]/300))-.05,m=u.PSY.mask_adjust-b):(b=2.56/(1+Math.exp(3.5-g[E][U]/300))-.14,m=u.PSY.mask_adjust_short-b),u.masking_lower=Math.pow(10,m*.1),init_outer_loop(u,j),y[E][U]=ie.calc_xmin(O,k[E][U],j,q[E][U]),y[E][U]!=0&&(l=0),c[E][U]=126,h+=L[E][U]}}for(var E=0;E<u.mode_gr;E++)for(var U=0;U<u.channels_out;U++)h>w[u.VBR_max_bitrate]&&(L[E][U]*=w[u.VBR_max_bitrate],L[E][U]/=h),c[E][U]>L[E][U]&&(c[E][U]=L[E][U]);return l},this.bitpressure_strategy=function(O,g,_,k){for(var q=0;q<O.mode_gr;q++)for(var w=0;w<O.channels_out;w++){for(var c=O.l3_side.tt[q][w],L=g[q][w],y=0,u=0;u<c.psy_lmax;u++)L[y++]*=1+.029*u*u/T.SBMAX_l/T.SBMAX_l;if(c.block_type==T.SHORT_TYPE)for(var u=c.sfb_smin;u<T.SBMAX_s;u++)L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s,L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s,L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s;k[q][w]=0|Math.max(_[q][w],.9*k[q][w])}},this.VBR_new_prepare=function(O,g,_,k,q,w){var c=O.internal_flags,L=1,y=0,u=0,m;if(O.free_format){c.bitrate_index=0;var b=new MeanBits(y);m=$.ResvFrameBegin(O,b),y=b.bits,q[0]=m}else{c.bitrate_index=c.VBR_max_bitrate;var b=new MeanBits(y);$.ResvFrameBegin(O,b),y=b.bits,get_framebits(O,q),m=q[c.VBR_max_bitrate]}for(var l=0;l<c.mode_gr;l++){ie.on_pe(O,g,w[l],y,l,0),c.mode_ext==T.MPG_MD_MS_LR&&ms_convert(c.l3_side,l);for(var h=0;h<c.channels_out;++h){var x=c.l3_side.tt[l][h];c.masking_lower=Math.pow(10,c.PSY.mask_adjust*.1),init_outer_loop(c,x),ie.calc_xmin(O,_[l][h],x,k[l][h])!=0&&(L=0),u+=w[l][h]}}for(var l=0;l<c.mode_gr;l++)for(var h=0;h<c.channels_out;h++)u>m&&(w[l][h]*=m,w[l][h]/=u);return L},this.calc_target_bits=function(O,g,_,k,q,w){var c=O.internal_flags,L=c.l3_side,y,u,m,b,l=0;c.bitrate_index=c.VBR_max_bitrate;var h=new MeanBits(l);for(w[0]=$.ResvFrameBegin(O,h),l=h.bits,c.bitrate_index=1,l=C.getframebits(O)-c.sideinfo_len*8,q[0]=l/(c.mode_gr*c.channels_out),l=O.VBR_mean_bitrate_kbps*O.framesize*1e3,(c.substep_shaping&1)!=0&&(l*=1.09),l/=O.out_samplerate,l-=c.sideinfo_len*8,l/=c.mode_gr*c.channels_out,y=.93+.07*(11-O.compression_ratio)/(11-5.5),y<.9&&(y=.9),y>1&&(y=1),u=0;u<c.mode_gr;u++){var x=0;for(m=0;m<c.channels_out;m++){if(k[u][m]=int(y*l),g[u][m]>700){var E=int((g[u][m]-700)/1.4),X=L.tt[u][m];k[u][m]=int(y*l),X.block_type==T.SHORT_TYPE&&E<l/2&&(E=l/2),E>l*3/2?E=l*3/2:E<0&&(E=0),k[u][m]+=E}k[u][m]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(k[u][m]=LameInternalFlags.MAX_BITS_PER_CHANNEL),x+=k[u][m]}if(x>LameInternalFlags.MAX_BITS_PER_GRANULE)for(m=0;m<c.channels_out;++m)k[u][m]*=LameInternalFlags.MAX_BITS_PER_GRANULE,k[u][m]/=x}if(c.mode_ext==T.MPG_MD_MS_LR)for(u=0;u<c.mode_gr;u++)ie.reduce_side(k[u],_[u],l*c.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(b=0,u=0;u<c.mode_gr;u++)for(m=0;m<c.channels_out;m++)k[u][m]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(k[u][m]=LameInternalFlags.MAX_BITS_PER_CHANNEL),b+=k[u][m];if(b>w[0])for(u=0;u<c.mode_gr;u++)for(m=0;m<c.channels_out;m++)k[u][m]*=w[0],k[u][m]/=b}}var Ed=yd,qo=P.assert;function wd(){var C;this.setModules=function($){C=$},this.ResvFrameBegin=function($,ie){var Z=$.internal_flags,ye,Q=Z.l3_side,me=C.getframebits($);ie.bits=(me-Z.sideinfo_len*8)/Z.mode_gr;var Ne=8*256*Z.mode_gr-8;$.brate>320?ye=8*int($.brate*1e3/($.out_samplerate/1152)/8+.5):(ye=8*1440,$.strict_ISO&&(ye=8*int(32e4/($.out_samplerate/1152)/8+.5))),Z.ResvMax=ye-me,Z.ResvMax>Ne&&(Z.ResvMax=Ne),(Z.ResvMax<0||$.disable_reservoir)&&(Z.ResvMax=0);var ke=ie.bits*Z.mode_gr+Math.min(Z.ResvSize,Z.ResvMax);return ke>ye&&(ke=ye),qo(Z.ResvMax%8==0),qo(Z.ResvMax>=0),Q.resvDrain_pre=0,Z.pinfo!=null&&(Z.pinfo.mean_bits=ie.bits/2,Z.pinfo.resvsize=Z.ResvSize),ke},this.ResvMaxBits=function($,ie,Z,ye){var Q=$.internal_flags,me,Ne=Q.ResvSize,ke=Q.ResvMax;ye!=0&&(Ne+=ie),(Q.substep_shaping&1)!=0&&(ke*=.9),Z.bits=ie,Ne*10>ke*9?(me=Ne-ke*9/10,Z.bits+=me,Q.substep_shaping|=128):(me=0,Q.substep_shaping&=127,!$.disable_reservoir&&(Q.substep_shaping&1)==0&&(Z.bits-=.1*ie));var G=Ne<Q.ResvMax*6/10?Ne:Q.ResvMax*6/10;return G-=me,G<0&&(G=0),G},this.ResvAdjust=function($,ie){$.ResvSize-=ie.part2_3_length+ie.part2_length},this.ResvFrameEnd=function($,ie){var Z,ye=$.l3_side;$.ResvSize+=ie*$.mode_gr;var Q=0;ye.resvDrain_post=0,ye.resvDrain_pre=0,(Z=$.ResvSize%8)!=0&&(Q+=Z),Z=$.ResvSize-Q-$.ResvMax,Z>0&&(qo(Z%8==0),qo(Z>=0),Q+=Z);{var me=Math.min(ye.main_data_begin*8,Q)/8;ye.resvDrain_pre+=8*me,Q-=8*me,$.ResvSize-=8*me,ye.main_data_begin-=me}ye.resvDrain_post+=Q,$.ResvSize-=Q}}var Rd=wd;function Td(){var C="http://www.mp3dev.org/",$=3,ie=98,Z=4,ye=0,Q=93;this.getLameVersion=function(){return $+"."+ie+"."+Z},this.getLameShortVersion=function(){return $+"."+ie+"."+Z},this.getLameVeryShortVersion=function(){return"LAME"+$+"."+ie+"r"},this.getPsyVersion=function(){return ye+"."+Q},this.getLameUrl=function(){return C},this.getLameOsBitness=function(){return"32bits"}}var Ad=Td,Id=P.System,v0=P.VbrMode,Nc=P.ShortBlock,Cd=P.Arrays,zo=P.new_byte,Md=P.assert;Ga.NUMTOCENTRIES=100,Ga.MAXFRAMESIZE=2880;function Ga(){var C,$,ie;this.setModules=function(l,h,x){C=l,$=h,ie=x};var Z=1,ye=2,Q=4,me=8,Ne=Ga.NUMTOCENTRIES,ke=Ga.MAXFRAMESIZE,G=Ne+4+4+4+4+4,de=G+9+1+1+8+1+1+3+1+1+2+4+2+2,he=128,M=64,K=32,o=null,I="Xing",H="Info",O=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function g(l,h){if(l.nVbrNumFrames++,l.sum+=h,l.seen++,!(l.seen<l.want)&&(l.pos<l.size&&(l.bag[l.pos]=l.sum,l.pos++,l.seen=0),l.pos==l.size)){for(var x=1;x<l.size;x+=2)l.bag[x/2]=l.bag[x];l.want*=2,l.pos/=2}}function _(l,h){if(!(l.pos<=0))for(var x=1;x<Ne;++x){var E=x/Ne,X,U,j=0|Math.floor(E*l.pos);j>l.pos-1&&(j=l.pos-1),X=l.bag[j],U=l.sum;var Se=0|256*X/U;Se>255&&(Se=255),h[x]=255&Se}}this.addVbrFrame=function(l){var h=l.internal_flags,x=Tables.bitrate_table[l.version][h.bitrate_index];Md(h.VBR_seek_table.bag!=null),g(h.VBR_seek_table,x)};function k(l,h){var x=l[h+0]&255;return x<<=8,x|=l[h+1]&255,x<<=8,x|=l[h+2]&255,x<<=8,x|=l[h+3]&255,x}function q(l,h,x){l[h+0]=255&(x>>24&255),l[h+1]=255&(x>>16&255),l[h+2]=255&(x>>8&255),l[h+3]=255&(x&255)}function w(l,h,x){l[h+0]=255&(x>>8&255),l[h+1]=255&(x&255)}function c(l,h){return new String(l,h,I.length(),o).equals(I)||new String(l,h,H.length(),o).equals(H)}function L(l,h,x){return 255&(l<<h|x&~(-1<<h))}function y(l,h){var x=l.internal_flags;h[0]=L(h[0],8,255),h[1]=L(h[1],3,7),h[1]=L(h[1],1,l.out_samplerate<16e3?0:1),h[1]=L(h[1],1,l.version),h[1]=L(h[1],2,4-3),h[1]=L(h[1],1,l.error_protection?0:1),h[2]=L(h[2],4,x.bitrate_index),h[2]=L(h[2],2,x.samplerate_index),h[2]=L(h[2],1,0),h[2]=L(h[2],1,l.extension),h[3]=L(h[3],2,l.mode.ordinal()),h[3]=L(h[3],2,x.mode_ext),h[3]=L(h[3],1,l.copyright),h[3]=L(h[3],1,l.original),h[3]=L(h[3],2,l.emphasis),h[0]=255;var E=255&(h[1]&241),X;l.version==1?X=he:l.out_samplerate<16e3?X=K:X=M,l.VBR==v0.vbr_off&&(X=l.brate);var U;l.free_format?U=0:U=255&16*C.BitrateIndex(X,l.version,l.out_samplerate),l.version==1?(h[1]=255&(E|10),E=255&(h[2]&13),h[2]=255&(U|E)):(h[1]=255&(E|2),E=255&(h[2]&13),h[2]=255&(U|E))}this.getVbrTag=function(l){var h=new VBRTagData,x=0;h.flags=0;var E=l[x+1]>>3&1,X=l[x+2]>>2&3,U=l[x+3]>>6&3,j=l[x+2]>>4&15;if(j=Tables.bitrate_table[E][j],l[x+1]>>4==14?h.samprate=Tables.samplerate_table[2][X]:h.samprate=Tables.samplerate_table[E][X],E!=0?U!=3?x+=32+4:x+=17+4:U!=3?x+=17+4:x+=9+4,!c(l,x))return null;x+=4,h.hId=E;var Se=h.flags=k(l,x);if(x+=4,(Se&Z)!=0&&(h.frames=k(l,x),x+=4),(Se&ye)!=0&&(h.bytes=k(l,x),x+=4),(Se&Q)!=0){if(h.toc!=null)for(var f=0;f<Ne;f++)h.toc[f]=l[x+f];x+=Ne}h.vbrScale=-1,(Se&me)!=0&&(h.vbrScale=k(l,x),x+=4),h.headersize=(E+1)*72e3*j/h.samprate,x+=21;var S=l[x+0]<<4;S+=l[x+1]>>4;var fe=(l[x+1]&15)<<8;return fe+=l[x+2]&255,(S<0||S>3e3)&&(S=-1),(fe<0||fe>3e3)&&(fe=-1),h.encDelay=S,h.encPadding=fe,h},this.InitVbrTag=function(l){var h=l.internal_flags,x;l.version==1?x=he:l.out_samplerate<16e3?x=K:x=M,l.VBR==v0.vbr_off&&(x=l.brate);var E=(l.version+1)*72e3*x/l.out_samplerate,X=h.sideinfo_len+de;if(h.VBR_seek_table.TotalFrameSize=E,E<X||E>ke){l.bWriteVbrTag=!1;return}h.VBR_seek_table.nVbrNumFrames=0,h.VBR_seek_table.nBytesWritten=0,h.VBR_seek_table.sum=0,h.VBR_seek_table.seen=0,h.VBR_seek_table.want=1,h.VBR_seek_table.pos=0,h.VBR_seek_table.bag==null&&(h.VBR_seek_table.bag=new int[400],h.VBR_seek_table.size=400);var U=zo(ke);y(l,U);for(var j=h.VBR_seek_table.TotalFrameSize,Se=0;Se<j;++Se)$.add_dummy_byte(l,U[Se]&255,1)};function u(l,h){var x=h^l;return h=h>>8^O[x&255],h}this.updateMusicCRC=function(l,h,x,E){for(var X=0;X<E;++X)l[0]=u(h[x+X],l[0])};function m(l,h,x,E,X){var U=l.internal_flags,j=0,Se=l.encoder_delay,f=l.encoder_padding,S=100-10*l.VBR_q-l.quality,fe=ie.getLameVeryShortVersion(),_e,Oe=0,Ue,je=[1,5,3,2,4,0,3],ze=0|(l.lowpassfreq/100+.5>255?255:l.lowpassfreq/100+.5),nt=0,Ke=0,Ve=0,xt=l.internal_flags.noise_shaping,Ot=0,Rt=0,Lt=0,jt=0,Kt=0,_r=(l.exp_nspsytune&1)!=0,Ln=(l.exp_nspsytune&2)!=0,Lr=!1,Fr=!1,_n=l.internal_flags.nogap_total,Ii=l.internal_flags.nogap_current,Ci=l.ATHtype,Sn=0,Cr;switch(l.VBR){case vbr_abr:Cr=l.VBR_mean_bitrate_kbps;break;case vbr_off:Cr=l.brate;break;default:Cr=l.VBR_min_bitrate_kbps}switch(l.VBR.ordinal()<je.length?_e=je[l.VBR.ordinal()]:_e=0,Ue=16*Oe+_e,U.findReplayGain&&(U.RadioGain>510&&(U.RadioGain=510),U.RadioGain<-510&&(U.RadioGain=-510),Ke=8192,Ke|=3072,U.RadioGain>=0?Ke|=U.RadioGain:(Ke|=512,Ke|=-U.RadioGain)),U.findPeakSample&&(nt=Math.abs(0|U.PeakSample/32767*Math.pow(2,23)+.5)),_n!=-1&&(Ii>0&&(Fr=!0),Ii<_n-1&&(Lr=!0)),Sn=Ci+((_r?1:0)<<4)+((Ln?1:0)<<5)+((Lr?1:0)<<6)+((Fr?1:0)<<7),S<0&&(S=0),l.mode){case MONO:Ot=0;break;case STEREO:Ot=1;break;case DUAL_CHANNEL:Ot=2;break;case JOINT_STEREO:l.force_ms?Ot=4:Ot=3;break;case NOT_SET:default:Ot=7;break}l.in_samplerate<=32e3?Lt=0:l.in_samplerate==48e3?Lt=2:l.in_samplerate>48e3?Lt=3:Lt=1,(l.short_blocks==Nc.short_block_forced||l.short_blocks==Nc.short_block_dispensed||l.lowpassfreq==-1&&l.highpassfreq==-1||l.scale_left<l.scale_right||l.scale_left>l.scale_right||l.disable_reservoir&&l.brate<320||l.noATH||l.ATHonly||Ci==0||l.in_samplerate<=32e3)&&(Rt=1),jt=xt+(Ot<<2)+(Rt<<5)+(Lt<<6),Kt=U.nMusicCRC,q(x,E+j,S),j+=4;for(var ii=0;ii<9;ii++)x[E+j+ii]=255&fe.charAt(ii);j+=9,x[E+j]=255&Ue,j++,x[E+j]=255&ze,j++,q(x,E+j,nt),j+=4,w(x,E+j,Ke),j+=2,w(x,E+j,Ve),j+=2,x[E+j]=255&Sn,j++,Cr>=255?x[E+j]=255:x[E+j]=255&Cr,j++,x[E+j]=255&Se>>4,x[E+j+1]=255&(Se<<4)+(f>>8),x[E+j+2]=255&f,j+=3,x[E+j]=255&jt,j++,x[E+j++]=0,w(x,E+j,l.preset),j+=2,q(x,E+j,h),j+=4,w(x,E+j,Kt),j+=2;for(var Ka=0;Ka<j;Ka++)X=u(x[E+Ka],X);return w(x,E+j,X),j+=2,j}function b(l){l.seek(0);var h=zo(10);l.readFully(h);var x;return new String(h,"ISO-8859-1").startsWith("ID3")?x=0:x=((h[6]&127)<<21|(h[7]&127)<<14|(h[8]&127)<<7|h[9]&127)+h.length,x}this.getLameTagFrame=function(l,h){var x=l.internal_flags;if(!l.bWriteVbrTag||x.Class_ID!=At.LAME_ID||x.VBR_seek_table.pos<=0)return 0;if(h.length<x.VBR_seek_table.TotalFrameSize)return x.VBR_seek_table.TotalFrameSize;Cd.fill(h,0,x.VBR_seek_table.TotalFrameSize,0),y(l,h);var E=zo(Ne);if(l.free_format)for(var X=1;X<Ne;++X)E[X]=255&255*X/100;else _(x.VBR_seek_table,E);var U=x.sideinfo_len;l.error_protection&&(U-=2),l.VBR==v0.vbr_off?(h[U++]=255&H.charAt(0),h[U++]=255&H.charAt(1),h[U++]=255&H.charAt(2),h[U++]=255&H.charAt(3)):(h[U++]=255&I.charAt(0),h[U++]=255&I.charAt(1),h[U++]=255&I.charAt(2),h[U++]=255&I.charAt(3)),q(h,U,Z+ye+Q+me),U+=4,q(h,U,x.VBR_seek_table.nVbrNumFrames),U+=4;var j=x.VBR_seek_table.nBytesWritten+x.VBR_seek_table.TotalFrameSize;q(h,U,0|j),U+=4,Id.arraycopy(E,0,h,U,E.length),U+=E.length,l.error_protection&&$.CRC_writeheader(x,h);for(var Se=0,X=0;X<U;X++)Se=u(h[X],Se);return U+=m(l,j,h,U,Se),x.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(l,h){var x=l.internal_flags;if(x.VBR_seek_table.pos<=0||(h.seek(h.length()),h.length()==0))return-1;var E=b(h);h.seek(E);var X=zo(ke),U=getLameTagFrame(l,X);return U>X.length?-1:(U<1||h.write(X,0,U),0)}}var Pd=Ga,Dc=P.new_byte,kc=P.assert,At=vd,Bd=pd,Xa=Ir,Nd=ti,Dd=Ed,kd=c0,Od=Rd,nr=ea,Xn=ri;function Ld(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}function Fd(){var C,$,ie;this.setModules=function(Z,ye,Q){C=Z,$=ye,ie=Q}}function Ud(){}function Hd(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}function Vd(C,$,ie){arguments.length!=3&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),C=1,$=44100,ie=128);var Z=new At,ye=new Ld,Q=new Xa,me=new Xn,Ne=new Bd,ke=new Nd,G=new Dd,de=new Pd,he=new Ad,M=new Hd,K=new Od,o=new kd,I=new Fd,H=new Ud;Z.setModules(Q,me,Ne,ke,G,de,he,M,H),me.setModules(Q,H,he,de),M.setModules(me,he),Ne.setModules(Z),G.setModules(me,K,ke,o),ke.setModules(o,K,Z.enc.psy),K.setModules(me),o.setModules(ke),de.setModules(Z,me,he),ye.setModules(I,H),I.setModules(he,M,Ne);var O=Z.lame_init();O.num_channels=C,O.in_samplerate=$,O.brate=ie,O.mode=nr.STEREO,O.quality=3,O.bWriteVbrTag=!1,O.disable_reservoir=!0,O.write_id3tag_automatic=!1;var g=Z.lame_init_params(O);kc(g==0);var _=1152,k=0|1.25*_+7200,q=Dc(k);this.encodeBuffer=function(w,c){C==1&&(c=w),kc(w.length==c.length),w.length>_&&(_=w.length,k=0|1.25*_+7200,q=Dc(k));var L=Z.lame_encode_buffer(O,w,c,w.length,q,0,k);return new Int8Array(q.subarray(0,L))},this.flush=function(){var w=Z.lame_encode_flush(O,q,0,k);return new Int8Array(q.subarray(0,w))}}function On(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function jo(C){return C.charCodeAt(0)<<24|C.charCodeAt(1)<<16|C.charCodeAt(2)<<8|C.charCodeAt(3)}On.RIFF=jo("RIFF"),On.WAVE=jo("WAVE"),On.fmt_=jo("fmt "),On.data=jo("data"),On.readHeader=function(C){var $=new On,ie=C.getUint32(0,!1);if(On.RIFF==ie){var Z=C.getUint32(4,!0);if(On.WAVE==C.getUint32(8,!1)&&On.fmt_==C.getUint32(12,!1)){var ye=C.getUint32(16,!0),Q=16+4;switch(ye){case 16:case 18:$.channels=C.getUint16(Q+2,!0),$.sampleRate=C.getUint32(Q+4,!0);break;default:throw"extended fmt chunk not implemented"}Q+=ye;for(var me=On.data,Ne=0;me!=ie&&(ie=C.getUint32(Q,!1),Ne=C.getUint32(Q+4,!0),me!=ie);)Q+=Ne+8;return $.dataLen=Ne,$.dataOffset=Q+8,$}}};var qd=Vd,Oc=function(C,$){if(!(C instanceof $))throw new TypeError("Cannot call a class as a function")},Lc=function(){function C($,ie){for(var Z=0;Z<ie.length;Z++){var ye=ie[Z];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty($,ye.key,ye)}}return function($,ie,Z){return ie&&C($.prototype,ie),Z&&C($,Z),$}}(),zd=function(){function C($){Oc(this,C),this.config={sampleRate:44100,bitRate:128},Object.assign(this.config,$),this.mp3Encoder=new qd(1,this.config.sampleRate,this.config.bitRate),this.maxSamples=1152,this.samplesMono=null,this.clearBuffer()}return Lc(C,[{key:"clearBuffer",value:function(){this.dataBuffer=[]}},{key:"appendToBuffer",value:function(ie){this.dataBuffer.push(new Int8Array(ie))}},{key:"floatTo16BitPCM",value:function(ie,Z){for(var ye=0;ye<ie.length;ye++){var Q=Math.max(-1,Math.min(1,ie[ye]));Z[ye]=Q<0?Q*32768:Q*32767}}},{key:"convertBuffer",value:function(ie){var Z=new Float32Array(ie),ye=new Int16Array(ie.length);return this.floatTo16BitPCM(Z,ye),ye}},{key:"encode",value:function(ie){this.samplesMono=this.convertBuffer(ie);for(var Z=this.samplesMono.length,ye=0;Z>=0;ye+=this.maxSamples){var Q=this.samplesMono.subarray(ye,ye+this.maxSamples),me=this.mp3Encoder.encodeBuffer(Q);this.appendToBuffer(me),Z-=this.maxSamples}}},{key:"finish",value:function(){return this.appendToBuffer(this.mp3Encoder.flush()),this.dataBuffer}}]),C}(),jd=function(){function C($){Oc(this,C),this.config={bitRate:128,startRecordingAt:300,deviceId:null},this.activeStream=null,this.context=null,this.microphone=null,this.processor=null,this.startTime=0,Object.assign(this.config,$)}return Lc(C,[{key:"addMicrophoneListener",value:function(ie){var Z=this;this.activeStream=ie,this.timerToStart=setTimeout(function(){delete Z.timerToStart},this.config.startRecordingAt),this.microphone=this.context.createMediaStreamSource(ie),this.processor=this.context.createScriptProcessor(0,1,1),this.processor.onaudioprocess=function(ye){Z.timerToStart||Z.lameEncoder.encode(ye.inputBuffer.getChannelData(0))},this.microphone.connect(this.processor),this.processor.connect(this.context.destination)}},{key:"stop",value:function(){return this.processor&&this.microphone&&(this.microphone.disconnect(),this.processor.disconnect(),this.context&&this.context.state!=="closed"&&this.context.close(),this.processor.onaudioprocess=null,this.activeStream.getAudioTracks().forEach(function(ie){return ie.stop()})),this}},{key:"start",value:function(){var ie=this,Z=window.AudioContext||window.webkitAudioContext;this.context=new Z,this.config.sampleRate=this.context.sampleRate,this.lameEncoder=new zd(this.config);var ye=this.config.deviceId?{deviceId:{exact:this.config.deviceId}}:!0;return new Promise(function(Q,me){navigator.mediaDevices.getUserMedia({audio:ye}).then(function(Ne){ie.addMicrophoneListener(Ne),Q(Ne)}).catch(function(Ne){me(Ne)})})}},{key:"getMp3",value:function(){var ie=this,Z=this.lameEncoder.finish();return new Promise(function(ye,Q){Z.length===0?Q(new Error("No buffer to send")):(ye([Z,new Blob(Z,{type:"audio/mp3"})]),ie.lameEncoder.clearBuffer())})}}]),C}();return jd})});async function Ko(){try{let t={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(t)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function Wo(){return new Promise((t,e)=>{typeof PresentationRequest>"u"&&t(!1),new PresentationRequest("receiver.html").getAvailability().then(n=>{let i=n.value;n.addEventListener("change",function(){i=n.value}),setTimeout(()=>{t(i)},1e3)}).catch(n=>e(n))})}async function xn(){let t=await navigator.mediaDevices.enumerateDevices();return{cameras:t.filter(r=>r.kind=="videoinput"&&r.deviceId).map(r=>({label:r.label||"Generic Device",id:r.deviceId})),microphones:t.filter(r=>r.kind=="audioinput"&&r.deviceId).map(r=>({label:r.label||"Generic Device",id:r.deviceId}))}}var Yo=class{constructor(e){this.sessionDuration=0;this.id=e,this.state="Created",this.startedAt=new Date,this.alerts=[],this.recordings=[]}get hasSomethingToUpload(){for(let e of this.recordings)if(!e.upload)return!0;return!1}start(){this.state="Recording",this.startedAt=new Date(Date.now())}pause(){this.state="Paused"}resume(){this.state="Recording"}stop(){this.state="Ended",this.sessionDuration=Date.now()-this.startedAt.getTime()}setEndConfirmed(){this.state="EndConfirmed"}setUploaded(){this.state="Uploaded"}setUploadConfirmed(){this.state="UploadConfirmed"}addAlert(e){this.alerts.push(e)}addRecording(e){this.recordings.push(e)}};function Qa(t,e,r=!1){let n,i={mimeType:"video/webm;codecs=vp9",videoBitsPerSecond:128e3,audioBitsPerSecond:64e3};r&&(i={mimeType:"audio/webm",audioBitsPerSecond:64*1e3});let a=new MediaRecorder(t,i);a.ondataavailable=B=>{B.data.size>0&&e.push(B.data),r&&a.state=="inactive"&&(e=[new Blob(e,{type:"audio/mpeg-3"})]),n&&n()};function s(){return new Promise(B=>{n=B,a.start()})}function v(){return new Promise(B=>{a.state=="recording"?(n=B,a.stop(),t.getTracks().forEach(z=>{z.stop()})):B()})}function d(){return new Promise(B=>{a.state=="recording"&&a.pause(),B()})}function p(){return new Promise(B=>{a.state=="paused"&&a.resume(),B()})}return{startRecording:s,stopRecording:v,pauseRecording:d,resumeRecording:p}}function Ja(t,e){return function(){return t.apply(e,arguments)}}var{toString:$c}=Object.prototype,{getPrototypeOf:w0}=Object,R0=(t=>e=>{let r=$c.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Kn=t=>(t=t.toLowerCase(),e=>R0(e)===t),Zo=t=>e=>typeof e===t,{isArray:eo}=Array,y0=Zo("undefined");function Jd(t){return t!==null&&!y0(t)&&t.constructor!==null&&!y0(t.constructor)&&aa(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var Zc=Kn("ArrayBuffer");function e2(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Zc(t.buffer),e}var t2=Zo("string"),aa=Zo("function"),Qc=Zo("number"),Jc=t=>t!==null&&typeof t=="object",r2=t=>t===!0||t===!1,$o=t=>{if(R0(t)!=="object")return!1;let e=w0(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},n2=Kn("Date"),i2=Kn("File"),a2=Kn("Blob"),o2=Kn("FileList"),s2=t=>Jc(t)&&aa(t.pipe),l2=t=>{let e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||$c.call(t)===e||aa(t.toString)&&t.toString()===e)},c2=Kn("URLSearchParams"),u2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qo(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),eo(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{let a=r?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length,v;for(n=0;n<s;n++)v=a[n],e.call(null,t[v],v,t)}}function E0(){let t={},e=(r,n)=>{$o(t[n])&&$o(r)?t[n]=E0(t[n],r):$o(r)?t[n]=E0({},r):eo(r)?t[n]=r.slice():t[n]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&Qo(arguments[r],e);return t}var f2=(t,e,r,{allOwnKeys:n}={})=>(Qo(e,(i,a)=>{r&&aa(i)?t[a]=Ja(i,r):t[a]=i},{allOwnKeys:n}),t),d2=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),v2=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},m2=(t,e,r,n)=>{let i,a,s,v={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)s=i[a],(!n||n(s,t,e))&&!v[s]&&(e[s]=t[s],v[s]=!0);t=r!==!1&&w0(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},p2=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},h2=t=>{if(!t)return null;if(eo(t))return t;let e=t.length;if(!Qc(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},_2=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&w0(Uint8Array)),S2=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let a=i.value;e.call(t,a[0],a[1])}},g2=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},b2=Kn("HTMLFormElement"),x2=t=>t.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Yc=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),y2=Kn("RegExp"),e1=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};Qo(r,(i,a)=>{e(i,a,t)!==!1&&(n[a]=i)}),Object.defineProperties(t,n)},E2=t=>{e1(t,(e,r)=>{let n=t[r];if(!!aa(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not read-only method '"+r+"'")})}})},w2=(t,e)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return eo(t)?n(t):n(String(t).split(e)),r},R2=()=>{},T2=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ge={isArray:eo,isArrayBuffer:Zc,isBuffer:Jd,isFormData:l2,isArrayBufferView:e2,isString:t2,isNumber:Qc,isBoolean:r2,isObject:Jc,isPlainObject:$o,isUndefined:y0,isDate:n2,isFile:i2,isBlob:a2,isRegExp:y2,isFunction:aa,isStream:s2,isURLSearchParams:c2,isTypedArray:_2,isFileList:o2,forEach:Qo,merge:E0,extend:f2,trim:u2,stripBOM:d2,inherits:v2,toFlatObject:m2,kindOf:R0,kindOfTest:Kn,endsWith:p2,toArray:h2,forEachEntry:S2,matchAll:g2,isHTMLForm:b2,hasOwnProperty:Yc,hasOwnProp:Yc,reduceDescriptors:e1,freezeMethods:E2,toObjectSet:w2,toCamelCase:x2,noop:R2,toFiniteNumber:T2};function oa(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}ge.inherits(oa,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var t1=oa.prototype,r1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{r1[t]={value:t}});Object.defineProperties(oa,r1);Object.defineProperty(t1,"isAxiosError",{value:!0});oa.from=(t,e,r,n,i,a)=>{let s=Object.create(t1);return ge.toFlatObject(t,s,function(d){return d!==Error.prototype},v=>v!=="isAxiosError"),oa.call(s,t.message,e,r,n,i),s.cause=t,s.name=t.name,a&&Object.assign(s,a),s};var wt=oa;var a1=Qd(i1(),1),o1=a1.default;function T0(t){return ge.isPlainObject(t)||ge.isArray(t)}function l1(t){return ge.endsWith(t,"[]")?t.slice(0,-2):t}function s1(t,e,r){return t?t.concat(e).map(function(i,a){return i=l1(i),!r&&a?"["+i+"]":i}).join(r?".":""):e}function A2(t){return ge.isArray(t)&&!t.some(T0)}var I2=ge.toFlatObject(ge,{},null,function(e){return/^is[A-Z]/.test(e)});function C2(t){return t&&ge.isFunction(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator]}function M2(t,e,r){if(!ge.isObject(t))throw new TypeError("target must be an object");e=e||new(o1||FormData),r=ge.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ce,P){return!ge.isUndefined(P[ce])});let n=r.metaTokens,i=r.visitor||B,a=r.dots,s=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&C2(e);if(!ge.isFunction(i))throw new TypeError("visitor must be a function");function p(D){if(D===null)return"";if(ge.isDate(D))return D.toISOString();if(!d&&ge.isBlob(D))throw new wt("Blob is not supported. Use a Buffer instead.");return ge.isArrayBuffer(D)||ge.isTypedArray(D)?d&&typeof Blob=="function"?new Blob([D]):Buffer.from(D):D}function B(D,ce,P){let oe=D;if(D&&!P&&typeof D=="object"){if(ge.endsWith(ce,"{}"))ce=n?ce:ce.slice(0,-2),D=JSON.stringify(D);else if(ge.isArray(D)&&A2(D)||ge.isFileList(D)||ge.endsWith(ce,"[]")&&(oe=ge.toArray(D)))return ce=l1(ce),oe.forEach(function(xe,Ge){!(ge.isUndefined(xe)||xe===null)&&e.append(s===!0?s1([ce],Ge,a):s===null?ce:ce+"[]",p(xe))}),!1}return T0(D)?!0:(e.append(s1(P,ce,a),p(D)),!1)}let z=[],ee=Object.assign(I2,{defaultVisitor:B,convertValue:p,isVisitable:T0});function te(D,ce){if(!ge.isUndefined(D)){if(z.indexOf(D)!==-1)throw Error("Circular reference detected in "+ce.join("."));z.push(D),ge.forEach(D,function(oe,se){(!(ge.isUndefined(oe)||oe===null)&&i.call(e,oe,ge.isString(se)?se.trim():se,ce,ee))===!0&&te(oe,ce?ce.concat(se):[se])}),z.pop()}}if(!ge.isObject(t))throw new TypeError("data must be an object");return te(t),e}var oi=M2;function c1(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function u1(t,e){this._pairs=[],t&&oi(t,this,e)}var f1=u1.prototype;f1.append=function(e,r){this._pairs.push([e,r])};f1.toString=function(e){let r=e?function(n){return e.call(this,n,c1)}:c1;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var Jo=u1;function P2(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function to(t,e,r){if(!e)return t;let n=r&&r.encode||P2,i=r&&r.serialize,a;if(i?a=i(e,r):a=ge.isURLSearchParams(e)?e.toString():new Jo(e,r).toString(n),a){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}var A0=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ge.forEach(this.handlers,function(n){n!==null&&e(n)})}},I0=A0;var es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var d1=typeof URLSearchParams<"u"?URLSearchParams:Jo;var v1=FormData;var B2=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Mr={isBrowser:!0,classes:{URLSearchParams:d1,FormData:v1,Blob},isStandardBrowserEnv:B2,protocols:["http","https","file","blob","url","data"]};function C0(t,e){return oi(t,new Mr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Mr.isNode&&ge.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function N2(t){return ge.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function D2(t){let e={},r=Object.keys(t),n,i=r.length,a;for(n=0;n<i;n++)a=r[n],e[a]=t[a];return e}function k2(t){function e(r,n,i,a){let s=r[a++],v=Number.isFinite(+s),d=a>=r.length;return s=!s&&ge.isArray(i)?i.length:s,d?(ge.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!v):((!i[s]||!ge.isObject(i[s]))&&(i[s]=[]),e(r,n,i[s],a)&&ge.isArray(i[s])&&(i[s]=D2(i[s])),!v)}if(ge.isFormData(t)&&ge.isFunction(t.entries)){let r={};return ge.forEachEntry(t,(n,i)=>{e(N2(n),i,r,0)}),r}return null}var ts=k2;function M0(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new wt("Request failed with status code "+r.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var m1=Mr.isStandardBrowserEnv?function(){return{write:function(r,n,i,a,s,v){let d=[];d.push(r+"="+encodeURIComponent(n)),ge.isNumber(i)&&d.push("expires="+new Date(i).toGMTString()),ge.isString(a)&&d.push("path="+a),ge.isString(s)&&d.push("domain="+s),v===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(r){let n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function P0(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function B0(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function ro(t,e){return t&&!P0(e)?B0(t,e):e}var p1=Mr.isStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function i(a){let s=a;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(s){let v=ge.isString(s)?i(s):s;return v.protocol===n.protocol&&v.host===n.host}}():function(){return function(){return!0}}();function h1(t,e,r){wt.call(this,t??"canceled",wt.ERR_CANCELED,e,r),this.name="CanceledError"}ge.inherits(h1,wt,{__CANCEL__:!0});var si=h1;function N0(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var O2=ge.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_1=t=>{let e={},r,n,i;return t&&t.split(`
15
- `).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||e[r]&&O2[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e};var S1=Symbol("internals"),b1=Symbol("defaults");function io(t){return t&&String(t).trim().toLowerCase()}function rs(t){return t===!1||t==null?t:ge.isArray(t)?t.map(rs):String(t)}function L2(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}function g1(t,e,r,n){if(ge.isFunction(n))return n.call(this,e,r);if(!!ge.isString(e)){if(ge.isString(n))return e.indexOf(n)!==-1;if(ge.isRegExp(n))return n.test(e)}}function F2(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function U2(t,e){let r=ge.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,a,s){return this[n].call(this,e,i,a,s)},configurable:!0})})}function no(t,e){e=e.toLowerCase();let r=Object.keys(t),n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}function sa(t,e){t&&this.set(t),this[b1]=e||null}Object.assign(sa.prototype,{set:function(t,e,r){let n=this;function i(a,s,v){let d=io(s);if(!d)throw new Error("header name must be a non-empty string");let p=no(n,d);p&&v!==!0&&(n[p]===!1||v===!1)||(n[p||s]=rs(a))}return ge.isPlainObject(t)?ge.forEach(t,(a,s)=>{i(a,s,e)}):i(e,t,r),this},get:function(t,e){if(t=io(t),!t)return;let r=no(this,t);if(r){let n=this[r];if(!e)return n;if(e===!0)return L2(n);if(ge.isFunction(e))return e.call(this,n,r);if(ge.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}},has:function(t,e){if(t=io(t),t){let r=no(this,t);return!!(r&&(!e||g1(this,this[r],r,e)))}return!1},delete:function(t,e){let r=this,n=!1;function i(a){if(a=io(a),a){let s=no(r,a);s&&(!e||g1(r,r[s],s,e))&&(delete r[s],n=!0)}}return ge.isArray(t)?t.forEach(i):i(t),n},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(t){let e=this,r={};return ge.forEach(this,(n,i)=>{let a=no(r,i);if(a){e[a]=rs(n),delete e[i];return}let s=t?F2(i):String(i).trim();s!==i&&delete e[i],e[s]=rs(n),r[s]=!0}),this},toJSON:function(t){let e=Object.create(null);return ge.forEach(Object.assign({},this[b1]||null,this),(r,n)=>{r==null||r===!1||(e[n]=t&&ge.isArray(r)?r.join(", "):r)}),e}});Object.assign(sa,{from:function(t){return ge.isString(t)?new this(_1(t)):t instanceof this?t:new this(t)},accessor:function(t){let r=(this[S1]=this[S1]={accessors:{}}).accessors,n=this.prototype;function i(a){let s=io(a);r[s]||(U2(n,a),r[s]=!0)}return ge.isArray(t)?t.forEach(i):i(t),this}});sa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);ge.freezeMethods(sa.prototype);ge.freezeMethods(sa);var yn=sa;function H2(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,a=0,s;return e=e!==void 0?e:1e3,function(d){let p=Date.now(),B=n[a];s||(s=p),r[i]=d,n[i]=p;let z=a,ee=0;for(;z!==i;)ee+=r[z++],z=z%t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),p-s<e)return;let te=B&&p-B;return te?Math.round(ee*1e3/te):void 0}}var x1=H2;function y1(t,e){let r=0,n=x1(50,250);return i=>{let a=i.loaded,s=i.lengthComputable?i.total:void 0,v=a-r,d=n(v),p=a<=s;r=a;let B={loaded:a,total:s,progress:s?a/s:void 0,bytes:v,rate:d||void 0,estimated:d&&s&&p?(s-a)/d:void 0};B[e?"download":"upload"]=!0,t(B)}}function ao(t){return new Promise(function(r,n){let i=t.data,a=yn.from(t.headers).normalize(),s=t.responseType,v;function d(){t.cancelToken&&t.cancelToken.unsubscribe(v),t.signal&&t.signal.removeEventListener("abort",v)}ge.isFormData(i)&&Mr.isStandardBrowserEnv&&a.setContentType(!1);let p=new XMLHttpRequest;if(t.auth){let te=t.auth.username||"",D=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(te+":"+D))}let B=ro(t.baseURL,t.url);p.open(t.method.toUpperCase(),to(B,t.params,t.paramsSerializer),!0),p.timeout=t.timeout;function z(){if(!p)return;let te=yn.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),ce={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:te,config:t,request:p};M0(function(oe){r(oe),d()},function(oe){n(oe),d()},ce),p=null}if("onloadend"in p?p.onloadend=z:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(z)},p.onabort=function(){!p||(n(new wt("Request aborted",wt.ECONNABORTED,t,p)),p=null)},p.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let D=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",ce=t.transitional||es;t.timeoutErrorMessage&&(D=t.timeoutErrorMessage),n(new wt(D,ce.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,t,p)),p=null},Mr.isStandardBrowserEnv){let te=(t.withCredentials||p1(B))&&t.xsrfCookieName&&m1.read(t.xsrfCookieName);te&&a.set(t.xsrfHeaderName,te)}i===void 0&&a.setContentType(null),"setRequestHeader"in p&&ge.forEach(a.toJSON(),function(D,ce){p.setRequestHeader(ce,D)}),ge.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),s&&s!=="json"&&(p.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&p.addEventListener("progress",y1(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",y1(t.onUploadProgress)),(t.cancelToken||t.signal)&&(v=te=>{!p||(n(!te||te.type?new si(null,t,p):te),p.abort(),p=null)},t.cancelToken&&t.cancelToken.subscribe(v),t.signal&&(t.signal.aborted?v():t.signal.addEventListener("abort",v)));let ee=N0(B);if(ee&&Mr.protocols.indexOf(ee)===-1){n(new wt("Unsupported protocol "+ee+":",wt.ERR_BAD_REQUEST,t));return}p.send(i||null)})}var E1={http:ao,xhr:ao},D0={getAdapter:t=>{if(ge.isString(t)){let e=E1[t];if(!t)throw Error(ge.hasOwnProp(t)?`Adapter '${t}' is not available in the build`:`Can not resolve adapter '${t}'`);return e}if(!ge.isFunction(t))throw new TypeError("adapter is not a function");return t},adapters:E1};var V2={"Content-Type":"application/x-www-form-urlencoded"};function q2(){let t;return typeof XMLHttpRequest<"u"?t=D0.getAdapter("xhr"):typeof process<"u"&&ge.kindOf(process)==="process"&&(t=D0.getAdapter("http")),t}function z2(t,e,r){if(ge.isString(t))try{return(e||JSON.parse)(t),ge.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var ns={transitional:es,adapter:q2(),transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=ge.isObject(e);if(a&&ge.isHTMLForm(e)&&(e=new FormData(e)),ge.isFormData(e))return i&&i?JSON.stringify(ts(e)):e;if(ge.isArrayBuffer(e)||ge.isBuffer(e)||ge.isStream(e)||ge.isFile(e)||ge.isBlob(e))return e;if(ge.isArrayBufferView(e))return e.buffer;if(ge.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let v;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return C0(e,this.formSerializer).toString();if((v=ge.isFileList(e))||n.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return oi(v?{"files[]":e}:e,d&&new d,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),z2(e)):e}],transformResponse:[function(e){let r=this.transitional||ns.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&ge.isString(e)&&(n&&!this.responseType||i)){let s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(v){if(s)throw v.name==="SyntaxError"?wt.from(v,wt.ERR_BAD_RESPONSE,this,null,this.response):v}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mr.classes.FormData,Blob:Mr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ge.forEach(["delete","get","head"],function(e){ns.headers[e]={}});ge.forEach(["post","put","patch"],function(e){ns.headers[e]=ge.merge(V2)});var la=ns;function oo(t,e){let r=this||la,n=e||r,i=yn.from(n.headers),a=n.data;return ge.forEach(t,function(v){a=v.call(r,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function so(t){return!!(t&&t.__CANCEL__)}function k0(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new si}function is(t){return k0(t),t.headers=yn.from(t.headers),t.data=oo.call(t,t.transformRequest),(t.adapter||la.adapter)(t).then(function(n){return k0(t),n.data=oo.call(t,t.transformResponse,n),n.headers=yn.from(n.headers),n},function(n){return so(n)||(k0(t),n&&n.response&&(n.response.data=oo.call(t,t.transformResponse,n.response),n.response.headers=yn.from(n.response.headers))),Promise.reject(n)})}function li(t,e){e=e||{};let r={};function n(p,B){return ge.isPlainObject(p)&&ge.isPlainObject(B)?ge.merge(p,B):ge.isPlainObject(B)?ge.merge({},B):ge.isArray(B)?B.slice():B}function i(p){if(ge.isUndefined(e[p])){if(!ge.isUndefined(t[p]))return n(void 0,t[p])}else return n(t[p],e[p])}function a(p){if(!ge.isUndefined(e[p]))return n(void 0,e[p])}function s(p){if(ge.isUndefined(e[p])){if(!ge.isUndefined(t[p]))return n(void 0,t[p])}else return n(void 0,e[p])}function v(p){if(p in e)return n(t[p],e[p]);if(p in t)return n(void 0,t[p])}let d={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:v};return ge.forEach(Object.keys(t).concat(Object.keys(e)),function(B){let z=d[B]||i,ee=z(B);ge.isUndefined(ee)&&z!==v||(r[B]=ee)}),r}var as="1.1.3";var O0={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{O0[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var w1={};O0.transitional=function(e,r,n){function i(a,s){return"[Axios v"+as+"] Transitional option '"+a+"'"+s+(n?". "+n:"")}return(a,s,v)=>{if(e===!1)throw new wt(i(s," has been removed"+(r?" in "+r:"")),wt.ERR_DEPRECATED);return r&&!w1[s]&&(w1[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,s,v):!0}};function j2(t,e,r){if(typeof t!="object")throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let a=n[i],s=e[a];if(s){let v=t[a],d=v===void 0||s(v,a,t);if(d!==!0)throw new wt("option "+a+" must be "+d,wt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new wt("Unknown option "+a,wt.ERR_BAD_OPTION)}}var os={assertOptions:j2,validators:O0};var ci=os.validators,ca=class{constructor(e){this.defaults=e,this.interceptors={request:new I0,response:new I0}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=li(this.defaults,r);let{transitional:n,paramsSerializer:i}=r;n!==void 0&&os.assertOptions(n,{silentJSONParsing:ci.transitional(ci.boolean),forcedJSONParsing:ci.transitional(ci.boolean),clarifyTimeoutError:ci.transitional(ci.boolean)},!1),i!==void 0&&os.assertOptions(i,{encode:ci.function,serialize:ci.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=r.headers&&ge.merge(r.headers.common,r.headers[r.method]);a&&ge.forEach(["delete","get","head","post","put","patch","common"],function(D){delete r.headers[D]}),r.headers=new yn(r.headers,a);let s=[],v=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(r)===!1||(v=v&&D.synchronous,s.unshift(D.fulfilled,D.rejected))});let d=[];this.interceptors.response.forEach(function(D){d.push(D.fulfilled,D.rejected)});let p,B=0,z;if(!v){let te=[is.bind(this),void 0];for(te.unshift.apply(te,s),te.push.apply(te,d),z=te.length,p=Promise.resolve(r);B<z;)p=p.then(te[B++],te[B++]);return p}z=s.length;let ee=r;for(B=0;B<z;){let te=s[B++],D=s[B++];try{ee=te(ee)}catch(ce){D.call(this,ce);break}}try{p=is.call(this,ee)}catch(te){return Promise.reject(te)}for(B=0,z=d.length;B<z;)p=p.then(d[B++],d[B++]);return p}getUri(e){e=li(this.defaults,e);let r=ro(e.baseURL,e.url);return to(r,e.params,e.paramsSerializer)}};ge.forEach(["delete","get","head","options"],function(e){ca.prototype[e]=function(r,n){return this.request(li(n||{},{method:e,url:r,data:(n||{}).data}))}});ge.forEach(["post","put","patch"],function(e){function r(n){return function(a,s,v){return this.request(li(v||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}ca.prototype[e]=r(),ca.prototype[e+"Form"]=r(!0)});var lo=ca;var co=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});let n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a,s=new Promise(v=>{n.subscribe(v),a=v}).then(i);return s.cancel=function(){n.unsubscribe(a)},s},e(function(a,s,v){n.reason||(n.reason=new si(a,s,v),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new co(function(i){e=i}),cancel:e}}},R1=co;function L0(t){return function(r){return t.apply(null,r)}}function F0(t){return ge.isObject(t)&&t.isAxiosError===!0}function T1(t){let e=new lo(t),r=Ja(lo.prototype.request,e);return ge.extend(r,lo.prototype,e,{allOwnKeys:!0}),ge.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return T1(li(t,i))},r}var Vr=T1(la);Vr.Axios=lo;Vr.CanceledError=si;Vr.CancelToken=R1;Vr.isCancel=so;Vr.VERSION=as;Vr.toFormData=oi;Vr.AxiosError=wt;Vr.Cancel=Vr.CanceledError;Vr.all=function(e){return Promise.all(e)};Vr.spread=L0;Vr.isAxiosError=F0;Vr.formToJSON=t=>ts(ge.isHTMLForm(t)?new FormData(t):t);var U0=Vr;var{Axios:f_,AxiosError:d_,CanceledError:v_,isCancel:m_,CancelToken:p_,VERSION:h_,all:__,Cancel:S_,isAxiosError:g_,spread:b_,toFormData:x_}=U0,ua=U0;var A1={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5};var En="function",qr="object",wn="undefined",Gt="prototype",uo="hasOwnProperty";var Yr=Object,fa=Yr[Gt],da=Yr.assign,ss=Yr.create,ls=Yr.defineProperty,ui=fa[uo];var va=null;function cn(t){return t===void 0&&(t=!0),(!va||!t)&&(typeof globalThis!==wn&&globalThis&&(va=globalThis),typeof self!==wn&&self&&(va=self),typeof window!==wn&&window&&(va=window),typeof global!==wn&&global&&(va=global)),va}function ma(t){throw new TypeError(t)}function pa(t){var e=ss;if(e)return e(t);if(t==null)return{};var r=typeof t;r!==qr&&r!==En&&ma("Object prototype may only be an Object:"+t);function n(){}return n[Gt]=t,new n}var C_=(cn()||{}).Symbol,M_=(cn()||{}).Reflect;var X2=function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)fa[uo].call(e,i)&&(t[i]=e[i])}return t},Qt=da||X2,H0=function(t,e){return H0=Yr.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n[uo](i)&&(r[i]=n[i])},H0(t,e)};function ut(t,e){typeof e!==En&&e!==null&&ma("Class extends value "+String(e)+" is not a constructor or null"),H0(t,e);function r(){this.constructor=t}t[Gt]=e===null?pa(e):(r[Gt]=e[Gt],new r)}function cs(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t}var us="constructor",Wn="prototype",fs="function",ds="_dynInstFuncs",z0="_isDynProxy",ha="_dynClass",K2="_dynCls$",j0="_dynInstChk",fo=j0,P1="_dfOpts",I1="_unknown_",W2="__proto__",V0="useBaseInst",C1="setInstFuncs",ps=Object,vo=ps.getPrototypeOf,M1=0;function fi(t,e){return t&&ps[Wn].hasOwnProperty.call(t,e)}function B1(t){return t&&(t===ps[Wn]||t===Array[Wn])}function G0(t){return B1(t)||t===Function[Wn]}function Bi(t){if(t){if(vo)return vo(t);var e=t[W2]||t[Wn]||(t[us]?t[us][Wn]:null);if(e)return e}return null}function vs(t,e){var r=[],n=ps.getOwnPropertyNames;if(n)r=n(t);else for(var i in t)typeof i=="string"&&fi(t,i)&&r.push(i);if(r&&r.length>0)for(var a=0;a<r.length;a++)e(r[a])}function X0(t,e,r){return e!==us&&typeof t[e]===fs&&(r||fi(t,e))}function ms(t){throw new TypeError("DynamicProto: "+t)}function Y2(t){var e={};return vs(t,function(r){!e[r]&&X0(t,r,!1)&&(e[r]=t[r])}),e}function K0(t,e){for(var r=t.length-1;r>=0;r--)if(t[r]===e)return!0;return!1}function $2(t,e,r,n){function i(d,p,B){var z=p[B];if(z[z0]&&n){var ee=d[ds]||{};ee[fo]!==!1&&(z=(ee[p[ha]]||{})[B]||z)}return function(){return z.apply(d,arguments)}}var a={};vs(r,function(d){a[d]=i(e,r,d)});for(var s=Bi(t),v=[];s&&!G0(s)&&!K0(v,s);)vs(s,function(d){!a[d]&&X0(s,d,!vo)&&(a[d]=i(e,s,d))}),v.push(s),s=Bi(s);return a}function Z2(t,e,r,n){var i=null;if(t&&fi(r,ha)){var a=t[ds]||{};if(i=(a[r[ha]]||{})[e],i||ms("Missing ["+e+"] "+fs),!i[j0]&&a[fo]!==!1){for(var s=!fi(t,e),v=Bi(t),d=[];s&&v&&!G0(v)&&!K0(d,v);){var p=v[e];if(p){s=p===n;break}d.push(v),v=Bi(v)}try{s&&(t[e]=i),i[j0]=1}catch{a[fo]=!1}}}return i}function Q2(t,e,r){var n=e[t];return n===r&&(n=Bi(e)[t]),typeof n!==fs&&ms("["+t+"] is not a "+fs),n}function J2(t,e,r,n,i){function a(d,p){var B=function(){var z=Z2(this,p,d,B)||Q2(p,d,B);return z.apply(this,arguments)};return B[z0]=1,B}if(!B1(t)){var s=r[ds]=r[ds]||{},v=s[e]=s[e]||{};s[fo]!==!1&&(s[fo]=!!i),vs(r,function(d){X0(r,d,!1)&&r[d]!==n[d]&&(v[d]=r[d],delete r[d],(!fi(t,d)||t[d]&&!t[d][z0])&&(t[d]=a(t,d)))})}}function ev(t,e){if(vo)for(var r=[],n=Bi(e);n&&!G0(n)&&!K0(r,n);){if(n===t)return!0;r.push(n),n=Bi(n)}return!1}function q0(t,e){return fi(t,Wn)?t.name||e||I1:((t||{})[us]||{}).name||e||I1}function W0(t,e,r,n){fi(t,Wn)||ms("theClass is an invalid class definition.");var i=t[Wn];ev(i,e)||ms("["+q0(t)+"] is not in class hierarchy of ["+q0(e)+"]");var a=null;fi(i,ha)?a=i[ha]:(a=K2+q0(t,"_")+"$"+M1,M1++,i[ha]=a);var s=W0[P1],v=!!s[V0];v&&n&&n[V0]!==void 0&&(v=!!n[V0]);var d=Y2(e),p=$2(i,e,d,v);r(e,p);var B=!!vo&&!!s[C1];B&&n&&(B=!!n[C1]),J2(i,a,e,d,B!==!1)}var tv={setInstFuncs:!0,useBaseInst:!0};W0[P1]=tv;var gt=W0;var Pe;(function(t){t[t.CRITICAL=1]="CRITICAL",t[t.WARNING=2]="WARNING"})(Pe||(Pe={}));var we={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105};var rv="on",N1="attachEvent",D1="addEventListener";var q1="toISOString",z1="endsWith",nv="startsWith",k1="indexOf",O1="map",L1="reduce",$0="trim",j1="toString",iv="__proto__",av="constructor",F1=ls,e3=Yr.freeze,t3=Yr.seal,U1=Yr.keys,Z0=String[Gt],ov=Z0[$0],sv=Z0[z1],r3=Z0[nv],lv=Date[Gt],cv=lv[q1],uv=Array.isArray,G1=fa[j1],fv=ui[j1],n3=fv.call(Yr),dv=/-([a-z])/g,vv=/([^\w\d_$])/g,mv=/^(\d+[\w\d_$])/,H1=Object.getPrototypeOf;function X1(t){if(t){if(H1)return H1(t);var e=t[iv]||t[Gt]||t[av];if(e)return e}return null}function Wt(t){return t===void 0||typeof t===wn}function De(t){return t===null||Wt(t)}function Q0(t){return!De(t)}function mo(t,e){return!!(t&&ui.call(t,e))}function Rn(t){return!!(t&&typeof t===qr)}function at(t){return!!(t&&typeof t===En)}function Tn(t,e,r,n){n===void 0&&(n=!1);var i=!1;if(!De(t))try{De(t[D1])?De(t[N1])||(t[N1](rv+e,r),i=!0):(t[D1](e,r,n),i=!0)}catch{}return i}function J0(t){var e=t;return e&&et(e)&&(e=e.replace(dv,function(r,n){return n.toUpperCase()}),e=e.replace(vv,"_"),e=e.replace(mv,function(r,n){return"_"+n})),e}function Tt(t,e){if(t)for(var r in t)ui.call(t,r)&&e.call(t,r,t[r])}function el(t,e){var r=!1;return t&&e&&!(r=t===e)&&(r=sv?t[z1](e):pv(t,e)),r}function pv(t,e){var r=!1,n=e?e.length:0,i=t?t.length:0;if(n&&i&&i>=n&&!(r=t===e)){for(var a=i-1,s=n-1;s>=0;s--){if(t[a]!=e[s])return!1;a--}r=!0}return r}function cr(t,e){return t&&e?t.indexOf(e)!==-1:!1}var ur=uv||hv;function hv(t){return!!(t&&G1.call(t)==="[object Array]")}function _a(t){return!!(t&&G1.call(t)==="[object Error]")}function et(t){return typeof t=="string"}function Sa(t){return typeof t=="number"}function Pr(t){if(t)return cv?t[q1]():_v(t)}function _v(t){if(t&&t.getUTCFullYear){var e=function(r){var n=String(r);return n.length===1&&(n="0"+n),n};return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}function tt(t,e,r){var n=t.length;try{for(var i=0;i<n&&!(i in t&&e.call(r||t,t[i],i,t)===-1);i++);}catch{}}function Un(t,e,r){if(t){if(t[k1])return t[k1](e,r);var n=t.length,i=r||0;try{for(var a=Math.max(i>=0?i:n-Math.abs(i),0);a<n;a++)if(a in t&&t[a]===e)return a}catch{}}return-1}function Ni(t,e,r){var n;if(t){if(t[O1])return t[O1](e,r);var i=t.length,a=r||t;n=new Array(i);try{for(var s=0;s<i;s++)s in t&&(n[s]=e.call(a,t[s],t))}catch{}}return n}function hs(t,e,r){var n;if(t){if(t[L1])return t[L1](e,r);var i=t.length,a=0;if(arguments.length>=3)n=arguments[2];else{for(;a<i&&!(a in t);)a++;n=t[a++]}for(;a<i;)a in t&&(n=e(n,t[a],a,t)),a++}return n}function Jt(t){return t&&(t=ov&&t[$0]?t[$0]():t.replace?t.replace(/^\s+|\s+$/g,""):t),t}var V1=!{toString:null}.propertyIsEnumerable("toString"),Y0=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function un(t){var e=typeof t;if(e!==En&&(e!==qr||t===null)&&ma("objKeys called on non-object"),!V1&&U1)return U1(t);var r=[];for(var n in t)t&&ui.call(t,n)&&r.push(n);if(V1)for(var i=Y0.length,a=0;a<i;a++)t&&ui.call(t,Y0[a])&&r.push(Y0[a]);return r}function di(t,e,r,n){if(F1)try{var i={enumerable:!0,configurable:!0};return r&&(i.get=r),n&&(i.set=n),F1(t,e,i),!0}catch{}return!1}function fr(){var t=Date;return t.now?t.now():new t().getTime()}function _t(t){return _a(t)?t.name:""}function ht(t,e,r,n,i){var a=r;return t&&(a=t[e],a!==r&&(!i||i(a))&&(!n||n(r))&&(a=r,t[e]=a)),a}function dr(t,e,r){var n;return t?(n=t[e],!n&&De(n)&&(n=Wt(r)?{}:r,t[e]=n)):n=Wt(r)?{}:r,n}function _s(t){return!t}function ga(t){return!!t}function wr(t){throw new Error(t)}function tl(t,e,r){if(t&&e&&t!==e&&Rn(t)&&Rn(e)){var n=function(a){if(et(a)){var s=e[a];at(s)?(!r||r(a,!0,e,t))&&(t[a]=function(v){return function(){var d=arguments;return e[v].apply(e,d)}}(a)):(!r||r(a,!1,e,t))&&(mo(t,a)&&delete t[a],di(t,a,function(){return e[a]},function(v){e[a]=v})||(t[a]=s))}};for(var i in e)n(i)}return t}function rl(t){return function(){function e(){var r=this;t&&Tt(t,function(n,i){r[n]=i})}return e}()}function Ss(t){return t&&da&&(t=Yr(da({},t))),t}var K1="window",Sv="document",gv="documentMode",bv="navigator",xv="history",yv="location",Ev="console",wv="performance",W1="JSON",Rv="crypto",Tv="msCrypto",Av="ReactNative",ol="msie",sl="trident/",nl=null,il=null,Iv=!1,ba=null,al=null;function Y1(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[Gt];n&&(r=e in n)}}catch{}if(!r)try{var i=new t;r=!Wt(i[e])}catch{}}return r}function er(t){var e=cn();return e&&e[t]?e[t]:t===K1&&Di()?window:null}function Di(){return Boolean(typeof window===qr&&window)}function Hn(){return Di()?window:er(K1)}function gs(){return Boolean(typeof document===qr&&document)}function ir(){return gs()?document:er(Sv)}function ll(){return Boolean(typeof navigator===qr&&navigator)}function Rr(){return ll()?navigator:er(bv)}function $1(){return Boolean(typeof history===qr&&history)}function cl(){return $1()?history:er(xv)}function $r(t){if(t&&Iv){var e=er("__mockLocation");if(e)return e}return typeof location===qr&&location?location:er(yv)}function ul(){return typeof console!==wn?console:er(Ev)}function Zr(){return er(wv)}function An(){return Boolean(typeof JSON===qr&&JSON||er(W1)!==null)}function vr(){return An()?JSON||er(W1):null}function fl(){return er(Rv)}function dl(){return er(Tv)}function vl(){var t=Rr();return t&&t.product?t.product===Av:!1}function ki(){var t=Rr();if(t&&(t.userAgent!==il||nl===null)){il=t.userAgent;var e=(il||"").toLowerCase();nl=cr(e,ol)||cr(e,sl)}return nl}function xa(t){if(t===void 0&&(t=null),!t){var e=Rr()||{};t=e?(e.userAgent||"").toLowerCase():""}var r=(t||"").toLowerCase();if(cr(r,ol)){var n=ir()||{};return Math.max(parseInt(r.split(ol)[1]),n[gv]||0)}else if(cr(r,sl)){var i=parseInt(r.split(sl)[1]);if(i)return i+4}return null}function it(t){var e=Object[Gt].toString.call(t),r="";return e==="[object Error]"?r="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t.name+"'":An()&&(r=vr().stringify(t)),e+r}function Oi(){return al===null&&(al=ll()&&Boolean(Rr().sendBeacon)),al}function bs(t){var e=!1;try{var r=er("fetch");e=!!r;var n=er("Request");e&&t&&n&&(e=Y1(n,"keepalive"))}catch{}return e}function xs(){return ba===null&&(ba=typeof XDomainRequest<"u",ba&&Li()&&(ba=ba&&!Y1(er("XMLHttpRequest"),"withCredentials"))),ba}function Li(){var t=!1;try{var e=er("XMLHttpRequest");t=!!e}catch{}return t}var ml=["eventsSent","eventsDiscarded","eventsSendRequest","perfEvent"],Es=null,ys;function Cv(t,e){return function(){var r=arguments,n=pl(e);if(n){var i=n.listener;i&&i[t]&&i[t].apply(i,r)}}}function Mv(){var t=er("Microsoft");return t&&(Es=t.ApplicationInsights),Es}function pl(t){var e=Es;return!e&&t.disableDbgExt!==!0&&(e=Es||Mv()),e?e.ChromeDbgExt:null}function Z1(t){if(!ys){ys={};for(var e=0;e<ml.length;e++)ys[ml[e]]=Cv(ml[e],t)}return ys}var Pv="AI (Internal): ",Bv="AI: ",Nv="AITR_",Dv="errorToConsole",kv="warnToConsole";function Q1(t){return t?'"'+t.replace(/\"/g,"")+'"':""}function J1(t,e){var r=ul();if(r){var n="log";r[t]&&(n=t),at(r[n])&&r[n](e)}}var Yn=function(){function t(e,r,n,i){n===void 0&&(n=!1);var a=this;a.messageId=e,a.message=(n?Bv:Pv)+e;var s="";An()&&(s=vr().stringify(i));var v=(r?" message:"+Q1(r):"")+(i?" props:"+Q1(s):"");a.message+=v}return t.dataType="MessageData",t}();function $n(t,e){return(t||{}).logger||new ya(e)}var ya=function(){function t(e){this.identifier="DiagnosticLogger",this.queue=[];var r=0,n={};gt(t,this,function(i){De(e)&&(e={}),i.consoleLoggingLevel=function(){return a("loggingLevelConsole",0)},i.telemetryLoggingLevel=function(){return a("loggingLevelTelemetry",1)},i.maxInternalMessageLimit=function(){return a("maxMessageLimit",25)},i.enableDebugExceptions=function(){return a("enableDebugExceptions",!1)},i.throwInternal=function(d,p,B,z,ee){ee===void 0&&(ee=!1);var te=new Yn(p,B,ee,z);if(i.enableDebugExceptions())throw te;var D=d===Pe.CRITICAL?Dv:kv;if(Wt(te.message))v("throw"+(d===Pe.CRITICAL?"Critical":"Warning"),te);else{var ce=i.consoleLoggingLevel();if(ee){var P=+te.messageId;!n[P]&&ce>=d&&(i[D](te.message),n[P]=!0)}else ce>=d&&i[D](te.message);i.logInternalMessage(d,te)}},i.warnToConsole=function(d){J1("warn",d),v("warning",d)},i.errorToConsole=function(d){J1("error",d),v("error",d)},i.resetInternalMessageCount=function(){r=0,n={}},i.logInternalMessage=function(d,p){if(!s()){var B=!0,z=Nv+p.messageId;if(n[z]?B=!1:n[z]=!0,B&&(d<=i.telemetryLoggingLevel()&&(i.queue.push(p),r++,v(d===Pe.CRITICAL?"error":"warn",p)),r===i.maxInternalMessageLimit())){var ee="Internal events throttle limit per PageView reached for this app.",te=new Yn(we.MessageLimitPerPVExceeded,ee,!1);i.queue.push(te),d===Pe.CRITICAL?i.errorToConsole(ee):i.warnToConsole(ee)}}};function a(d,p){var B=e[d];return De(B)?p:B}function s(){return r>=i.maxInternalMessageLimit()}function v(d,p){var B=pl(e);B&&B.diagLog&&B.diagLog(d,p)}})}return t}();var Ea="ctx",Ov=null,po=function(){function t(e,r,n){var i=this,a=!1;if(i.start=fr(),i.name=e,i.isAsync=n,i.isChildEvt=function(){return!1},at(r)){var s;a=di(i,"payload",function(){return!s&&at(r)&&(s=r(),r=null),s})}i.getCtx=function(v){return v?v===t.ParentContextKey||v===t.ChildrenContextKey?i[v]:(i[Ea]||{})[v]:null},i.setCtx=function(v,d){if(v)if(v===t.ParentContextKey)i[v]||(i.isChildEvt=function(){return!0}),i[v]=d;else if(v===t.ChildrenContextKey)i[v]=d;else{var p=i[Ea]=i[Ea]||{};p[v]=d}},i.complete=function(){var v=0,d=i.getCtx(t.ChildrenContextKey);if(ur(d))for(var p=0;p<d.length;p++){var B=d[p];B&&(v+=B.time)}i.time=fr()-i.start,i.exTime=i.time-v,i.complete=function(){},!a&&at(r)&&(i.payload=r())}}return t.ParentContextKey="parent",t.ChildrenContextKey="childEvts",t}();var _l=function(){function t(e){this.ctx={},gt(t,this,function(r){r.create=function(n,i,a){return new po(n,i,a)},r.fire=function(n){n&&(n.complete(),e&&at(e.perfEvent)&&e.perfEvent(n))},r.setCtx=function(n,i){if(n){var a=r[Ea]=r[Ea]||{};a[n]=i}},r.getCtx=function(n){return(r[Ea]||{})[n]}})}return t}();var hl="CoreUtils.doPerf";function Vn(t,e,r,n,i){if(t){var a=t;if(at(a.getPerfMgr)&&(a=a.getPerfMgr()),a){var s=void 0,v=a.getCtx(hl);try{if(s=a.create(e(),n,i),s){if(v&&s.setCtx&&(s.setCtx(po.ParentContextKey,v),v.getCtx&&v.setCtx)){var d=v.getCtx(po.ChildrenContextKey);d||(d=[],v.setCtx(po.ChildrenContextKey,d)),d.push(s)}return a.setCtx(hl,s),r(s)}}catch(p){s&&s.setCtx&&s.setCtx("exception",p)}finally{s&&a.fire(s),a.setCtx(hl,v)}}}return r()}function Sl(){return Ov}var eu=function(){function t(e,r){var n=this,i=null,a=at(e.processTelemetry),s=at(e.setNextPlugin);n._hasRun=!1,n.getPlugin=function(){return e},n.getNext=function(){return i},n.setNext=function(v){i=v},n.processTelemetry=function(v,d){d||(d=r);var p=e?e.identifier:"TelemetryPluginChain";Vn(d?d.core():null,function(){return p+":processTelemetry"},function(){if(e&&a){n._hasRun=!0;try{d.setNext(i),s&&e.setNextPlugin(i),i&&(i._hasRun=!1),e.processTelemetry(v,d)}catch(z){var B=i&&i._hasRun;(!i||!B)&&d.diagLog().throwInternal(Pe.CRITICAL,we.PluginException,"Plugin ["+e.identifier+"] failed during processTelemetry - "+it(z)),i&&!B&&i.processTelemetry(v,d)}}else i&&(n._hasRun=!0,i.processTelemetry(v,d))},function(){return{item:v}},!v.sync)}}return t}();function gl(t,e){var r=[];if(t&&t.length>0)for(var n=null,i=0;i<t.length;i++){var a=t[i];if(a&&at(a.processTelemetry)){var s=new eu(a,e);r.push(s),n&&n.setNext(s),n=s}}return r.length>0?r[0]:null}function Lv(t,e,r){var n=[],i=!r;if(t)for(;t;){var a=t.getPlugin();(i||a===r)&&(i=!0,n.push(a)),t=t.getNext()}return i||n.push(r),gl(n,e)}function Fv(t,e,r){var n=t,i=!1;return r&&t&&(n=[],tt(t,function(a){(i||a===r)&&(i=!0,n.push(a))})),r&&!i&&(n||(n=[]),n.push(r)),gl(n,e)}var Zn=function(){function t(e,r,n,i){var a=this,s=null;i!==null&&(e&&at(e.getPlugin)?s=Lv(e,a,i||e.getPlugin()):i?s=Fv(e,a,i):Wt(i)&&(s=gl(e,a))),a.core=function(){return n},a.diagLog=function(){return $n(n,r)},a.getCfg=function(){return r},a.getExtCfg=function(v,d){d===void 0&&(d={});var p;if(r){var B=r.extensionConfig;B&&v&&(p=B[v])}return p||d},a.getConfig=function(v,d,p){p===void 0&&(p=!1);var B,z=a.getExtCfg(v,null);return z&&!De(z[d])?B=z[d]:r&&!De(r[d])&&(B=r[d]),De(B)?p:B},a.hasNext=function(){return s!=null},a.getNext=function(){return s},a.setNext=function(v){s=v},a.processNext=function(v){var d=s;d&&(s=d.getNext(),d.processTelemetry(v,a))},a.createNew=function(v,d){return v===void 0&&(v=null),new t(v||s,r,n,d)}}return t}();var tu="iKey",ws="extensionConfig";var Rs="getPlugin",In=function(){function t(){var e=this,r=!1,n=null,i=null;e.core=null,e.diagLog=function(a){return e._getTelCtx(a).diagLog()},e.isInitialized=function(){return r},e.setInitialized=function(a){r=a},e.setNextPlugin=function(a){i=a},e.processNext=function(a,s){s?s.processNext(a):i&&at(i.processTelemetry)&&i.processTelemetry(a,null)},e._getTelCtx=function(a){a===void 0&&(a=null);var s=a;if(!s){var v=n||new Zn(null,{},e.core);i&&i[Rs]?s=v.createNew(null,i[Rs]):s=v.createNew(null,i)}return s},e._baseTelInit=function(a,s,v,d){a&&ht(a,ws,[],null,De),!d&&s&&(d=s.getProcessTelContext().getNext());var p=i;i&&i[Rs]&&(p=i[Rs]()),e.core=s,n=new Zn(d,a,s,p),r=!0}}return t.prototype.initialize=function(e,r,n,i){this._baseTelInit(e,r,n,i)},t}();var bl="processTelemetry",ru="priority",nu="setNextPlugin",iu="isInitialized";function ho(t,e){for(var r=[],n=null,i=t.getNext();i;){var a=i.getPlugin();a&&(n&&at(n[nu])&&at(a[bl])&&n[nu](a),(!at(a[iu])||!a[iu]())&&r.push(a),n=a,i=i.getNext())}tt(r,function(s){s.initialize(t.getCfg(),t.core(),e,t.getNext())})}function xl(t){return t.sort(function(e,r){var n=0,i=at(r[bl]);return at(e[bl])?n=i?e[ru]-r[ru]:1:i&&(n=-1),n})}var yl=500,Uv="Channel has invalid priority",au=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=yl;var n;gt(e,r,function(v,d){v.setNextPlugin=function(p){},v.processTelemetry=function(p,B){n&&tt(n,function(z){if(z.length>0){var ee=r._getTelCtx(B).createNew(z);ee.processNext(p)}})},v.getChannelControls=function(){return n},v.initialize=function(p,B,z){v.isInitialized()||(d.initialize(p,B,z),s((p||{}).channels,z),tt(n,function(ee){return ho(new Zn(ee,p,B),z)}))}});function i(v){tt(v,function(d){d.priority<yl&&wr(Uv+d.identifier)})}function a(v){v&&v.length>0&&(v=v.sort(function(d,p){return d.priority-p.priority}),i(v),n.push(v))}function s(v,d){if(n=[],v&&tt(v,function(B){return a(B)}),d){var p=[];tt(d,function(B){B.priority>yl&&p.push(B)}),a(p)}}return r}return e._staticInit=function(){var r=e.prototype;di(r,"ChannelControls",r.getChannelControls),di(r,"channelQueue",r.getChannelControls)}(),e}(In);var ou="toGMTString",su="toUTCString",Al="cookie",El="expires",Rl="enabled",lu="isCookieUseDisabled",cu="disableCookiesUsage",vi="_ckMgr",Cn="",Ts=null,wl=null,uu=null,_o=ir(),fu={},Is={};function Hv(t,e){var r=Fi[vi]||Is[vi];return r||(r=Fi[vi]=Fi(t,e),Is[vi]=r),r}function As(t){return t?t.isEnabled():!0}function Vv(t){var e=t.cookieCfg=t.cookieCfg||{};if(ht(e,"domain",t.cookieDomain,Q0,De),ht(e,"path",t.cookiePath||"/",null,De),De(e[Rl])){var r=void 0;Wt(t[lu])||(r=!t[lu]),Wt(t[cu])||(r=!t[cu]),e[Rl]=r}return e}function Ui(t,e){var r;if(t)r=t.getCookieMgr();else if(e){var n=e.cookieCfg;n[vi]?r=n[vi]:r=Fi(e)}return r||(r=Hv(e,(t||{}).logger)),r}function Fi(t,e){var r=Vv(t||Is),n=r.path||"/",i=r.domain,a=r[Rl]!==!1,s={isEnabled:function(){var v=a&&Tl(e),d=Is[vi];return v&&d&&s!==d&&(v=As(d)),v},setEnabled:function(v){a=v!==!1},set:function(v,d,p,B,z){var ee=!1;if(As(s)){var te={},D=Jt(d||Cn),ce=D.indexOf(";");if(ce!==-1&&(D=Jt(d.substring(0,ce)),te=pu(d.substring(ce+1))),ht(te,"domain",B||i,ga,Wt),!De(p)){var P=ki();if(Wt(te[El])){var oe=fr(),se=oe+p*1e3;if(se>0){var xe=new Date;xe.setTime(se),ht(te,El,du(xe,P?ou:su)||du(xe,P?ou:su)||Cn,ga)}}P||ht(te,"max-age",Cn+p,null,Wt)}var Ge=$r();Ge&&Ge.protocol==="https:"&&(ht(te,"secure",null,null,Wt),wl===null&&(wl=!Il((Rr()||{}).userAgent)),wl&&ht(te,"SameSite","None",null,Wt)),ht(te,"path",z||n,null,Wt);var lt=r.setCookie||mu;lt(v,vu(D,te)),ee=!0}return ee},get:function(v){var d=Cn;return As(s)&&(d=(r.getCookie||qv)(v)),d},del:function(v,d){var p=!1;return As(s)&&(p=s.purge(v,d)),p},purge:function(v,d){var p,B=!1;if(Tl(e)){var z=(p={},p.path=d||"/",p[El]="Thu, 01 Jan 1970 00:00:01 GMT",p);ki()||(z["max-age"]="0");var ee=r.delCookie||mu;ee(v,vu(Cn,z)),B=!0}return B}};return s[vi]=s,s}function Tl(t){if(Ts===null){Ts=!1;try{var e=_o||{};Ts=e[Al]!==void 0}catch(r){t&&t.throwInternal(Pe.WARNING,we.CannotAccessCookie,"Cannot access document.cookie - "+_t(r),{exception:it(r)})}}return Ts}function pu(t){var e={};if(t&&t.length){var r=Jt(t).split(";");tt(r,function(n){if(n=Jt(n||Cn),n){var i=n.indexOf("=");i===-1?e[n]=null:e[Jt(n.substring(0,i))]=Jt(n.substring(i+1))}})}return e}function du(t,e){return at(t[e])?t[e]():null}function vu(t,e){var r=t||Cn;return Tt(e,function(n,i){r+="; "+n+(De(i)?Cn:"="+i)}),r}function qv(t){var e=Cn;if(_o){var r=_o[Al]||Cn;uu!==r&&(fu=pu(r),uu=r),e=Jt(fu[t]||Cn)}return e}function mu(t,e){_o&&(_o[Al]=t+"="+e)}function Il(t){return et(t)?!!(cr(t,"CPU iPhone OS 12")||cr(t,"iPad; CPU OS 12")||cr(t,"Macintosh; Intel Mac OS X 10_14")&&cr(t,"Version/")&&cr(t,"Safari")||cr(t,"Macintosh; Intel Mac OS X 10_14")&&el(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||cr(t,"Chrome/5")||cr(t,"Chrome/6")||cr(t,"UnrealEngine")&&!cr(t,"Chrome")||cr(t,"UCBrowser/12")||cr(t,"UCBrowser/11")):!1}var zv="Extensions must provide callback to initialize",hu="_notificationManager";function jv(t,e){return new _l(e)}var _u=function(){function t(){var e=!1,r,n,i,a,s;gt(t,this,function(v){v._extensions=new Array,n=new au,v.logger=new ya({loggingLevelConsole:Pe.CRITICAL}),r=[],v.isInitialized=function(){return e},v.initialize=function(d,p,B,z){v.isInitialized()&&wr("Core should not be initialized more than once"),(!d||De(d.instrumentationKey))&&wr("Please provide instrumentation key"),i=z,v[hu]=z,v.config=d||{},z&&v.config.disableDbgExt!==!0&&z.addNotificationListener(Z1(d)),v.config.enablePerfMgr&&ht(v.config,"createPerfMgr",jv),d.extensions=De(d.extensions)?[]:d.extensions;var ee=dr(d,ws);ee.NotificationManager=z,B&&(v.logger=B);var te=[];te.push.apply(te,cs(cs([],p,!1),d.extensions,!1)),te=xl(te);var D=[],ce=[],P={};tt(te,function(oe){(De(oe)||De(oe.initialize))&&wr(zv);var se=oe.priority,xe=oe.identifier;oe&&se&&(De(P[se])?P[se]=xe:B.warnToConsole("Two extensions have same priority #"+se+" - "+P[se]+", "+xe)),!se||se<n.priority?D.push(oe):ce.push(oe)}),te.push(n),D.push(n),te=xl(te),v._extensions=te,ho(new Zn([n],d,v),te),ho(new Zn(D,d,v),te),v._extensions=D,v.getTransmissionControls().length===0&&wr("No channels available"),e=!0,v.releaseQueue()},v.getTransmissionControls=function(){return n.getChannelControls()},v.track=function(d){ht(d,tu,v.config.instrumentationKey,null,_s),ht(d,"time",Pr(new Date),null,_s),ht(d,"ver","4.0",null,De),v.isInitialized()?v.getProcessTelContext().processNext(d):r.push(d)},v.getProcessTelContext=function(){var d=v._extensions,p=d;return(!d||d.length===0)&&(p=[n]),new Zn(p,v.config,v)},v.getNotifyMgr=function(){return i||(i=pa({addNotificationListener:function(d){},removeNotificationListener:function(d){},eventsSent:function(d){},eventsDiscarded:function(d,p){},eventsSendRequest:function(d,p){}}),v[hu]=i),i},v.getCookieMgr=function(){return s||(s=Fi(v.config,v.logger)),s},v.setCookieMgr=function(d){s=d},v.getPerfMgr=function(){return a||v.config&&v.config.enablePerfMgr&&at(v.config.createPerfMgr)&&(a=v.config.createPerfMgr(v,v.getNotifyMgr())),a||Sl()},v.setPerfMgr=function(d){a=d},v.eventCnt=function(){return r.length},v.releaseQueue=function(){r.length>0&&(tt(r,function(d){v.getProcessTelContext().processNext(d)}),r=[])}})}return t}();var Su=function(){function t(e){this.listeners=[];var r=!!(e||{}).perfEvtsSendAll;gt(t,this,function(n){n.addNotificationListener=function(i){n.listeners.push(i)},n.removeNotificationListener=function(i){for(var a=Un(n.listeners,i);a>-1;)n.listeners.splice(a,1),a=Un(n.listeners,i)},n.eventsSent=function(i){tt(n.listeners,function(a){a&&a.eventsSent&&setTimeout(function(){return a.eventsSent(i)},0)})},n.eventsDiscarded=function(i,a){tt(n.listeners,function(s){s&&s.eventsDiscarded&&setTimeout(function(){return s.eventsDiscarded(i,a)},0)})},n.eventsSendRequest=function(i,a){tt(n.listeners,function(s){if(s&&s.eventsSendRequest)if(a)setTimeout(function(){return s.eventsSendRequest(i,a)},0);else try{s.eventsSendRequest(i,a)}catch{}})},n.perfEvent=function(i){i&&(r||!i.isChildEvt())&&tt(n.listeners,function(a){if(a&&a.perfEvent)if(i.isAsync)setTimeout(function(){return a.perfEvent(i)},0);else try{a.perfEvent(i)}catch{}})}})}return t}();var Cl=function(t){ut(e,t);function e(){var r=t.call(this)||this,n=0;return gt(e,r,function(i,a){i.initialize=function(d,p,B,z){a.initialize(d,p,B||new ya(d),z||new Su(d))},i.track=function(d){Vn(i.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){d===null&&(v(d),wr("Invalid telemetry item")),s(d),a.track(d)},function(){return{item:d}},!d.sync)},i.addNotificationListener=function(d){var p=i.getNotifyMgr();p&&p.addNotificationListener(d)},i.removeNotificationListener=function(d){var p=i.getNotifyMgr();p&&p.removeNotificationListener(d)},i.pollInternalLogs=function(d){var p=i.config.diagnosticLogInterval;return(!p||!(p>0))&&(p=1e4),n&&i.stopPollingInternalLogs(),n=setInterval(function(){var B=i.logger?i.logger.queue:[];tt(B,function(z){var ee={name:d||"InternalMessageId: "+z.messageId,iKey:i.config.instrumentationKey,time:Pr(new Date),baseType:Yn.dataType,baseData:{message:z.message}};i.track(ee)}),B.length=0},p),n},i.stopPollingInternalLogs=function(){!n||(clearInterval(n),n=0)};function s(d){if(De(d.name))throw v(d),Error("telemetry name required")}function v(d){var p=i.getNotifyMgr();p&&p.eventsDiscarded([d],A1.InvalidEvent)}}),r}return e}(_u);var gu=4294967296,Hi=4294967295,bu=!1,So=123456789,go=987654321;function Gv(t){t<0&&(t>>>=0),So=123456789+t&Hi,go=987654321-t&Hi,bu=!0}function Xv(){try{var t=fr()&2147483647;Gv((Math.random()*gu^t)+t)}catch{}}function wa(t){var e,r=fl()||dl();return r&&r.getRandomValues?e=r.getRandomValues(new Uint32Array(1))[0]&Hi:ki()?(bu||Xv(),e=xu()&Hi):e=Math.floor(gu*Math.random()|0),t||(e>>>=0),e}function xu(t){go=36969*(go&65535)+(go>>16)&Hi,So=18e3*(So&65535)+(So>>16)&Hi;var e=(go<<16)+(So&65535)>>>0&Hi|0;return t||(e>>>=0),e}var yu="visibilitychange",Eu="pagehide";function Cs(t,e){var r=!1,n=Hn();n&&(r=Tn(n,t,e),r=Tn(n.body,t,e)||r);var i=ir();return i&&(r=Tn(i,t,e)||r),r}function Ml(t,e,r){var n=!1;if(e&&t&&ur(t)){var i=[];tt(t,function(a){et(a)&&(!r||Un(r,a)===-1?n=Cs(a,e)||n:i.push(a))}),!n&&i.length>0&&(n=Ml(i,e))}return n}function Pl(t,e){return Ml(["beforeunload","unload","pagehide"],t,e)}function bo(t,e){function r(i){var a=ir();t&&a&&a.visibilityState==="hidden"&&t(i)}var n=!1;return(!e||Un(e,Eu)===-1)&&(n=Cs(Eu,t)),(!e||Un(e,yu)===-1)&&(n=Cs(yu,r)||n),!n&&e&&(n=bo(t)),n}function Ra(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=wa()>>>0,n=0,i="";i.length<t;)n++,i+=e.charAt(r&63),r>>>=6,n===5&&(r=(wa()<<2&4294967295|r&3)>>>0,n=0);return i}function zr(){for(var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],e="",r,n=0;n<4;n++)r=wa(),e+=t[r&15]+t[r>>4&15]+t[r>>8&15]+t[r>>12&15]+t[r>>16&15]+t[r>>20&15]+t[r>>24&15]+t[r>>28&15];var i=t[8+(wa()&3)|0];return e.substr(0,8)+e.substr(9,4)+"4"+e.substr(13,3)+i+e.substr(16,3)+e.substr(19,12)}var Ru="_aiHooks",Tu=["req","rsp","hkErr","fnErr"];function Nl(t,e){if(t)for(var r=0;r<t.length&&!e(t[r],r);r++);}function Bl(t,e,r,n,i){i>=0&&i<=2&&Nl(t,function(a,s){var v=a.cbks,d=v[Tu[i]];if(d){e.ctx=function(){var z=n[s]=n[s]||{};return z};try{d.apply(e.inst,r)}catch(z){var p=e.err;try{var B=v[Tu[2]];B&&(e.err=z,B.apply(e.inst,r))}catch{}finally{e.err=p}}}})}function $v(t){return function(){var e=this,r=arguments,n=t.h,i={name:t.n,inst:e,ctx:null,set:d},a=[],s=v([i],r);function v(B,z){return Nl(z,function(ee){B.push(ee)}),B}function d(B,z){r=v([],r),r[B]=z,s=v([i],r)}Bl(n,i,s,a,0);var p=t.f;try{i.rslt=p.apply(e,r)}catch(B){throw i.err=B,Bl(n,i,s,a,3),B}return Bl(n,i,s,a,1),i.rslt}}function Au(t,e,r){var n=null;return t&&(mo(t,e)?n=t:r&&(n=Au(X1(t),e,!1))),n}function Dl(t,e,r){return t?xo(t[Gt],e,r,!1):null}function xo(t,e,r,n){if(n===void 0&&(n=!0),t&&e&&r){var i=Au(t,e,n);if(i){var a=i[e];if(typeof a===En){var s=a[Ru];if(!s){s={i:0,n:e,f:a,h:[]};var v=$v(s);v[Ru]=s,i[e]=v}var d={id:s.i,cbks:r,rm:function(){var p=this.id;Nl(s.h,function(B,z){if(B.id===p)return s.h.splice(z,1),1})}};return s.i++,s.h.push(d),d}}}return null}var Ct={requestContextHeader:"Request-Context",requestContextTargetKey:"appId",requestContextAppIdFormat:"appId=cid-v1:",requestIdHeader:"Request-Id",traceParentHeader:"traceparent",traceStateHeader:"tracestate",sdkContextHeader:"Sdk-Context",sdkContextHeaderAppIdRequest:"appId",requestContextHeaderLowerCase:"request-context"};function kl(t,e,r){var n=e.length,i=Iu(t,e);if(i.length!==n){for(var a=0,s=i;r[s]!==void 0;)a++,s=i.substring(0,150-3)+Cu(a);i=s}return i}function Iu(t,e){var r;return e&&(e=Jt(e.toString()),e.length>150&&(r=e.substring(0,150),t&&t.throwInternal(Pe.WARNING,we.NameTooLong,"name is too long. It has been truncated to "+150+" characters.",{name:e},!0))),r||e}function Mt(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Jt(e),e.toString().length>r&&(n=e.toString().substring(0,r),t&&t.throwInternal(Pe.WARNING,we.StringValueTooLong,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}function Qn(t,e){return Fl(t,e,2048,we.UrlTooLong)}function yo(t,e){var r;return e&&e.length>32768&&(r=e.substring(0,32768),t&&t.throwInternal(Pe.WARNING,we.MessageTruncated,"message is too long, it has been truncated to "+32768+" characters.",{message:e},!0)),r||e}function Ol(t,e){var r;if(e){var n=""+e;n.length>32768&&(r=n.substring(0,32768),t&&t.throwInternal(Pe.WARNING,we.ExceptionTruncated,"exception is too long, it has been truncated to "+32768+" characters.",{exception:e},!0))}return r||e}function Br(t,e){if(e){var r={};Tt(e,function(n,i){if(Rn(i)&&An())try{i=vr().stringify(i)}catch(a){t&&t.throwInternal(Pe.WARNING,we.CannotSerializeObjectNonSerializable,"custom property is not valid",{exception:a},!0)}i=Mt(t,i,8192),n=kl(t,n,r),r[n]=i}),e=r}return e}function Nr(t,e){if(e){var r={};Tt(e,function(n,i){n=kl(t,n,r),r[n]=i}),e=r}return e}function Ll(t,e){return e&&Fl(t,e,128,we.IdTooLong).toString()}function Fl(t,e,r,n){var i;return e&&(e=Jt(e),e.length>r&&(i=e.substring(0,r),t&&t.throwInternal(Pe.WARNING,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),i||e}function Cu(t){var e="00"+t;return e.substr(e.length-3)}function Vi(t){var e=null;if(at(Event))e=new Event(t);else{var r=ir();r&&r.createEvent&&(e=r.createEvent("Event"),e.initEvent(t,!0,!0))}return e}function fn(t,e){return e===void 0&&(e=!1),t==null?e:t.toString().toLowerCase()==="true"}function Qr(t){(isNaN(t)||t<0)&&(t=0),t=Math.round(t);var e=""+t%1e3,r=""+Math.floor(t/1e3)%60,n=""+Math.floor(t/(1e3*60))%60,i=""+Math.floor(t/(1e3*60*60))%24,a=Math.floor(t/(1e3*60*60*24));return e=e.length===1?"00"+e:e.length===2?"0"+e:e,r=r.length<2?"0"+r:r,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(a>0?a+".":"")+i+":"+n+":"+r+"."+e}function Ul(t,e){var r=null;return tt(t,function(n){if(n.identifier===e)return r=n,-1}),r}function Hl(t,e,r,n,i){return!i&&et(t)&&(t==="Script error."||t==="Script error")}var Mn="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Ta="sampleRate",Aa="ProcessLegacy",Eo="http.method",Ms="https://dc.services.visualstudio.com",ar="not_specified",Ps="iKey";var mi;(function(t){t[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage"})(mi||(mi={}));var dn;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C",t[t.W3C=2]="W3C"})(dn||(dn={}));var qi=void 0,zi=void 0;function Vl(){return Ns()?Bs(mi.LocalStorage):null}function Bs(t){try{if(De(cn()))return null;var e=new Date,r=er(t===mi.LocalStorage?"localStorage":"sessionStorage");r.setItem(e.toString(),e.toString());var n=r.getItem(e.toString())!==e.toString();if(r.removeItem(e.toString()),!n)return r}catch{}return null}function ql(){return ji()?Bs(mi.SessionStorage):null}function zl(){qi=!1,zi=!1}function Ns(){return qi===void 0&&(qi=!!Bs(mi.LocalStorage)),qi}function jl(t,e){var r=Vl();if(r!==null)try{return r.getItem(e)}catch(n){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+_t(n),{exception:it(n)})}return null}function Gl(t,e,r){var n=Vl();if(n!==null)try{return n.setItem(e,r),!0}catch(i){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+_t(i),{exception:it(i)})}return!1}function Xl(t,e){var r=Vl();if(r!==null)try{return r.removeItem(e),!0}catch(n){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserFailedRemovalFromLocalStorage,"Browser failed removal of local storage item. "+_t(n),{exception:it(n)})}return!1}function ji(){return zi===void 0&&(zi=!!Bs(mi.SessionStorage)),zi}function Ia(t,e){var r=ql();if(r!==null)try{return r.getItem(e)}catch(n){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotReadSessionStorage,"Browser failed read of session storage. "+_t(n),{exception:it(n)})}return null}function Ca(t,e,r){var n=ql();if(n!==null)try{return n.setItem(e,r),!0}catch(i){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotWriteSessionStorage,"Browser failed write to session storage. "+_t(i),{exception:it(i)})}return!1}function Kl(t,e){var r=ql();if(r!==null)try{return r.removeItem(e),!0}catch(n){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserFailedRemovalFromSessionStorage,"Browser failed removal of session storage item. "+_t(n),{exception:it(n)})}return!1}var Mu=ir()||{},Pu=0,rm=[null,null,null,null,null];function wo(t){var e=Pu,r=rm,n=r[e];return Mu.createElement?r[e]||(n=r[e]=Mu.createElement("a")):n={host:Wl(t,!0)},n.href=t,e++,e>=r.length&&(e=0),Pu=e,n}function Ds(t){var e,r=wo(t);return r&&(e=r.href),e}function ks(t,e){return t?t.toUpperCase()+" "+e:e}function Wl(t,e){var r=Os(t,e)||"";if(r){var n=r.match(/(www[0-9]?\.)?(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>3&&et(n[2])&&n[2].length>0)return n[2]+(n[3]||"")}return r}function Os(t,e){var r=null;if(t){var n=t.match(/(\w*):\/\/(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>2&&et(n[2])&&n[2].length>0&&(r=n[2]||"",e&&n.length>2)){var i=(n[1]||"").toLowerCase(),a=n[3]||"";(i==="http"&&a===":80"||i==="https"&&a===":443")&&(a=""),r+=a}}return r}var im=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"];function Gi(t){return im.indexOf(t.toLowerCase())!==-1}var Jn={correlationIdPrefix:"cid-v1:",canIncludeCorrelationHeader:function(t,e,r){if(!e||t&&t.disableCorrelationHeaders)return!1;if(t&&t.correlationHeaderExcludePatterns){for(var n=0;n<t.correlationHeaderExcludePatterns.length;n++)if(t.correlationHeaderExcludePatterns[n].test(e))return!1}var i=wo(e).host.toLowerCase();if(i&&(i.indexOf(":443")!==-1||i.indexOf(":80")!==-1)&&(i=(Os(e,!0)||"").toLowerCase()),(!t||!t.enableCorsCorrelation)&&i&&i!==r)return!1;var a=t&&t.correlationHeaderDomains;if(a){var s;if(tt(a,function(p){var B=new RegExp(p.toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));s=s||B.test(i)}),!s)return!1}var v=t&&t.correlationHeaderExcludedDomains;if(!v||v.length===0)return!0;for(var n=0;n<v.length;n++){var d=new RegExp(v[n].toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));if(d.test(i))return!1}return i&&i.length>0},getCorrelationContext:function(t){if(t){var e=Jn.getCorrelationContextValue(t,Ct.requestContextTargetKey);if(e&&e!==Jn.correlationIdPrefix)return e}},getCorrelationContextValue:function(t,e){if(t)for(var r=t.split(","),n=0;n<r.length;++n){var i=r[n].split("=");if(i.length===2&&i[0]===e)return i[1]}}};function Bu(t,e,r,n){var i,a=n,s=n;if(e&&e.length>0){var v=wo(e);if(i=v.host,!a)if(v.pathname!=null){var d=v.pathname.length===0?"/":v.pathname;d.charAt(0)!=="/"&&(d="/"+d),s=v.pathname,a=Mt(t,r?r+" "+d:d)}else a=Mt(t,e)}else i=n,a=n;return{target:i,name:a,data:s}}function Ma(){var t=Zr();if(t&&t.now&&t.timing){var e=t.now()+t.timing.navigationStart;if(e>0)return e}return fr()}function mr(t,e){var r=null;return t!==0&&e!==0&&!De(t)&&!De(e)&&(r=e-t),r}var am=";",om="=";function Yl(t){if(!t)return{};var e=t.split(am),r=hs(e,function(i,a){var s=a.split(om);if(s.length===2){var v=s[0].toLowerCase(),d=s[1];i[v]=d}return i},{});if(un(r).length>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r.ingestionendpoint=r.ingestionendpoint||"https://"+n+"dc."+r.endpointsuffix}r.ingestionendpoint=r.ingestionendpoint||Ms}return r}var $l=function(){function t(){}return t}();var Zl=function(t){ut(e,t);function e(){return t.call(this)||this}return e}($l);var Nu=function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return t}();var Ls=function(t){ut(e,t);function e(r,n,i){var a=t.call(this)||this;return a.name=Mt(r,i)||ar,a.data=n,a.time=Pr(new Date),a.aiDataContract={time:1,iKey:1,name:1,sampleRate:function(){return a.sampleRate===100?4:1},tags:1,data:1},a}return e}(Nu);var Fs=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Jr=function(t){ut(e,t);function e(r,n,i,a){var s=t.call(this)||this;return s.aiDataContract={ver:1,name:1,properties:0,measurements:0},s.name=Mt(r,n)||ar,s.properties=Br(r,i),s.measurements=Nr(r,a),s}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(Fs);var Du=function(){function t(){}return t}();var ku=function(){function t(){this.ver=2,this.exceptions=[],this.properties={},this.measurements={}}return t}();var Ou=function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return t}();var sm="<no_method>",Ba="error",vn="stack",Jl="stackDetails",Lu="errorSrc",ec="message",Hu="description";function tc(t,e){var r=t;return r&&!et(r)&&(JSON&&JSON.stringify?(r=JSON.stringify(t),e&&(!r||r==="{}")&&(at(t.toString)?r=t.toString():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}function Vu(t,e){var r=t;return t&&(r&&!et(r)&&(r=t[ec]||t[Hu]||r),r&&!et(r)&&(r=tc(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&(r||"").indexOf(e)===-1&&(r=e+": "+r),r||""}function lm(t){try{if(Rn(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}function cm(t){try{if(Rn(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}function Fu(t){return t&&t.src&&et(t.src)&&t.obj&&ur(t.obj)}function Pa(t){var e=t||"";et(e)||(et(e[vn])?e=e[vn]:e=""+e);var r=e.split(`
13
+ `,8*m.main_data_begin,u.ResvSize,m.resvDrain_post,m.resvDrain_pre,8*u.sideinfo_len,l-m.resvDrain_post-8*u.sideinfo_len,l,l%8,b),kn.err.println("This is a fatal error. It has several possible causes:"),kn.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),kn.err.println(" 9%% Your system is overclocked"),kn.err.println(" 1%% bug in LAME encoding library"),u.ResvSize=m.main_data_begin*8),dt(De%8==0),De>1e9){var h;for(h=0;h<Bt.MAX_HEADER_BUF;++h)u.header[h].write_timing-=De;De=0}return 0},this.copy_buffer=function(y,u,m,b,l){var h=G+1;if(h<=0)return 0;if(b!=0&&h>b)return-1;if(kn.arraycopy(Ne,0,u,m,h),G=-1,de=0,l!=0){var x=ud(1);if(x[0]=y.nMusicCRC,me.updateMusicCRC(x,u,m,h),y.nMusicCRC=x[0],h>0&&(y.VBR_seek_table.nBytesWritten+=h),y.decode_on_the_fly){for(var E=cd([2,1152]),X=h,U=-1,j;U!=0;)if(U=ye.hip_decode1_unclipped(y.hip,u,m,X,E[0],E[1]),X=0,U==-1&&(U=0),U>0){if(dt(U<=1152),y.findPeakSample){for(j=0;j<U;j++)E[0][j]>y.PeakSample?y.PeakSample=E[0][j]:-E[0][j]>y.PeakSample&&(y.PeakSample=-E[0][j]);if(y.channels_out>1)for(j=0;j<U;j++)E[1][j]>y.PeakSample?y.PeakSample=E[1][j]:-E[1][j]>y.PeakSample&&(y.PeakSample=-E[1][j])}if(y.findReplayGain&&Z.AnalyzeSamples(y.rgdata,E[0],0,E[1],0,U,y.channels_out)==Xa.GAIN_ANALYSIS_ERROR)return-6}}}return h},this.init_bit_stream_w=function(y){Ne=ld(At.LAME_MAXMP3BUFFER),y.h_ptr=y.w_ptr=0,y.header[y.h_ptr].write_timing=0,G=-1,de=0,De=0}}var ri=Vo,fd=P.System,kt=P.VbrMode,u0=P.ShortBlock,Ai=P.new_float,Mc=P.new_int_n,dd=P.new_short_n,Gr=P.assert;function rr(){var C=this,$=128*1024;rr.V9=410,rr.V8=420,rr.V7=430,rr.V6=440,rr.V5=450,rr.V4=460,rr.V3=470,rr.V2=480,rr.V1=490,rr.V0=500,rr.R3MIX=1e3,rr.STANDARD=1001,rr.EXTREME=1002,rr.INSANE=1003,rr.STANDARD_FAST=1004,rr.EXTREME_FAST=1005,rr.MEDIUM=1006,rr.MEDIUM_FAST=1007;var ie=16384+$;rr.LAME_MAXMP3BUFFER=ie;var Z,ye,Q,me,Ne,De=new Ar,G,de,he,M;this.enc=new T,this.setModules=function(f,S,fe,_e,Oe,Ue,je,ze,nt){Z=f,ye=S,Q=fe,me=_e,Ne=Oe,G=Ue,de=je,he=ze,M=nt,this.enc.setModules(ye,De,me,G)};function K(){this.mask_adjust=0,this.mask_adjust_short=0,this.bo_l_weight=Ai(T.SBMAX_l),this.bo_s_weight=Ai(T.SBMAX_s)}function o(){this.lowerlimit=0}function I(f,S){this.lowpass=S}var H=4294479419;function O(f){var S;return f.class_id=H,S=f.internal_flags=new Bt,f.mode=nr.NOT_SET,f.original=1,f.in_samplerate=44100,f.num_channels=2,f.num_samples=-1,f.bWriteVbrTag=!0,f.quality=-1,f.short_blocks=null,S.subblock_gain=-1,f.lowpassfreq=0,f.highpassfreq=0,f.lowpasswidth=-1,f.highpasswidth=-1,f.VBR=kt.vbr_off,f.VBR_q=4,f.ATHcurve=-1,f.VBR_mean_bitrate_kbps=128,f.VBR_min_bitrate_kbps=0,f.VBR_max_bitrate_kbps=0,f.VBR_hard_min=0,S.VBR_min_bitrate=1,S.VBR_max_bitrate=13,f.quant_comp=-1,f.quant_comp_short=-1,f.msfix=-1,S.resample_ratio=1,S.OldValue[0]=180,S.OldValue[1]=180,S.CurrentStep[0]=4,S.CurrentStep[1]=4,S.masking_lower=1,S.nsPsy.attackthre=-1,S.nsPsy.attackthre_s=-1,f.scale=-1,f.athaa_type=-1,f.ATHtype=-1,f.athaa_loudapprox=-1,f.athaa_sensitivity=0,f.useTemporal=null,f.interChRatio=-1,S.mf_samples_to_encode=T.ENCDELAY+T.POSTDELAY,f.encoder_padding=0,S.mf_size=T.ENCDELAY-T.MDCTDELAY,f.findReplayGain=!1,f.decode_on_the_fly=!1,S.decode_on_the_fly=!1,S.findReplayGain=!1,S.findPeakSample=!1,S.RadioGain=0,S.AudiophileGain=0,S.noclipGainChange=0,S.noclipScale=-1,f.preset=0,f.write_id3tag_automatic=!0,0}this.lame_init=function(){var f=new a0,S=O(f);return S!=0?null:(f.lame_allocated_gfp=1,f)};function g(f){return f>1?0:f<=0?1:Math.cos(Math.PI/2*f)}this.nearestBitrateFullIndex=function(f){var S=[8,16,24,32,40,48,56,64,80,96,112,128,160,192,224,256,320],fe=0,_e=0,Oe=0,Ue=0;Ue=S[16],Oe=16,_e=S[16],fe=16;for(var je=0;je<16;je++)if(Math.max(f,S[je+1])!=f){Ue=S[je+1],Oe=je+1,_e=S[je],fe=je;break}return Ue-f>f-_e?fe:Oe};function _(f,S){var fe=44100;return S>=48e3?fe=48e3:S>=44100?fe=44100:S>=32e3?fe=32e3:S>=24e3?fe=24e3:S>=22050?fe=22050:S>=16e3?fe=16e3:S>=12e3?fe=12e3:S>=11025?fe=11025:S>=8e3&&(fe=8e3),f==-1?fe:(f<=15960&&(fe=44100),f<=15250&&(fe=32e3),f<=11220&&(fe=24e3),f<=9970&&(fe=22050),f<=7230&&(fe=16e3),f<=5420&&(fe=12e3),f<=4510&&(fe=11025),f<=3970&&(fe=8e3),S<fe?S>44100?48e3:S>32e3?44100:S>24e3?32e3:S>22050?24e3:S>16e3?22050:S>12e3?16e3:S>11025?12e3:S>8e3?11025:8e3:fe)}function D(f,S){switch(f){case 44100:return S.version=1,0;case 48e3:return S.version=1,1;case 32e3:return S.version=1,2;case 22050:return S.version=0,0;case 24e3:return S.version=0,1;case 16e3:return S.version=0,2;case 11025:return S.version=0,0;case 12e3:return S.version=0,1;case 8e3:return S.version=0,2;default:return S.version=0,-1}}function q(f,S,fe){fe<16e3&&(S=2);for(var _e=bt.bitrate_table[S][1],Oe=2;Oe<=14;Oe++)bt.bitrate_table[S][Oe]>0&&Math.abs(bt.bitrate_table[S][Oe]-f)<Math.abs(_e-f)&&(_e=bt.bitrate_table[S][Oe]);return _e}function w(f,S,fe){fe<16e3&&(S=2);for(var _e=0;_e<=14;_e++)if(bt.bitrate_table[S][_e]>0&&bt.bitrate_table[S][_e]==f)return _e;return-1}function c(f,S){var fe=[new I(8,2e3),new I(16,3700),new I(24,3900),new I(32,5500),new I(40,7e3),new I(48,7500),new I(56,1e4),new I(64,11e3),new I(80,13500),new I(96,15100),new I(112,15600),new I(128,17e3),new I(160,17500),new I(192,18600),new I(224,19400),new I(256,19700),new I(320,20500)],_e=C.nearestBitrateFullIndex(S);f.lowerlimit=fe[_e].lowpass}function L(f){var S=f.internal_flags,fe=32,_e=-1;if(S.lowpass1>0){for(var Oe=999,Ue=0;Ue<=31;Ue++){var je=Ue/31;je>=S.lowpass2&&(fe=Math.min(fe,Ue)),S.lowpass1<je&&je<S.lowpass2&&(Oe=Math.min(Oe,Ue))}Oe==999?S.lowpass1=(fe-.75)/31:S.lowpass1=(Oe-.75)/31,S.lowpass2=fe/31}if(S.highpass2>0&&S.highpass2<.9*(.75/31)&&(S.highpass1=0,S.highpass2=0,fd.err.println(`Warning: highpass filter disabled. highpass frequency too small
14
+ `)),S.highpass2>0){for(var ze=-1,Ue=0;Ue<=31;Ue++){var je=Ue/31;je<=S.highpass1&&(_e=Math.max(_e,Ue)),S.highpass1<je&&je<S.highpass2&&(ze=Math.max(ze,Ue))}S.highpass1=_e/31,ze==-1?S.highpass2=(_e+.75)/31:S.highpass2=(ze+.75)/31}for(var Ue=0;Ue<32;Ue++){var nt,Ke,je=Ue/31;S.highpass2>S.highpass1?nt=g((S.highpass2-je)/(S.highpass2-S.highpass1+1e-20)):nt=1,S.lowpass2>S.lowpass1?Ke=g((je-S.lowpass1)/(S.lowpass2-S.lowpass1+1e-20)):Ke=1,S.amp_filter[Ue]=nt*Ke}}function y(f){var S=f.internal_flags;switch(f.quality){default:case 9:S.psymodel=0,S.noise_shaping=0,S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.use_best_huffman=0,S.full_outer_loop=0;break;case 8:f.quality=7;case 7:S.psymodel=1,S.noise_shaping=0,S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.use_best_huffman=0,S.full_outer_loop=0;break;case 6:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=0,S.full_outer_loop=0;break;case 5:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=0,S.full_outer_loop=0;break;case 4:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=0,S.noise_shaping_stop=0,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 3:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.noise_shaping_amp=1,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 2:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=1,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 1:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=2,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break;case 0:S.psymodel=1,S.noise_shaping==0&&(S.noise_shaping=1),S.substep_shaping==0&&(S.substep_shaping=2),S.noise_shaping_amp=2,S.noise_shaping_stop=1,S.subblock_gain==-1&&(S.subblock_gain=1),S.use_best_huffman=1,S.full_outer_loop=0;break}}function u(f){var S=f.internal_flags;f.frameNum=0,f.write_id3tag_automatic&&he.id3tag_write_v2(f),S.bitrate_stereoMode_Hist=Mc([16,4+1]),S.bitrate_blockType_Hist=Mc([16,4+1+1]),S.PeakSample=0,f.bWriteVbrTag&&G.InitVbrTag(f)}this.lame_init_params=function(f){var S=f.internal_flags;if(S.Class_ID=0,S.ATH==null&&(S.ATH=new Zf),S.PSY==null&&(S.PSY=new K),S.rgdata==null&&(S.rgdata=new Jf),S.channels_in=f.num_channels,S.channels_in==1&&(f.mode=nr.MONO),S.channels_out=f.mode==nr.MONO?1:2,S.mode_ext=T.MPG_MD_MS_LR,f.mode==nr.MONO&&(f.force_ms=!1),f.VBR==kt.vbr_off&&f.VBR_mean_bitrate_kbps!=128&&f.brate==0&&(f.brate=f.VBR_mean_bitrate_kbps),f.VBR==kt.vbr_off||f.VBR==kt.vbr_mtrh||f.VBR==kt.vbr_mt||(f.free_format=!1),f.VBR==kt.vbr_off&&f.brate==0&&ri.EQ(f.compression_ratio,0)&&(f.compression_ratio=11.025),f.VBR==kt.vbr_off&&f.compression_ratio>0&&(f.out_samplerate==0&&(f.out_samplerate=map2MP3Frequency(int(.97*f.in_samplerate))),f.brate=0|f.out_samplerate*16*S.channels_out/(1e3*f.compression_ratio),S.samplerate_index=D(f.out_samplerate,f),f.free_format||(f.brate=q(f.brate,f.version,f.out_samplerate))),f.out_samplerate!=0&&(f.out_samplerate<16e3?(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,8),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,64)):f.out_samplerate<32e3?(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,8),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,160)):(f.VBR_mean_bitrate_kbps=Math.max(f.VBR_mean_bitrate_kbps,32),f.VBR_mean_bitrate_kbps=Math.min(f.VBR_mean_bitrate_kbps,320))),f.lowpassfreq==0){var fe=16e3;switch(f.VBR){case kt.vbr_off:{var _e=new o;c(_e,f.brate),fe=_e.lowerlimit;break}case kt.vbr_abr:{var _e=new o;c(_e,f.VBR_mean_bitrate_kbps),fe=_e.lowerlimit;break}case kt.vbr_rh:{var Oe=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=f.VBR_q&&f.VBR_q<=9){var Ue=Oe[f.VBR_q],je=Oe[f.VBR_q+1],ze=f.VBR_q_frac;fe=linear_int(Ue,je,ze)}else fe=19500;break}default:{var Oe=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=f.VBR_q&&f.VBR_q<=9){var Ue=Oe[f.VBR_q],je=Oe[f.VBR_q+1],ze=f.VBR_q_frac;fe=linear_int(Ue,je,ze)}else fe=19500}}f.mode==nr.MONO&&(f.VBR==kt.vbr_off||f.VBR==kt.vbr_abr)&&(fe*=1.5),f.lowpassfreq=fe|0}if(f.out_samplerate==0&&(2*f.lowpassfreq>f.in_samplerate&&(f.lowpassfreq=f.in_samplerate/2),f.out_samplerate=_(f.lowpassfreq|0,f.in_samplerate)),f.lowpassfreq=Math.min(20500,f.lowpassfreq),f.lowpassfreq=Math.min(f.out_samplerate/2,f.lowpassfreq),f.VBR==kt.vbr_off&&(f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.brate)),f.VBR==kt.vbr_abr&&(f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.VBR_mean_bitrate_kbps)),f.bWriteVbrTag||(f.findReplayGain=!1,f.decode_on_the_fly=!1,S.findPeakSample=!1),S.findReplayGain=f.findReplayGain,S.decode_on_the_fly=f.decode_on_the_fly,S.decode_on_the_fly&&(S.findPeakSample=!0),S.findReplayGain&&Z.InitGainAnalysis(S.rgdata,f.out_samplerate)==Xa.INIT_GAIN_ANALYSIS_ERROR)return f.internal_flags=null,-6;switch(S.decode_on_the_fly&&!f.decode_only&&(S.hip!=null&&M.hip_decode_exit(S.hip),S.hip=M.hip_decode_init()),S.mode_gr=f.out_samplerate<=24e3?1:2,f.framesize=576*S.mode_gr,f.encoder_delay=T.ENCDELAY,S.resample_ratio=f.in_samplerate/f.out_samplerate,f.VBR){case kt.vbr_mt:case kt.vbr_rh:case kt.vbr_mtrh:{var nt=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5];f.compression_ratio=nt[f.VBR_q]}break;case kt.vbr_abr:f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.VBR_mean_bitrate_kbps);break;default:f.compression_ratio=f.out_samplerate*16*S.channels_out/(1e3*f.brate);break}if(f.mode==nr.NOT_SET&&(f.mode=nr.JOINT_STEREO),f.highpassfreq>0?(S.highpass1=2*f.highpassfreq,f.highpasswidth>=0?S.highpass2=2*(f.highpassfreq+f.highpasswidth):S.highpass2=(1+0)*2*f.highpassfreq,S.highpass1/=f.out_samplerate,S.highpass2/=f.out_samplerate):(S.highpass1=0,S.highpass2=0),f.lowpassfreq>0?(S.lowpass2=2*f.lowpassfreq,f.lowpasswidth>=0?(S.lowpass1=2*(f.lowpassfreq-f.lowpasswidth),S.lowpass1<0&&(S.lowpass1=0)):S.lowpass1=(1-0)*2*f.lowpassfreq,S.lowpass1/=f.out_samplerate,S.lowpass2/=f.out_samplerate):(S.lowpass1=0,S.lowpass2=0),L(f),S.samplerate_index=D(f.out_samplerate,f),S.samplerate_index<0)return f.internal_flags=null,-1;if(f.VBR==kt.vbr_off){if(f.free_format)S.bitrate_index=0;else if(f.brate=q(f.brate,f.version,f.out_samplerate),S.bitrate_index=w(f.brate,f.version,f.out_samplerate),S.bitrate_index<=0)return f.internal_flags=null,-1}else S.bitrate_index=1;f.analysis&&(f.bWriteVbrTag=!1),S.pinfo!=null&&(f.bWriteVbrTag=!1),ye.init_bit_stream_w(S);for(var Ke=S.samplerate_index+3*f.version+6*(f.out_samplerate<16e3?1:0),Ve=0;Ve<T.SBMAX_l+1;Ve++)S.scalefac_band.l[Ve]=me.sfBandIndex[Ke].l[Ve];for(var Ve=0;Ve<T.PSFB21+1;Ve++){var xt=(S.scalefac_band.l[22]-S.scalefac_band.l[21])/T.PSFB21,Ot=S.scalefac_band.l[21]+Ve*xt;S.scalefac_band.psfb21[Ve]=Ot}S.scalefac_band.psfb21[T.PSFB21]=576;for(var Ve=0;Ve<T.SBMAX_s+1;Ve++)S.scalefac_band.s[Ve]=me.sfBandIndex[Ke].s[Ve];for(var Ve=0;Ve<T.PSFB12+1;Ve++){var xt=(S.scalefac_band.s[13]-S.scalefac_band.s[12])/T.PSFB12,Ot=S.scalefac_band.s[12]+Ve*xt;S.scalefac_band.psfb12[Ve]=Ot}S.scalefac_band.psfb12[T.PSFB12]=192,f.version==1?S.sideinfo_len=S.channels_out==1?4+17:4+32:S.sideinfo_len=S.channels_out==1?4+9:4+17,f.error_protection&&(S.sideinfo_len+=2),u(f),S.Class_ID=H;{var Rt;for(Rt=0;Rt<19;Rt++)S.nsPsy.pefirbuf[Rt]=700*S.mode_gr*S.channels_out;f.ATHtype==-1&&(f.ATHtype=4)}switch(Gr(f.VBR_q<=9),Gr(f.VBR_q>=0),f.VBR){case kt.vbr_mt:f.VBR=kt.vbr_mtrh;case kt.vbr_mtrh:{f.useTemporal==null&&(f.useTemporal=!1),Q.apply_preset(f,500-f.VBR_q*10,0),f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),f.quality<5&&(f.quality=0),f.quality>5&&(f.quality=5),S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,f.experimentalY?S.sfb21_extra=!1:S.sfb21_extra=f.out_samplerate>44e3,S.iteration_loop=new VBRNewIterationLoop(Ne);break}case kt.vbr_rh:{Q.apply_preset(f,500-f.VBR_q*10,0),S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,f.experimentalY?S.sfb21_extra=!1:S.sfb21_extra=f.out_samplerate>44e3,f.quality>6&&(f.quality=6),f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),S.iteration_loop=new VBROldIterationLoop(Ne);break}default:{var Lt;S.sfb21_extra=!1,f.quality<0&&(f.quality=LAME_DEFAULT_QUALITY),Lt=f.VBR,Lt==kt.vbr_off&&(f.VBR_mean_bitrate_kbps=f.brate),Q.apply_preset(f,f.VBR_mean_bitrate_kbps,0),f.VBR=Lt,S.PSY.mask_adjust=f.maskingadjust,S.PSY.mask_adjust_short=f.maskingadjust_short,Lt==kt.vbr_off?S.iteration_loop=new nd(Ne):S.iteration_loop=new ABRIterationLoop(Ne);break}}if(Gr(f.scale>=0),f.VBR!=kt.vbr_off){if(S.VBR_min_bitrate=1,S.VBR_max_bitrate=14,f.out_samplerate<16e3&&(S.VBR_max_bitrate=8),f.VBR_min_bitrate_kbps!=0&&(f.VBR_min_bitrate_kbps=q(f.VBR_min_bitrate_kbps,f.version,f.out_samplerate),S.VBR_min_bitrate=w(f.VBR_min_bitrate_kbps,f.version,f.out_samplerate),S.VBR_min_bitrate<0)||f.VBR_max_bitrate_kbps!=0&&(f.VBR_max_bitrate_kbps=q(f.VBR_max_bitrate_kbps,f.version,f.out_samplerate),S.VBR_max_bitrate=w(f.VBR_max_bitrate_kbps,f.version,f.out_samplerate),S.VBR_max_bitrate<0))return-1;f.VBR_min_bitrate_kbps=bt.bitrate_table[f.version][S.VBR_min_bitrate],f.VBR_max_bitrate_kbps=bt.bitrate_table[f.version][S.VBR_max_bitrate],f.VBR_mean_bitrate_kbps=Math.min(bt.bitrate_table[f.version][S.VBR_max_bitrate],f.VBR_mean_bitrate_kbps),f.VBR_mean_bitrate_kbps=Math.max(bt.bitrate_table[f.version][S.VBR_min_bitrate],f.VBR_mean_bitrate_kbps)}return f.tune&&(S.PSY.mask_adjust+=f.tune_value_a,S.PSY.mask_adjust_short+=f.tune_value_a),y(f),Gr(f.scale>=0),f.athaa_type<0?S.ATH.useAdjust=3:S.ATH.useAdjust=f.athaa_type,S.ATH.aaSensitivityP=Math.pow(10,f.athaa_sensitivity/-10),f.short_blocks==null&&(f.short_blocks=u0.short_block_allowed),f.short_blocks==u0.short_block_allowed&&(f.mode==nr.JOINT_STEREO||f.mode==nr.STEREO)&&(f.short_blocks=u0.short_block_coupled),f.quant_comp<0&&(f.quant_comp=1),f.quant_comp_short<0&&(f.quant_comp_short=0),f.msfix<0&&(f.msfix=0),f.exp_nspsytune=f.exp_nspsytune|1,f.internal_flags.nsPsy.attackthre<0&&(f.internal_flags.nsPsy.attackthre=Ar.NSATTACKTHRE),f.internal_flags.nsPsy.attackthre_s<0&&(f.internal_flags.nsPsy.attackthre_s=Ar.NSATTACKTHRE_S),Gr(f.scale>=0),f.scale<0&&(f.scale=1),f.ATHtype<0&&(f.ATHtype=4),f.ATHcurve<0&&(f.ATHcurve=4),f.athaa_loudapprox<0&&(f.athaa_loudapprox=2),f.interChRatio<0&&(f.interChRatio=0),f.useTemporal==null&&(f.useTemporal=!0),S.slot_lag=S.frac_SpF=0,f.VBR==kt.vbr_off&&(S.slot_lag=S.frac_SpF=(f.version+1)*72e3*f.brate%f.out_samplerate|0),me.iteration_init(f),De.psymodel_init(f),Gr(f.scale>=0),0};function m(f,S){(f.in_buffer_0==null||f.in_buffer_nsamples<S)&&(f.in_buffer_0=Ai(S),f.in_buffer_1=Ai(S),f.in_buffer_nsamples=S)}this.lame_encode_flush=function(f,S,fe,_e){var Oe=f.internal_flags,Ue=dd([2,1152]),je=0,ze,nt,Ke,Ve,xt=Oe.mf_samples_to_encode-T.POSTDELAY,Ot=b(f);if(Oe.mf_samples_to_encode<1)return 0;for(ze=0,f.in_samplerate!=f.out_samplerate&&(xt+=16*f.out_samplerate/f.in_samplerate),Ke=f.framesize-xt%f.framesize,Ke<576&&(Ke+=f.framesize),f.encoder_padding=Ke,Ve=(xt+Ke)/f.framesize;Ve>0&&je>=0;){var Rt=Ot-Oe.mf_size,Lt=f.frameNum;Rt*=f.in_samplerate,Rt/=f.out_samplerate,Rt>1152&&(Rt=1152),Rt<1&&(Rt=1),nt=_e-ze,_e==0&&(nt=0),je=this.lame_encode_buffer(f,Ue[0],Ue[1],Rt,S,fe,nt),fe+=je,ze+=je,Ve-=Lt!=f.frameNum?1:0}if(Oe.mf_samples_to_encode=0,je<0||(nt=_e-ze,_e==0&&(nt=0),ye.flush_bitstream(f),je=ye.copy_buffer(Oe,S,fe,nt,1),je<0))return je;if(fe+=je,ze+=je,nt=_e-ze,_e==0&&(nt=0),f.write_id3tag_automatic){if(he.id3tag_write_v1(f),je=ye.copy_buffer(Oe,S,fe,nt,0),je<0)return je;ze+=je}return ze},this.lame_encode_buffer=function(f,S,fe,_e,Oe,Ue,je){var ze=f.internal_flags,nt=[null,null];if(ze.Class_ID!=H)return-3;if(_e==0)return 0;m(ze,_e),nt[0]=ze.in_buffer_0,nt[1]=ze.in_buffer_1;for(var Ke=0;Ke<_e;Ke++)nt[0][Ke]=S[Ke],ze.channels_in>1&&(nt[1][Ke]=fe[Ke]);return l(f,nt[0],nt[1],_e,Oe,Ue,je)};function b(f){var S=T.BLKSIZE+f.framesize-T.FFTOFFSET;return S=Math.max(S,512+f.framesize-32),Gr(Bt.MFSIZE>=S),S}function l(f,S,fe,_e,Oe,Ue,je){var ze=f.internal_flags,nt=0,Ke,Ve,xt,Ot,Rt,Lt=[null,null],jt=[null,null];if(ze.Class_ID!=H)return-3;if(_e==0)return 0;if(Rt=ye.copy_buffer(ze,Oe,Ue,je,0),Rt<0)return Rt;if(Ue+=Rt,nt+=Rt,jt[0]=S,jt[1]=fe,ri.NEQ(f.scale,0)&&ri.NEQ(f.scale,1))for(Ve=0;Ve<_e;++Ve)jt[0][Ve]*=f.scale,ze.channels_out==2&&(jt[1][Ve]*=f.scale);if(ri.NEQ(f.scale_left,0)&&ri.NEQ(f.scale_left,1))for(Ve=0;Ve<_e;++Ve)jt[0][Ve]*=f.scale_left;if(ri.NEQ(f.scale_right,0)&&ri.NEQ(f.scale_right,1))for(Ve=0;Ve<_e;++Ve)jt[1][Ve]*=f.scale_right;if(f.num_channels==2&&ze.channels_out==1)for(Ve=0;Ve<_e;++Ve)jt[0][Ve]=.5*(jt[0][Ve]+jt[1][Ve]),jt[1][Ve]=0;Ot=b(f),Lt[0]=ze.mfbuf[0],Lt[1]=ze.mfbuf[1];for(var Kt=0;_e>0;){var _r=[null,null],Ln=0,Lr=0;_r[0]=jt[0],_r[1]=jt[1];var Fr=new x;if(Se(f,Lt,_r,Kt,_e,Fr),Ln=Fr.n_in,Lr=Fr.n_out,ze.findReplayGain&&!ze.decode_on_the_fly&&Z.AnalyzeSamples(ze.rgdata,Lt[0],ze.mf_size,Lt[1],ze.mf_size,Lr,ze.channels_out)==Xa.GAIN_ANALYSIS_ERROR)return-6;if(_e-=Ln,Kt+=Ln,ze.channels_out==2,ze.mf_size+=Lr,Gr(ze.mf_size<=Bt.MFSIZE),ze.mf_samples_to_encode<1&&(ze.mf_samples_to_encode=T.ENCDELAY+T.POSTDELAY),ze.mf_samples_to_encode+=Lr,ze.mf_size>=Ot){var _n=je-nt;if(je==0&&(_n=0),Ke=h(f,Lt[0],Lt[1],Oe,Ue,_n),Ke<0)return Ke;for(Ue+=Ke,nt+=Ke,ze.mf_size-=f.framesize,ze.mf_samples_to_encode-=f.framesize,xt=0;xt<ze.channels_out;xt++)for(Ve=0;Ve<ze.mf_size;Ve++)Lt[xt][Ve]=Lt[xt][Ve+f.framesize]}}return Gr(_e==0),nt}function h(f,S,fe,_e,Oe,Ue){var je=C.enc.lame_encode_mp3_frame(f,S,fe,_e,Oe,Ue);return f.frameNum++,je}function x(){this.n_in=0,this.n_out=0}function E(){this.num_used=0}function X(f,S){return S!=0?X(S,f%S):f}function U(f,S,fe){var _e=Math.PI*S;f/=fe,f<0&&(f=0),f>1&&(f=1);var Oe=f-.5,Ue=.42-.5*Math.cos(2*f*Math.PI)+.08*Math.cos(4*f*Math.PI);return Math.abs(Oe)<1e-9?_e/Math.PI:Ue*Math.sin(fe*_e*Oe)/(Math.PI*fe*Oe)}function j(f,S,fe,_e,Oe,Ue,je,ze,nt){var Ke=f.internal_flags,Ve,xt=0,Ot,Rt=f.out_samplerate/X(f.out_samplerate,f.in_samplerate);Rt>Bt.BPC&&(Rt=Bt.BPC);var Lt=Math.abs(Ke.resample_ratio-Math.floor(.5+Ke.resample_ratio))<1e-4?1:0,jt=1/Ke.resample_ratio;jt>1&&(jt=1);var Kt=31;Kt%2==0&&--Kt,Kt+=Lt;var _r=Kt+1;if(Ke.fill_buffer_resample_init==0){for(Ke.inbuf_old[0]=Ai(_r),Ke.inbuf_old[1]=Ai(_r),Ve=0;Ve<=2*Rt;++Ve)Ke.blackfilt[Ve]=Ai(_r);for(Ke.itime[0]=0,Ke.itime[1]=0,xt=0;xt<=2*Rt;xt++){var Ln=0,Lr=(xt-Rt)/(2*Rt);for(Ve=0;Ve<=Kt;Ve++)Ln+=Ke.blackfilt[xt][Ve]=U(Ve-Lr,jt,Kt);for(Ve=0;Ve<=Kt;Ve++)Ke.blackfilt[xt][Ve]/=Ln}Ke.fill_buffer_resample_init=1}var Fr=Ke.inbuf_old[nt];for(Ot=0;Ot<_e;Ot++){var _n,Ii;if(_n=Ot*Ke.resample_ratio,xt=0|Math.floor(_n-Ke.itime[nt]),Kt+xt-Kt/2>=je)break;var Lr=_n-Ke.itime[nt]-(xt+.5*(Kt%2));Gr(Math.abs(Lr)<=.501),Ii=0|Math.floor(Lr*2*Rt+Rt+.5);var Ci=0;for(Ve=0;Ve<=Kt;++Ve){var Sn=Ve+xt-Kt/2,Cr;Gr(Sn<je),Gr(Sn+_r>=0),Cr=Sn<0?Fr[_r+Sn]:Oe[Ue+Sn],Ci+=Cr*Ke.blackfilt[Ii][Ve]}S[fe+Ot]=Ci}if(ze.num_used=Math.min(je,Kt+xt-Kt/2),Ke.itime[nt]+=ze.num_used-Ot*Ke.resample_ratio,ze.num_used>=_r)for(Ve=0;Ve<_r;Ve++)Fr[Ve]=Oe[Ue+ze.num_used+Ve-_r];else{var ii=_r-ze.num_used;for(Ve=0;Ve<ii;++Ve)Fr[Ve]=Fr[Ve+ze.num_used];for(xt=0;Ve<_r;++Ve,++xt)Fr[Ve]=Oe[Ue+xt];Gr(xt==ze.num_used)}return Ot}function Se(f,S,fe,_e,Oe,Ue){var je=f.internal_flags;if(je.resample_ratio<.9999||je.resample_ratio>1.0001)for(var ze=0;ze<je.channels_out;ze++){var nt=new E;Ue.n_out=j(f,S[ze],je.mf_size,f.framesize,fe[ze],_e,Oe,nt,ze),Ue.n_in=nt.num_used}else{Ue.n_out=Math.min(f.framesize,Oe),Ue.n_in=Ue.n_out;for(var Ke=0;Ke<Ue.n_out;++Ke)S[0][je.mf_size+Ke]=fe[0][_e+Ke],je.channels_out==2&&(S[1][je.mf_size+Ke]=fe[1][_e+Ke])}}}var vd=rr,Dn=P.VbrMode;function md(){function C(G,de,he,M,K,o,I,H,O,g,_,D,q,w,c){this.vbr_q=G,this.quant_comp=de,this.quant_comp_s=he,this.expY=M,this.st_lrm=K,this.st_s=o,this.masking_adj=I,this.masking_adj_short=H,this.ath_lower=O,this.ath_curve=g,this.ath_sensitivity=_,this.interch=D,this.safejoint=q,this.sfb21mod=w,this.msfix=c}function $(G,de,he,M,K,o,I,H,O,g,_,D,q,w){this.quant_comp=de,this.quant_comp_s=he,this.safejoint=M,this.nsmsfix=K,this.st_lrm=o,this.st_s=I,this.nsbass=H,this.scale=O,this.masking_adj=g,this.ath_lower=_,this.ath_curve=D,this.interch=q,this.sfscale=w}var ie;this.setModules=function(G){ie=G};var Z=[new C(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new C(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new C(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new C(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new C(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new C(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new C(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new C(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new C(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new C(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new C(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],ye=[new C(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new C(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new C(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new C(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new C(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new C(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new C(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new C(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new C(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new C(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new C(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function Q(G,de,he){var M=G.VBR==Dn.vbr_rh?Z:ye,K=G.VBR_q_frac,o=M[de],I=M[de+1],H=o;o.st_lrm=o.st_lrm+K*(I.st_lrm-o.st_lrm),o.st_s=o.st_s+K*(I.st_s-o.st_s),o.masking_adj=o.masking_adj+K*(I.masking_adj-o.masking_adj),o.masking_adj_short=o.masking_adj_short+K*(I.masking_adj_short-o.masking_adj_short),o.ath_lower=o.ath_lower+K*(I.ath_lower-o.ath_lower),o.ath_curve=o.ath_curve+K*(I.ath_curve-o.ath_curve),o.ath_sensitivity=o.ath_sensitivity+K*(I.ath_sensitivity-o.ath_sensitivity),o.interch=o.interch+K*(I.interch-o.interch),o.msfix=o.msfix+K*(I.msfix-o.msfix),De(G,H.vbr_q),he!=0?G.quant_comp=H.quant_comp:Math.abs(G.quant_comp- -1)>0||(G.quant_comp=H.quant_comp),he!=0?G.quant_comp_short=H.quant_comp_s:Math.abs(G.quant_comp_short- -1)>0||(G.quant_comp_short=H.quant_comp_s),H.expY!=0&&(G.experimentalY=H.expY!=0),he!=0?G.internal_flags.nsPsy.attackthre=H.st_lrm:Math.abs(G.internal_flags.nsPsy.attackthre- -1)>0||(G.internal_flags.nsPsy.attackthre=H.st_lrm),he!=0?G.internal_flags.nsPsy.attackthre_s=H.st_s:Math.abs(G.internal_flags.nsPsy.attackthre_s- -1)>0||(G.internal_flags.nsPsy.attackthre_s=H.st_s),he!=0?G.maskingadjust=H.masking_adj:Math.abs(G.maskingadjust-0)>0||(G.maskingadjust=H.masking_adj),he!=0?G.maskingadjust_short=H.masking_adj_short:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=H.masking_adj_short),he!=0?G.ATHlower=-H.ath_lower/10:Math.abs(-G.ATHlower*10-0)>0||(G.ATHlower=-H.ath_lower/10),he!=0?G.ATHcurve=H.ath_curve:Math.abs(G.ATHcurve- -1)>0||(G.ATHcurve=H.ath_curve),he!=0?G.athaa_sensitivity=H.ath_sensitivity:Math.abs(G.athaa_sensitivity- -1)>0||(G.athaa_sensitivity=H.ath_sensitivity),H.interch>0&&(he!=0?G.interChRatio=H.interch:Math.abs(G.interChRatio- -1)>0||(G.interChRatio=H.interch)),H.safejoint>0&&(G.exp_nspsytune=G.exp_nspsytune|H.safejoint),H.sfb21mod>0&&(G.exp_nspsytune=G.exp_nspsytune|H.sfb21mod<<20),he!=0?G.msfix=H.msfix:Math.abs(G.msfix- -1)>0||(G.msfix=H.msfix),he==0&&(G.VBR_q=de,G.VBR_q_frac=K)}var me=[new $(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new $(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new $(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new $(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new $(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new $(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new $(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new $(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new $(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new $(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new $(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new $(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new $(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new $(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new $(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new $(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new $(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function Ne(G,de,he){var M=de,K=ie.nearestBitrateFullIndex(de);if(G.VBR=Dn.vbr_abr,G.VBR_mean_bitrate_kbps=M,G.VBR_mean_bitrate_kbps=Math.min(G.VBR_mean_bitrate_kbps,320),G.VBR_mean_bitrate_kbps=Math.max(G.VBR_mean_bitrate_kbps,8),G.brate=G.VBR_mean_bitrate_kbps,G.VBR_mean_bitrate_kbps>320&&(G.disable_reservoir=!0),me[K].safejoint>0&&(G.exp_nspsytune=G.exp_nspsytune|2),me[K].sfscale>0&&(G.internal_flags.noise_shaping=2),Math.abs(me[K].nsbass)>0){var o=int(me[K].nsbass*4);o<0&&(o+=64),G.exp_nspsytune=G.exp_nspsytune|o<<2}return he!=0?G.quant_comp=me[K].quant_comp:Math.abs(G.quant_comp- -1)>0||(G.quant_comp=me[K].quant_comp),he!=0?G.quant_comp_short=me[K].quant_comp_s:Math.abs(G.quant_comp_short- -1)>0||(G.quant_comp_short=me[K].quant_comp_s),he!=0?G.msfix=me[K].nsmsfix:Math.abs(G.msfix- -1)>0||(G.msfix=me[K].nsmsfix),he!=0?G.internal_flags.nsPsy.attackthre=me[K].st_lrm:Math.abs(G.internal_flags.nsPsy.attackthre- -1)>0||(G.internal_flags.nsPsy.attackthre=me[K].st_lrm),he!=0?G.internal_flags.nsPsy.attackthre_s=me[K].st_s:Math.abs(G.internal_flags.nsPsy.attackthre_s- -1)>0||(G.internal_flags.nsPsy.attackthre_s=me[K].st_s),he!=0?G.scale=me[K].scale:Math.abs(G.scale- -1)>0||(G.scale=me[K].scale),he!=0?G.maskingadjust=me[K].masking_adj:Math.abs(G.maskingadjust-0)>0||(G.maskingadjust=me[K].masking_adj),me[K].masking_adj>0?he!=0?G.maskingadjust_short=me[K].masking_adj*.9:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=me[K].masking_adj*.9):he!=0?G.maskingadjust_short=me[K].masking_adj*1.1:Math.abs(G.maskingadjust_short-0)>0||(G.maskingadjust_short=me[K].masking_adj*1.1),he!=0?G.ATHlower=-me[K].ath_lower/10:Math.abs(-G.ATHlower*10-0)>0||(G.ATHlower=-me[K].ath_lower/10),he!=0?G.ATHcurve=me[K].ath_curve:Math.abs(G.ATHcurve- -1)>0||(G.ATHcurve=me[K].ath_curve),he!=0?G.interChRatio=me[K].interch:Math.abs(G.interChRatio- -1)>0||(G.interChRatio=me[K].interch),de}this.apply_preset=function(G,de,he){switch(de){case At.R3MIX:{de=At.V3,G.VBR=Dn.vbr_mtrh;break}case At.MEDIUM:{de=At.V4,G.VBR=Dn.vbr_rh;break}case At.MEDIUM_FAST:{de=At.V4,G.VBR=Dn.vbr_mtrh;break}case At.STANDARD:{de=At.V2,G.VBR=Dn.vbr_rh;break}case At.STANDARD_FAST:{de=At.V2,G.VBR=Dn.vbr_mtrh;break}case At.EXTREME:{de=At.V0,G.VBR=Dn.vbr_rh;break}case At.EXTREME_FAST:{de=At.V0,G.VBR=Dn.vbr_mtrh;break}case At.INSANE:return de=320,G.preset=de,Ne(G,de,he),G.VBR=Dn.vbr_off,de}switch(G.preset=de,de){case At.V9:return Q(G,9,he),de;case At.V8:return Q(G,8,he),de;case At.V7:return Q(G,7,he),de;case At.V6:return Q(G,6,he),de;case At.V5:return Q(G,5,he),de;case At.V4:return Q(G,4,he),de;case At.V3:return Q(G,3,he),de;case At.V2:return Q(G,2,he),de;case At.V1:return Q(G,1,he),de;case At.V0:return Q(G,0,he),de;default:break}return 8<=de&&de<=320?Ne(G,de,he):(G.preset=0,de)};function De(G,de){var he=0;return 0>de&&(he=-1,de=0),9<de&&(he=-1,de=9),G.VBR_q=de,G.VBR_q_frac=0,he}}var pd=md;function hd(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}var _d=hd;function Sd(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}var f0=Sd,Pc=P.new_float,gd=P.new_int;function bd(){this.global_gain=0,this.sfb_count1=0,this.step=gd(39),this.noise=Pc(39),this.noise_log=Pc(39)}var xd=bd,ni=P.System,Bc=P.VbrMode,d0=P.Util,ra=P.Arrays,ja=P.new_float,ln=P.assert;function yd(){var C;this.rv=null;var $;this.qupvt=null;var ie,Z=new _d,ye;this.setModules=function(O,g,_,D){C=O,$=g,this.rv=g,ie=_,this.qupvt=_,ye=D,Z.setModules(ie,ye)},this.ms_convert=function(O,g){for(var _=0;_<576;++_){var D=O.tt[g][0].xr[_],q=O.tt[g][1].xr[_];O.tt[g][0].xr[_]=(D+q)*(d0.SQRT2*.5),O.tt[g][1].xr[_]=(D-q)*(d0.SQRT2*.5)}};function Q(O,g,_,D){D=0;for(var q=0;q<=_;++q){var w=Math.abs(O.xr[q]);D+=w,g[q]=Math.sqrt(w*Math.sqrt(w)),g[q]>O.xrpow_max&&(O.xrpow_max=g[q])}return D}this.init_xrpow=function(O,g,_){var D=0,q=0|g.max_nonzero_coeff;if(ln(_!=null),g.xrpow_max=0,ln(0<=q&&q<=575),ra.fill(_,q,576,0),D=Q(g,_,q,D),D>1e-20){var w=0;(O.substep_shaping&2)!=0&&(w=1);for(var c=0;c<g.psymax;c++)O.pseudohalf[c]=w;return!0}return ra.fill(g.l3_enc,0,576,0),!1};function me(O,g){var _=O.ATH,D=g.xr;if(g.block_type!=T.SHORT_TYPE)for(var q=!1,w=T.PSFB21-1;w>=0&&!q;w--){var c=O.scalefac_band.psfb21[w],L=O.scalefac_band.psfb21[w+1],y=ie.athAdjust(_.adjust,_.psfb21[w],_.floor);O.nsPsy.longfact[21]>1e-12&&(y*=O.nsPsy.longfact[21]);for(var u=L-1;u>=c;u--)if(Math.abs(D[u])<y)D[u]=0;else{q=!0;break}}else for(var m=0;m<3;m++)for(var q=!1,w=T.PSFB12-1;w>=0&&!q;w--){var c=O.scalefac_band.s[12]*3+(O.scalefac_band.s[13]-O.scalefac_band.s[12])*m+(O.scalefac_band.psfb12[w]-O.scalefac_band.psfb12[0]),L=c+(O.scalefac_band.psfb12[w+1]-O.scalefac_band.psfb12[w]),b=ie.athAdjust(_.adjust,_.psfb12[w],_.floor);O.nsPsy.shortfact[12]>1e-12&&(b*=O.nsPsy.shortfact[12]);for(var u=L-1;u>=c;u--)if(Math.abs(D[u])<b)D[u]=0;else{q=!0;break}}}this.init_outer_loop=function(O,g){g.part2_3_length=0,g.big_values=0,g.count1=0,g.global_gain=210,g.scalefac_compress=0,g.table_select[0]=0,g.table_select[1]=0,g.table_select[2]=0,g.subblock_gain[0]=0,g.subblock_gain[1]=0,g.subblock_gain[2]=0,g.subblock_gain[3]=0,g.region0_count=0,g.region1_count=0,g.preflag=0,g.scalefac_scale=0,g.count1table_select=0,g.part2_length=0,g.sfb_lmax=T.SBPSY_l,g.sfb_smin=T.SBPSY_s,g.psy_lmax=O.sfb21_extra?T.SBMAX_l:T.SBPSY_l,g.psymax=g.psy_lmax,g.sfbmax=g.sfb_lmax,g.sfbdivide=11;for(var _=0;_<T.SBMAX_l;_++)g.width[_]=O.scalefac_band.l[_+1]-O.scalefac_band.l[_],g.window[_]=3;if(g.block_type==T.SHORT_TYPE){var D=ja(576);g.sfb_smin=0,g.sfb_lmax=0,g.mixed_block_flag!=0&&(g.sfb_smin=3,g.sfb_lmax=O.mode_gr*2+4),g.psymax=g.sfb_lmax+3*((O.sfb21_extra?T.SBMAX_s:T.SBPSY_s)-g.sfb_smin),g.sfbmax=g.sfb_lmax+3*(T.SBPSY_s-g.sfb_smin),g.sfbdivide=g.sfbmax-18,g.psy_lmax=g.sfb_lmax;var q=O.scalefac_band.l[g.sfb_lmax];ni.arraycopy(g.xr,0,D,0,576);for(var _=g.sfb_smin;_<T.SBMAX_s;_++)for(var w=O.scalefac_band.s[_],c=O.scalefac_band.s[_+1],L=0;L<3;L++)for(var y=w;y<c;y++)g.xr[q++]=D[3*y+L];for(var u=g.sfb_lmax,_=g.sfb_smin;_<T.SBMAX_s;_++)g.width[u]=g.width[u+1]=g.width[u+2]=O.scalefac_band.s[_+1]-O.scalefac_band.s[_],g.window[u]=0,g.window[u+1]=1,g.window[u+2]=2,u+=3}g.count1bits=0,g.sfb_partition_table=ie.nr_of_sfb_block[0][0],g.slen[0]=0,g.slen[1]=0,g.slen[2]=0,g.slen[3]=0,g.max_nonzero_coeff=575,ra.fill(g.scalefac,0),me(O,g)};function Ne(O){this.ordinal=O}Ne.BINSEARCH_NONE=new Ne(0),Ne.BINSEARCH_UP=new Ne(1),Ne.BINSEARCH_DOWN=new Ne(2);function De(O,g,_,D,q){var w,c=O.CurrentStep[D],L=!1,y=O.OldValue[D],u=Ne.BINSEARCH_NONE;for(g.global_gain=y,_-=g.part2_length,ln(c!=0);;){var m;if(w=ye.count_bits(O,q,g,null),c==1||w==_)break;w>_?(u==Ne.BINSEARCH_DOWN&&(L=!0),L&&(c/=2),u=Ne.BINSEARCH_UP,m=c):(u==Ne.BINSEARCH_UP&&(L=!0),L&&(c/=2),u=Ne.BINSEARCH_DOWN,m=-c),g.global_gain+=m,g.global_gain<0&&(g.global_gain=0,L=!0),g.global_gain>255&&(g.global_gain=255,L=!0)}for(ln(g.global_gain>=0),ln(g.global_gain<256);w>_&&g.global_gain<255;)g.global_gain++,w=ye.count_bits(O,q,g,null);return O.CurrentStep[D]=y-g.global_gain>=4?4:2,O.OldValue[D]=g.global_gain,g.part2_3_length=w,w}this.trancate_smallspectrums=function(O,g,_,D){var q=ja(xi.SFBMAX);if(!((O.substep_shaping&4)==0&&g.block_type==T.SHORT_TYPE||(O.substep_shaping&128)!=0)){ie.calc_noise(g,_,q,new f0,null);for(var c=0;c<576;c++){var w=0;g.l3_enc[c]!=0&&(w=Math.abs(g.xr[c])),D[c]=w}var c=0,L=8;g.block_type==T.SHORT_TYPE&&(L=6);do{var y,u,m,b,l=g.width[L];if(c+=l,!(q[L]>=1)&&(ra.sort(D,c-l,l),!Xn.EQ(D[c-1],0))){y=(1-q[L])*_[L],u=0,b=0;do{var h;for(m=1;b+m<l&&!Xn.NEQ(D[b+c-l],D[b+c+m-l]);m++);if(h=D[b+c-l]*D[b+c-l]*m,y<h){b!=0&&(u=D[b+c-l-1]);break}y-=h,b+=m}while(b<l);if(!Xn.EQ(u,0))do Math.abs(g.xr[c-l])<=u&&(g.l3_enc[c-l]=0);while(--l>0)}}while(++L<g.psymax);g.part2_3_length=ye.noquant_count_bits(O,g,null)}};function G(O){for(var g=0;g<O.sfbmax;g++)if(O.scalefac[g]+O.subblock_gain[O.window[g]]==0)return!1;return!0}function de(O){return d0.FAST_LOG10(.368+.632*O*O*O)}function he(O,g){for(var _=1e-37,D=0;D<g.psymax;D++)_+=de(O[D]);return Math.max(1e-20,_)}function M(O,g,_,D,q){var w;switch(O){default:case 9:{g.over_count>0?(w=_.over_SSD<=g.over_SSD,_.over_SSD==g.over_SSD&&(w=_.bits<g.bits)):w=_.max_noise<0&&_.max_noise*10+_.bits<=g.max_noise*10+g.bits;break}case 0:w=_.over_count<g.over_count||_.over_count==g.over_count&&_.over_noise<g.over_noise||_.over_count==g.over_count&&Xn.EQ(_.over_noise,g.over_noise)&&_.tot_noise<g.tot_noise;break;case 8:_.max_noise=he(q,D);case 1:w=_.max_noise<g.max_noise;break;case 2:w=_.tot_noise<g.tot_noise;break;case 3:w=_.tot_noise<g.tot_noise&&_.max_noise<g.max_noise;break;case 4:w=_.max_noise<=0&&g.max_noise>.2||_.max_noise<=0&&g.max_noise<0&&g.max_noise>_.max_noise-.2&&_.tot_noise<g.tot_noise||_.max_noise<=0&&g.max_noise>0&&g.max_noise>_.max_noise-.2&&_.tot_noise<g.tot_noise+g.over_noise||_.max_noise>0&&g.max_noise>-.05&&g.max_noise>_.max_noise-.1&&_.tot_noise+_.over_noise<g.tot_noise+g.over_noise||_.max_noise>0&&g.max_noise>-.1&&g.max_noise>_.max_noise-.15&&_.tot_noise+_.over_noise+_.over_noise<g.tot_noise+g.over_noise+g.over_noise;break;case 5:w=_.over_noise<g.over_noise||Xn.EQ(_.over_noise,g.over_noise)&&_.tot_noise<g.tot_noise;break;case 6:w=_.over_noise<g.over_noise||Xn.EQ(_.over_noise,g.over_noise)&&(_.max_noise<g.max_noise||Xn.EQ(_.max_noise,g.max_noise)&&_.tot_noise<=g.tot_noise);break;case 7:w=_.over_count<g.over_count||_.over_noise<g.over_noise;break}return g.over_count==0&&(w=w&&_.bits<g.bits),w}function K(O,g,_,D,q){var w=O.internal_flags,c;g.scalefac_scale==0?c=1.2968395546510096:c=1.6817928305074292;for(var L=0,y=0;y<g.sfbmax;y++)L<_[y]&&(L=_[y]);var u=w.noise_shaping_amp;switch(u==3&&(q?u=2:u=1),u){case 2:break;case 1:L>1?L=Math.pow(L,.5):L*=.95;break;case 0:default:L>1?L=1:L*=.95;break}for(var m=0,y=0;y<g.sfbmax;y++){var b=g.width[y],l;if(m+=b,!(_[y]<L)){if((w.substep_shaping&2)!=0&&(w.pseudohalf[y]=w.pseudohalf[y]==0?1:0,w.pseudohalf[y]==0&&w.noise_shaping_amp==2))return;for(g.scalefac[y]++,l=-b;l<0;l++)D[m+l]*=c,D[m+l]>g.xrpow_max&&(g.xrpow_max=D[m+l]);if(w.noise_shaping_amp==2)return}}}function o(O,g){for(var _=1.2968395546510096,D=0,q=0;q<O.sfbmax;q++){var w=O.width[q],c=O.scalefac[q];if(O.preflag!=0&&(c+=ie.pretab[q]),D+=w,(c&1)!=0){c++;for(var L=-w;L<0;L++)g[D+L]*=_,g[D+L]>O.xrpow_max&&(O.xrpow_max=g[D+L])}O.scalefac[q]=c>>1}O.preflag=0,O.scalefac_scale=1}function I(O,g,_){var D,q=g.scalefac;for(D=0;D<g.sfb_lmax;D++)if(q[D]>=16)return!0;for(var w=0;w<3;w++){var c=0,L=0;for(D=g.sfb_lmax+w;D<g.sfbdivide;D+=3)c<q[D]&&(c=q[D]);for(;D<g.sfbmax;D+=3)L<q[D]&&(L=q[D]);if(!(c<16&&L<8)){if(g.subblock_gain[w]>=7)return!0;g.subblock_gain[w]++;var y=O.scalefac_band.l[g.sfb_lmax];for(D=g.sfb_lmax+w;D<g.sfbmax;D+=3){var u,m=g.width[D],b=q[D];if(ln(b>=0),b=b-(4>>g.scalefac_scale),b>=0){q[D]=b,y+=m*3;continue}q[D]=0;{var l=210+(b<<g.scalefac_scale+1);u=ie.IPOW20(l)}y+=m*(w+1);for(var h=-m;h<0;h++)_[y+h]*=u,_[y+h]>g.xrpow_max&&(g.xrpow_max=_[y+h]);y+=m*(3-w-1)}{var u=ie.IPOW20(202);y+=g.width[D]*(w+1);for(var h=-g.width[D];h<0;h++)_[y+h]*=u,_[y+h]>g.xrpow_max&&(g.xrpow_max=_[y+h])}}}return!1}function H(O,g,_,D,q){var w=O.internal_flags;K(O,g,_,D,q);var c=G(g);return c?!1:(w.mode_gr==2?c=ye.scale_bitcount(g):c=ye.scale_bitcount_lsf(w,g),c?(w.noise_shaping>1&&(ra.fill(w.pseudohalf,0),g.scalefac_scale==0?(o(g,D),c=!1):g.block_type==T.SHORT_TYPE&&w.subblock_gain>0&&(c=I(w,g,D)||G(g))),c||(w.mode_gr==2?c=ye.scale_bitcount(g):c=ye.scale_bitcount_lsf(w,g)),!c):!0)}this.outer_loop=function(O,g,_,D,q,w){var c=O.internal_flags,L=new Oo,y=ja(576),u=ja(xi.SFBMAX),m=new f0,b,l=new xd,h=9999999,x=!1,E=!1,X=0;if(De(c,g,w,q,D),c.noise_shaping==0)return 100;ie.calc_noise(g,_,u,m,l),m.bits=g.part2_3_length,L.assign(g);var U=0;for(ni.arraycopy(D,0,y,0,576);!x;){do{var j=new f0,Se,f=255;if((c.substep_shaping&2)!=0?Se=20:Se=3,c.sfb21_extra&&(u[L.sfbmax]>1||L.block_type==T.SHORT_TYPE&&(u[L.sfbmax+1]>1||u[L.sfbmax+2]>1))||!H(O,L,u,D,E))break;L.scalefac_scale!=0&&(f=254);var S=w-L.part2_length;if(S<=0)break;for(;(L.part2_3_length=ye.count_bits(c,D,L,l))>S&&L.global_gain<=f;)L.global_gain++;if(L.global_gain>f)break;if(m.over_count==0){for(;(L.part2_3_length=ye.count_bits(c,D,L,l))>h&&L.global_gain<=f;)L.global_gain++;if(L.global_gain>f)break}if(ie.calc_noise(L,_,u,j,l),j.bits=L.part2_3_length,g.block_type!=T.SHORT_TYPE?b=O.quant_comp:b=O.quant_comp_short,b=M(b,m,j,L,u)?1:0,b!=0)h=g.part2_3_length,m=j,g.assign(L),U=0,ni.arraycopy(D,0,y,0,576);else if(c.full_outer_loop==0&&(++U>Se&&m.over_count==0||c.noise_shaping_amp==3&&E&&U>30||c.noise_shaping_amp==3&&E&&L.global_gain-X>15))break}while(L.global_gain+L.scalefac_scale<255);c.noise_shaping_amp==3?E?x=!0:(L.assign(g),ni.arraycopy(y,0,D,0,576),U=0,X=L.global_gain,E=!0):x=!0}return ln(g.global_gain+g.scalefac_scale<=255),O.VBR==Bc.vbr_rh||O.VBR==Bc.vbr_mtrh?ni.arraycopy(y,0,D,0,576):(c.substep_shaping&1)!=0&&trancate_smallspectrums(c,g,_,D),m.over_count},this.iteration_finish_one=function(O,g,_){var D=O.l3_side,q=D.tt[g][_];ye.best_scalefac_store(O,g,_,D),O.use_best_huffman==1&&ye.best_huffman_divide(O,q),$.ResvAdjust(O,q)},this.VBR_encode_granule=function(O,g,_,D,q,w,c){var L=O.internal_flags,y=new Oo,u=ja(576),m=c,b=c+1,l=(c+w)/2,h,x,E=0,X=L.sfb21_extra;ln(m<=LameInternalFlags.MAX_BITS_PER_CHANNEL),ra.fill(y.l3_enc,0);do ln(l>=w),ln(l<=c),ln(w<=c),l>m-42?L.sfb21_extra=!1:L.sfb21_extra=X,x=outer_loop(O,g,_,D,q,l),x<=0?(E=1,b=g.part2_3_length,y.assign(g),ni.arraycopy(D,0,u,0,576),c=b-32,h=c-w,l=(c+w)/2):(w=l+32,h=c-w,l=(c+w)/2,E!=0&&(E=2,g.assign(y),ni.arraycopy(u,0,D,0,576)));while(h>12);L.sfb21_extra=X,E==2&&ni.arraycopy(y.l3_enc,0,g.l3_enc,0,576),ln(g.part2_3_length<=m)},this.get_framebits=function(O,g){var _=O.internal_flags;_.bitrate_index=_.VBR_min_bitrate;var D=C.getframebits(O);_.bitrate_index=1,D=C.getframebits(O);for(var q=1;q<=_.VBR_max_bitrate;q++){_.bitrate_index=q;var w=new MeanBits(D);g[q]=$.ResvFrameBegin(O,w),D=w.bits}},this.VBR_old_prepare=function(O,g,_,D,q,w,c,L,y){var u=O.internal_flags,m,b=0,l=1,h=0;u.bitrate_index=u.VBR_max_bitrate;var x=$.ResvFrameBegin(O,new MeanBits(0))/u.mode_gr;get_framebits(O,w);for(var E=0;E<u.mode_gr;E++){var X=ie.on_pe(O,g,L[E],x,E,0);u.mode_ext==T.MPG_MD_MS_LR&&(ms_convert(u.l3_side,E),ie.reduce_side(L[E],_[E],x,X));for(var U=0;U<u.channels_out;++U){var j=u.l3_side.tt[E][U];j.block_type!=T.SHORT_TYPE?(b=1.28/(1+Math.exp(3.5-g[E][U]/300))-.05,m=u.PSY.mask_adjust-b):(b=2.56/(1+Math.exp(3.5-g[E][U]/300))-.14,m=u.PSY.mask_adjust_short-b),u.masking_lower=Math.pow(10,m*.1),init_outer_loop(u,j),y[E][U]=ie.calc_xmin(O,D[E][U],j,q[E][U]),y[E][U]!=0&&(l=0),c[E][U]=126,h+=L[E][U]}}for(var E=0;E<u.mode_gr;E++)for(var U=0;U<u.channels_out;U++)h>w[u.VBR_max_bitrate]&&(L[E][U]*=w[u.VBR_max_bitrate],L[E][U]/=h),c[E][U]>L[E][U]&&(c[E][U]=L[E][U]);return l},this.bitpressure_strategy=function(O,g,_,D){for(var q=0;q<O.mode_gr;q++)for(var w=0;w<O.channels_out;w++){for(var c=O.l3_side.tt[q][w],L=g[q][w],y=0,u=0;u<c.psy_lmax;u++)L[y++]*=1+.029*u*u/T.SBMAX_l/T.SBMAX_l;if(c.block_type==T.SHORT_TYPE)for(var u=c.sfb_smin;u<T.SBMAX_s;u++)L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s,L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s,L[y++]*=1+.029*u*u/T.SBMAX_s/T.SBMAX_s;D[q][w]=0|Math.max(_[q][w],.9*D[q][w])}},this.VBR_new_prepare=function(O,g,_,D,q,w){var c=O.internal_flags,L=1,y=0,u=0,m;if(O.free_format){c.bitrate_index=0;var b=new MeanBits(y);m=$.ResvFrameBegin(O,b),y=b.bits,q[0]=m}else{c.bitrate_index=c.VBR_max_bitrate;var b=new MeanBits(y);$.ResvFrameBegin(O,b),y=b.bits,get_framebits(O,q),m=q[c.VBR_max_bitrate]}for(var l=0;l<c.mode_gr;l++){ie.on_pe(O,g,w[l],y,l,0),c.mode_ext==T.MPG_MD_MS_LR&&ms_convert(c.l3_side,l);for(var h=0;h<c.channels_out;++h){var x=c.l3_side.tt[l][h];c.masking_lower=Math.pow(10,c.PSY.mask_adjust*.1),init_outer_loop(c,x),ie.calc_xmin(O,_[l][h],x,D[l][h])!=0&&(L=0),u+=w[l][h]}}for(var l=0;l<c.mode_gr;l++)for(var h=0;h<c.channels_out;h++)u>m&&(w[l][h]*=m,w[l][h]/=u);return L},this.calc_target_bits=function(O,g,_,D,q,w){var c=O.internal_flags,L=c.l3_side,y,u,m,b,l=0;c.bitrate_index=c.VBR_max_bitrate;var h=new MeanBits(l);for(w[0]=$.ResvFrameBegin(O,h),l=h.bits,c.bitrate_index=1,l=C.getframebits(O)-c.sideinfo_len*8,q[0]=l/(c.mode_gr*c.channels_out),l=O.VBR_mean_bitrate_kbps*O.framesize*1e3,(c.substep_shaping&1)!=0&&(l*=1.09),l/=O.out_samplerate,l-=c.sideinfo_len*8,l/=c.mode_gr*c.channels_out,y=.93+.07*(11-O.compression_ratio)/(11-5.5),y<.9&&(y=.9),y>1&&(y=1),u=0;u<c.mode_gr;u++){var x=0;for(m=0;m<c.channels_out;m++){if(D[u][m]=int(y*l),g[u][m]>700){var E=int((g[u][m]-700)/1.4),X=L.tt[u][m];D[u][m]=int(y*l),X.block_type==T.SHORT_TYPE&&E<l/2&&(E=l/2),E>l*3/2?E=l*3/2:E<0&&(E=0),D[u][m]+=E}D[u][m]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(D[u][m]=LameInternalFlags.MAX_BITS_PER_CHANNEL),x+=D[u][m]}if(x>LameInternalFlags.MAX_BITS_PER_GRANULE)for(m=0;m<c.channels_out;++m)D[u][m]*=LameInternalFlags.MAX_BITS_PER_GRANULE,D[u][m]/=x}if(c.mode_ext==T.MPG_MD_MS_LR)for(u=0;u<c.mode_gr;u++)ie.reduce_side(D[u],_[u],l*c.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(b=0,u=0;u<c.mode_gr;u++)for(m=0;m<c.channels_out;m++)D[u][m]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(D[u][m]=LameInternalFlags.MAX_BITS_PER_CHANNEL),b+=D[u][m];if(b>w[0])for(u=0;u<c.mode_gr;u++)for(m=0;m<c.channels_out;m++)D[u][m]*=w[0],D[u][m]/=b}}var Ed=yd,qo=P.assert;function wd(){var C;this.setModules=function($){C=$},this.ResvFrameBegin=function($,ie){var Z=$.internal_flags,ye,Q=Z.l3_side,me=C.getframebits($);ie.bits=(me-Z.sideinfo_len*8)/Z.mode_gr;var Ne=8*256*Z.mode_gr-8;$.brate>320?ye=8*int($.brate*1e3/($.out_samplerate/1152)/8+.5):(ye=8*1440,$.strict_ISO&&(ye=8*int(32e4/($.out_samplerate/1152)/8+.5))),Z.ResvMax=ye-me,Z.ResvMax>Ne&&(Z.ResvMax=Ne),(Z.ResvMax<0||$.disable_reservoir)&&(Z.ResvMax=0);var De=ie.bits*Z.mode_gr+Math.min(Z.ResvSize,Z.ResvMax);return De>ye&&(De=ye),qo(Z.ResvMax%8==0),qo(Z.ResvMax>=0),Q.resvDrain_pre=0,Z.pinfo!=null&&(Z.pinfo.mean_bits=ie.bits/2,Z.pinfo.resvsize=Z.ResvSize),De},this.ResvMaxBits=function($,ie,Z,ye){var Q=$.internal_flags,me,Ne=Q.ResvSize,De=Q.ResvMax;ye!=0&&(Ne+=ie),(Q.substep_shaping&1)!=0&&(De*=.9),Z.bits=ie,Ne*10>De*9?(me=Ne-De*9/10,Z.bits+=me,Q.substep_shaping|=128):(me=0,Q.substep_shaping&=127,!$.disable_reservoir&&(Q.substep_shaping&1)==0&&(Z.bits-=.1*ie));var G=Ne<Q.ResvMax*6/10?Ne:Q.ResvMax*6/10;return G-=me,G<0&&(G=0),G},this.ResvAdjust=function($,ie){$.ResvSize-=ie.part2_3_length+ie.part2_length},this.ResvFrameEnd=function($,ie){var Z,ye=$.l3_side;$.ResvSize+=ie*$.mode_gr;var Q=0;ye.resvDrain_post=0,ye.resvDrain_pre=0,(Z=$.ResvSize%8)!=0&&(Q+=Z),Z=$.ResvSize-Q-$.ResvMax,Z>0&&(qo(Z%8==0),qo(Z>=0),Q+=Z);{var me=Math.min(ye.main_data_begin*8,Q)/8;ye.resvDrain_pre+=8*me,Q-=8*me,$.ResvSize-=8*me,ye.main_data_begin-=me}ye.resvDrain_post+=Q,$.ResvSize-=Q}}var Rd=wd;function Td(){var C="http://www.mp3dev.org/",$=3,ie=98,Z=4,ye=0,Q=93;this.getLameVersion=function(){return $+"."+ie+"."+Z},this.getLameShortVersion=function(){return $+"."+ie+"."+Z},this.getLameVeryShortVersion=function(){return"LAME"+$+"."+ie+"r"},this.getPsyVersion=function(){return ye+"."+Q},this.getLameUrl=function(){return C},this.getLameOsBitness=function(){return"32bits"}}var Ad=Td,Id=P.System,v0=P.VbrMode,Nc=P.ShortBlock,Cd=P.Arrays,zo=P.new_byte,Md=P.assert;Ga.NUMTOCENTRIES=100,Ga.MAXFRAMESIZE=2880;function Ga(){var C,$,ie;this.setModules=function(l,h,x){C=l,$=h,ie=x};var Z=1,ye=2,Q=4,me=8,Ne=Ga.NUMTOCENTRIES,De=Ga.MAXFRAMESIZE,G=Ne+4+4+4+4+4,de=G+9+1+1+8+1+1+3+1+1+2+4+2+2,he=128,M=64,K=32,o=null,I="Xing",H="Info",O=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function g(l,h){if(l.nVbrNumFrames++,l.sum+=h,l.seen++,!(l.seen<l.want)&&(l.pos<l.size&&(l.bag[l.pos]=l.sum,l.pos++,l.seen=0),l.pos==l.size)){for(var x=1;x<l.size;x+=2)l.bag[x/2]=l.bag[x];l.want*=2,l.pos/=2}}function _(l,h){if(!(l.pos<=0))for(var x=1;x<Ne;++x){var E=x/Ne,X,U,j=0|Math.floor(E*l.pos);j>l.pos-1&&(j=l.pos-1),X=l.bag[j],U=l.sum;var Se=0|256*X/U;Se>255&&(Se=255),h[x]=255&Se}}this.addVbrFrame=function(l){var h=l.internal_flags,x=Tables.bitrate_table[l.version][h.bitrate_index];Md(h.VBR_seek_table.bag!=null),g(h.VBR_seek_table,x)};function D(l,h){var x=l[h+0]&255;return x<<=8,x|=l[h+1]&255,x<<=8,x|=l[h+2]&255,x<<=8,x|=l[h+3]&255,x}function q(l,h,x){l[h+0]=255&(x>>24&255),l[h+1]=255&(x>>16&255),l[h+2]=255&(x>>8&255),l[h+3]=255&(x&255)}function w(l,h,x){l[h+0]=255&(x>>8&255),l[h+1]=255&(x&255)}function c(l,h){return new String(l,h,I.length(),o).equals(I)||new String(l,h,H.length(),o).equals(H)}function L(l,h,x){return 255&(l<<h|x&~(-1<<h))}function y(l,h){var x=l.internal_flags;h[0]=L(h[0],8,255),h[1]=L(h[1],3,7),h[1]=L(h[1],1,l.out_samplerate<16e3?0:1),h[1]=L(h[1],1,l.version),h[1]=L(h[1],2,4-3),h[1]=L(h[1],1,l.error_protection?0:1),h[2]=L(h[2],4,x.bitrate_index),h[2]=L(h[2],2,x.samplerate_index),h[2]=L(h[2],1,0),h[2]=L(h[2],1,l.extension),h[3]=L(h[3],2,l.mode.ordinal()),h[3]=L(h[3],2,x.mode_ext),h[3]=L(h[3],1,l.copyright),h[3]=L(h[3],1,l.original),h[3]=L(h[3],2,l.emphasis),h[0]=255;var E=255&(h[1]&241),X;l.version==1?X=he:l.out_samplerate<16e3?X=K:X=M,l.VBR==v0.vbr_off&&(X=l.brate);var U;l.free_format?U=0:U=255&16*C.BitrateIndex(X,l.version,l.out_samplerate),l.version==1?(h[1]=255&(E|10),E=255&(h[2]&13),h[2]=255&(U|E)):(h[1]=255&(E|2),E=255&(h[2]&13),h[2]=255&(U|E))}this.getVbrTag=function(l){var h=new VBRTagData,x=0;h.flags=0;var E=l[x+1]>>3&1,X=l[x+2]>>2&3,U=l[x+3]>>6&3,j=l[x+2]>>4&15;if(j=Tables.bitrate_table[E][j],l[x+1]>>4==14?h.samprate=Tables.samplerate_table[2][X]:h.samprate=Tables.samplerate_table[E][X],E!=0?U!=3?x+=32+4:x+=17+4:U!=3?x+=17+4:x+=9+4,!c(l,x))return null;x+=4,h.hId=E;var Se=h.flags=D(l,x);if(x+=4,(Se&Z)!=0&&(h.frames=D(l,x),x+=4),(Se&ye)!=0&&(h.bytes=D(l,x),x+=4),(Se&Q)!=0){if(h.toc!=null)for(var f=0;f<Ne;f++)h.toc[f]=l[x+f];x+=Ne}h.vbrScale=-1,(Se&me)!=0&&(h.vbrScale=D(l,x),x+=4),h.headersize=(E+1)*72e3*j/h.samprate,x+=21;var S=l[x+0]<<4;S+=l[x+1]>>4;var fe=(l[x+1]&15)<<8;return fe+=l[x+2]&255,(S<0||S>3e3)&&(S=-1),(fe<0||fe>3e3)&&(fe=-1),h.encDelay=S,h.encPadding=fe,h},this.InitVbrTag=function(l){var h=l.internal_flags,x;l.version==1?x=he:l.out_samplerate<16e3?x=K:x=M,l.VBR==v0.vbr_off&&(x=l.brate);var E=(l.version+1)*72e3*x/l.out_samplerate,X=h.sideinfo_len+de;if(h.VBR_seek_table.TotalFrameSize=E,E<X||E>De){l.bWriteVbrTag=!1;return}h.VBR_seek_table.nVbrNumFrames=0,h.VBR_seek_table.nBytesWritten=0,h.VBR_seek_table.sum=0,h.VBR_seek_table.seen=0,h.VBR_seek_table.want=1,h.VBR_seek_table.pos=0,h.VBR_seek_table.bag==null&&(h.VBR_seek_table.bag=new int[400],h.VBR_seek_table.size=400);var U=zo(De);y(l,U);for(var j=h.VBR_seek_table.TotalFrameSize,Se=0;Se<j;++Se)$.add_dummy_byte(l,U[Se]&255,1)};function u(l,h){var x=h^l;return h=h>>8^O[x&255],h}this.updateMusicCRC=function(l,h,x,E){for(var X=0;X<E;++X)l[0]=u(h[x+X],l[0])};function m(l,h,x,E,X){var U=l.internal_flags,j=0,Se=l.encoder_delay,f=l.encoder_padding,S=100-10*l.VBR_q-l.quality,fe=ie.getLameVeryShortVersion(),_e,Oe=0,Ue,je=[1,5,3,2,4,0,3],ze=0|(l.lowpassfreq/100+.5>255?255:l.lowpassfreq/100+.5),nt=0,Ke=0,Ve=0,xt=l.internal_flags.noise_shaping,Ot=0,Rt=0,Lt=0,jt=0,Kt=0,_r=(l.exp_nspsytune&1)!=0,Ln=(l.exp_nspsytune&2)!=0,Lr=!1,Fr=!1,_n=l.internal_flags.nogap_total,Ii=l.internal_flags.nogap_current,Ci=l.ATHtype,Sn=0,Cr;switch(l.VBR){case vbr_abr:Cr=l.VBR_mean_bitrate_kbps;break;case vbr_off:Cr=l.brate;break;default:Cr=l.VBR_min_bitrate_kbps}switch(l.VBR.ordinal()<je.length?_e=je[l.VBR.ordinal()]:_e=0,Ue=16*Oe+_e,U.findReplayGain&&(U.RadioGain>510&&(U.RadioGain=510),U.RadioGain<-510&&(U.RadioGain=-510),Ke=8192,Ke|=3072,U.RadioGain>=0?Ke|=U.RadioGain:(Ke|=512,Ke|=-U.RadioGain)),U.findPeakSample&&(nt=Math.abs(0|U.PeakSample/32767*Math.pow(2,23)+.5)),_n!=-1&&(Ii>0&&(Fr=!0),Ii<_n-1&&(Lr=!0)),Sn=Ci+((_r?1:0)<<4)+((Ln?1:0)<<5)+((Lr?1:0)<<6)+((Fr?1:0)<<7),S<0&&(S=0),l.mode){case MONO:Ot=0;break;case STEREO:Ot=1;break;case DUAL_CHANNEL:Ot=2;break;case JOINT_STEREO:l.force_ms?Ot=4:Ot=3;break;case NOT_SET:default:Ot=7;break}l.in_samplerate<=32e3?Lt=0:l.in_samplerate==48e3?Lt=2:l.in_samplerate>48e3?Lt=3:Lt=1,(l.short_blocks==Nc.short_block_forced||l.short_blocks==Nc.short_block_dispensed||l.lowpassfreq==-1&&l.highpassfreq==-1||l.scale_left<l.scale_right||l.scale_left>l.scale_right||l.disable_reservoir&&l.brate<320||l.noATH||l.ATHonly||Ci==0||l.in_samplerate<=32e3)&&(Rt=1),jt=xt+(Ot<<2)+(Rt<<5)+(Lt<<6),Kt=U.nMusicCRC,q(x,E+j,S),j+=4;for(var ii=0;ii<9;ii++)x[E+j+ii]=255&fe.charAt(ii);j+=9,x[E+j]=255&Ue,j++,x[E+j]=255&ze,j++,q(x,E+j,nt),j+=4,w(x,E+j,Ke),j+=2,w(x,E+j,Ve),j+=2,x[E+j]=255&Sn,j++,Cr>=255?x[E+j]=255:x[E+j]=255&Cr,j++,x[E+j]=255&Se>>4,x[E+j+1]=255&(Se<<4)+(f>>8),x[E+j+2]=255&f,j+=3,x[E+j]=255&jt,j++,x[E+j++]=0,w(x,E+j,l.preset),j+=2,q(x,E+j,h),j+=4,w(x,E+j,Kt),j+=2;for(var Ka=0;Ka<j;Ka++)X=u(x[E+Ka],X);return w(x,E+j,X),j+=2,j}function b(l){l.seek(0);var h=zo(10);l.readFully(h);var x;return new String(h,"ISO-8859-1").startsWith("ID3")?x=0:x=((h[6]&127)<<21|(h[7]&127)<<14|(h[8]&127)<<7|h[9]&127)+h.length,x}this.getLameTagFrame=function(l,h){var x=l.internal_flags;if(!l.bWriteVbrTag||x.Class_ID!=At.LAME_ID||x.VBR_seek_table.pos<=0)return 0;if(h.length<x.VBR_seek_table.TotalFrameSize)return x.VBR_seek_table.TotalFrameSize;Cd.fill(h,0,x.VBR_seek_table.TotalFrameSize,0),y(l,h);var E=zo(Ne);if(l.free_format)for(var X=1;X<Ne;++X)E[X]=255&255*X/100;else _(x.VBR_seek_table,E);var U=x.sideinfo_len;l.error_protection&&(U-=2),l.VBR==v0.vbr_off?(h[U++]=255&H.charAt(0),h[U++]=255&H.charAt(1),h[U++]=255&H.charAt(2),h[U++]=255&H.charAt(3)):(h[U++]=255&I.charAt(0),h[U++]=255&I.charAt(1),h[U++]=255&I.charAt(2),h[U++]=255&I.charAt(3)),q(h,U,Z+ye+Q+me),U+=4,q(h,U,x.VBR_seek_table.nVbrNumFrames),U+=4;var j=x.VBR_seek_table.nBytesWritten+x.VBR_seek_table.TotalFrameSize;q(h,U,0|j),U+=4,Id.arraycopy(E,0,h,U,E.length),U+=E.length,l.error_protection&&$.CRC_writeheader(x,h);for(var Se=0,X=0;X<U;X++)Se=u(h[X],Se);return U+=m(l,j,h,U,Se),x.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(l,h){var x=l.internal_flags;if(x.VBR_seek_table.pos<=0||(h.seek(h.length()),h.length()==0))return-1;var E=b(h);h.seek(E);var X=zo(De),U=getLameTagFrame(l,X);return U>X.length?-1:(U<1||h.write(X,0,U),0)}}var Pd=Ga,kc=P.new_byte,Dc=P.assert,At=vd,Bd=pd,Xa=Ir,Nd=ti,kd=Ed,Dd=c0,Od=Rd,nr=ea,Xn=ri;function Ld(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}function Fd(){var C,$,ie;this.setModules=function(Z,ye,Q){C=Z,$=ye,ie=Q}}function Ud(){}function Hd(){var C,$;this.setModules=function(ie,Z){C=ie,$=Z}}function Vd(C,$,ie){arguments.length!=3&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),C=1,$=44100,ie=128);var Z=new At,ye=new Ld,Q=new Xa,me=new Xn,Ne=new Bd,De=new Nd,G=new kd,de=new Pd,he=new Ad,M=new Hd,K=new Od,o=new Dd,I=new Fd,H=new Ud;Z.setModules(Q,me,Ne,De,G,de,he,M,H),me.setModules(Q,H,he,de),M.setModules(me,he),Ne.setModules(Z),G.setModules(me,K,De,o),De.setModules(o,K,Z.enc.psy),K.setModules(me),o.setModules(De),de.setModules(Z,me,he),ye.setModules(I,H),I.setModules(he,M,Ne);var O=Z.lame_init();O.num_channels=C,O.in_samplerate=$,O.brate=ie,O.mode=nr.STEREO,O.quality=3,O.bWriteVbrTag=!1,O.disable_reservoir=!0,O.write_id3tag_automatic=!1;var g=Z.lame_init_params(O);Dc(g==0);var _=1152,D=0|1.25*_+7200,q=kc(D);this.encodeBuffer=function(w,c){C==1&&(c=w),Dc(w.length==c.length),w.length>_&&(_=w.length,D=0|1.25*_+7200,q=kc(D));var L=Z.lame_encode_buffer(O,w,c,w.length,q,0,D);return new Int8Array(q.subarray(0,L))},this.flush=function(){var w=Z.lame_encode_flush(O,q,0,D);return new Int8Array(q.subarray(0,w))}}function On(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function jo(C){return C.charCodeAt(0)<<24|C.charCodeAt(1)<<16|C.charCodeAt(2)<<8|C.charCodeAt(3)}On.RIFF=jo("RIFF"),On.WAVE=jo("WAVE"),On.fmt_=jo("fmt "),On.data=jo("data"),On.readHeader=function(C){var $=new On,ie=C.getUint32(0,!1);if(On.RIFF==ie){var Z=C.getUint32(4,!0);if(On.WAVE==C.getUint32(8,!1)&&On.fmt_==C.getUint32(12,!1)){var ye=C.getUint32(16,!0),Q=16+4;switch(ye){case 16:case 18:$.channels=C.getUint16(Q+2,!0),$.sampleRate=C.getUint32(Q+4,!0);break;default:throw"extended fmt chunk not implemented"}Q+=ye;for(var me=On.data,Ne=0;me!=ie&&(ie=C.getUint32(Q,!1),Ne=C.getUint32(Q+4,!0),me!=ie);)Q+=Ne+8;return $.dataLen=Ne,$.dataOffset=Q+8,$}}};var qd=Vd,Oc=function(C,$){if(!(C instanceof $))throw new TypeError("Cannot call a class as a function")},Lc=function(){function C($,ie){for(var Z=0;Z<ie.length;Z++){var ye=ie[Z];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty($,ye.key,ye)}}return function($,ie,Z){return ie&&C($.prototype,ie),Z&&C($,Z),$}}(),zd=function(){function C($){Oc(this,C),this.config={sampleRate:44100,bitRate:128},Object.assign(this.config,$),this.mp3Encoder=new qd(1,this.config.sampleRate,this.config.bitRate),this.maxSamples=1152,this.samplesMono=null,this.clearBuffer()}return Lc(C,[{key:"clearBuffer",value:function(){this.dataBuffer=[]}},{key:"appendToBuffer",value:function(ie){this.dataBuffer.push(new Int8Array(ie))}},{key:"floatTo16BitPCM",value:function(ie,Z){for(var ye=0;ye<ie.length;ye++){var Q=Math.max(-1,Math.min(1,ie[ye]));Z[ye]=Q<0?Q*32768:Q*32767}}},{key:"convertBuffer",value:function(ie){var Z=new Float32Array(ie),ye=new Int16Array(ie.length);return this.floatTo16BitPCM(Z,ye),ye}},{key:"encode",value:function(ie){this.samplesMono=this.convertBuffer(ie);for(var Z=this.samplesMono.length,ye=0;Z>=0;ye+=this.maxSamples){var Q=this.samplesMono.subarray(ye,ye+this.maxSamples),me=this.mp3Encoder.encodeBuffer(Q);this.appendToBuffer(me),Z-=this.maxSamples}}},{key:"finish",value:function(){return this.appendToBuffer(this.mp3Encoder.flush()),this.dataBuffer}}]),C}(),jd=function(){function C($){Oc(this,C),this.config={bitRate:128,startRecordingAt:300,deviceId:null},this.activeStream=null,this.context=null,this.microphone=null,this.processor=null,this.startTime=0,Object.assign(this.config,$)}return Lc(C,[{key:"addMicrophoneListener",value:function(ie){var Z=this;this.activeStream=ie,this.timerToStart=setTimeout(function(){delete Z.timerToStart},this.config.startRecordingAt),this.microphone=this.context.createMediaStreamSource(ie),this.processor=this.context.createScriptProcessor(0,1,1),this.processor.onaudioprocess=function(ye){Z.timerToStart||Z.lameEncoder.encode(ye.inputBuffer.getChannelData(0))},this.microphone.connect(this.processor),this.processor.connect(this.context.destination)}},{key:"stop",value:function(){return this.processor&&this.microphone&&(this.microphone.disconnect(),this.processor.disconnect(),this.context&&this.context.state!=="closed"&&this.context.close(),this.processor.onaudioprocess=null,this.activeStream.getAudioTracks().forEach(function(ie){return ie.stop()})),this}},{key:"start",value:function(){var ie=this,Z=window.AudioContext||window.webkitAudioContext;this.context=new Z,this.config.sampleRate=this.context.sampleRate,this.lameEncoder=new zd(this.config);var ye=this.config.deviceId?{deviceId:{exact:this.config.deviceId}}:!0;return new Promise(function(Q,me){navigator.mediaDevices.getUserMedia({audio:ye}).then(function(Ne){ie.addMicrophoneListener(Ne),Q(Ne)}).catch(function(Ne){me(Ne)})})}},{key:"getMp3",value:function(){var ie=this,Z=this.lameEncoder.finish();return new Promise(function(ye,Q){Z.length===0?Q(new Error("No buffer to send")):(ye([Z,new Blob(Z,{type:"audio/mp3"})]),ie.lameEncoder.clearBuffer())})}}]),C}();return jd})});async function Ko(){try{let t={audio:!0,video:!0};return(await navigator.mediaDevices.getUserMedia(t)).getTracks().forEach(r=>{r.stop()}),!0}catch{return!1}}async function Wo(){return new Promise((t,e)=>{typeof PresentationRequest>"u"&&t(!1),new PresentationRequest("receiver.html").getAvailability().then(n=>{let i=n.value;n.addEventListener("change",function(){i=n.value}),setTimeout(()=>{t(i)},1e3)}).catch(n=>e(n))})}async function xn(){let t=await navigator.mediaDevices.enumerateDevices();return{cameras:t.filter(r=>r.kind=="videoinput"&&r.deviceId).map(r=>({label:r.label||"Generic Device",id:r.deviceId})),microphones:t.filter(r=>r.kind=="audioinput"&&r.deviceId).map(r=>({label:r.label||"Generic Device",id:r.deviceId}))}}var Yo=class{constructor(e){this.sessionDuration=0;this.id=e,this.state="Created",this.startedAt=new Date,this.alerts=[],this.recordings=[]}get hasSomethingToUpload(){for(let e of this.recordings)if(!e.upload)return!0;return!1}start(){this.state="Recording",this.startedAt=new Date(Date.now())}pause(){this.state="Paused"}resume(){this.state="Recording"}stop(){this.state="Ended",this.sessionDuration=Date.now()-this.startedAt.getTime()}setEndConfirmed(){this.state="EndConfirmed"}setUploaded(){this.state="Uploaded"}setUploadConfirmed(){this.state="UploadConfirmed"}addAlert(e){this.alerts.push(e)}addRecording(e){this.recordings.push(e)}};function Qa(t,e,r=!1){let n,i={mimeType:"video/webm;codecs=vp9",videoBitsPerSecond:128e3,audioBitsPerSecond:64e3};r&&(i={mimeType:"audio/webm",audioBitsPerSecond:64*1e3});let a=new MediaRecorder(t,i);a.ondataavailable=B=>{B.data.size>0&&e.push(B.data),r&&a.state=="inactive"&&(e=[new Blob(e,{type:"audio/mpeg-3"})]),n&&n()};function s(){return new Promise(B=>{n=B,a.start()})}function v(){return new Promise(B=>{a.state=="recording"?(n=B,a.stop(),t.getTracks().forEach(z=>{z.stop()})):B()})}function d(){return new Promise(B=>{a.state=="recording"&&a.pause(),B()})}function p(){return new Promise(B=>{a.state=="paused"&&a.resume(),B()})}return{startRecording:s,stopRecording:v,pauseRecording:d,resumeRecording:p}}function Ja(t,e){return function(){return t.apply(e,arguments)}}var{toString:$c}=Object.prototype,{getPrototypeOf:w0}=Object,R0=(t=>e=>{let r=$c.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Kn=t=>(t=t.toLowerCase(),e=>R0(e)===t),Zo=t=>e=>typeof e===t,{isArray:eo}=Array,y0=Zo("undefined");function Jd(t){return t!==null&&!y0(t)&&t.constructor!==null&&!y0(t.constructor)&&aa(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var Zc=Kn("ArrayBuffer");function e2(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Zc(t.buffer),e}var t2=Zo("string"),aa=Zo("function"),Qc=Zo("number"),Jc=t=>t!==null&&typeof t=="object",r2=t=>t===!0||t===!1,$o=t=>{if(R0(t)!=="object")return!1;let e=w0(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},n2=Kn("Date"),i2=Kn("File"),a2=Kn("Blob"),o2=Kn("FileList"),s2=t=>Jc(t)&&aa(t.pipe),l2=t=>{let e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||$c.call(t)===e||aa(t.toString)&&t.toString()===e)},c2=Kn("URLSearchParams"),u2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Qo(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),eo(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{let a=r?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length,v;for(n=0;n<s;n++)v=a[n],e.call(null,t[v],v,t)}}function E0(){let t={},e=(r,n)=>{$o(t[n])&&$o(r)?t[n]=E0(t[n],r):$o(r)?t[n]=E0({},r):eo(r)?t[n]=r.slice():t[n]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&Qo(arguments[r],e);return t}var f2=(t,e,r,{allOwnKeys:n}={})=>(Qo(e,(i,a)=>{r&&aa(i)?t[a]=Ja(i,r):t[a]=i},{allOwnKeys:n}),t),d2=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),v2=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},m2=(t,e,r,n)=>{let i,a,s,v={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)s=i[a],(!n||n(s,t,e))&&!v[s]&&(e[s]=t[s],v[s]=!0);t=r!==!1&&w0(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},p2=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let n=t.indexOf(e,r);return n!==-1&&n===r},h2=t=>{if(!t)return null;if(eo(t))return t;let e=t.length;if(!Qc(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},_2=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&w0(Uint8Array)),S2=(t,e)=>{let n=(t&&t[Symbol.iterator]).call(t),i;for(;(i=n.next())&&!i.done;){let a=i.value;e.call(t,a[0],a[1])}},g2=(t,e)=>{let r,n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},b2=Kn("HTMLFormElement"),x2=t=>t.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Yc=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),y2=Kn("RegExp"),e1=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),n={};Qo(r,(i,a)=>{e(i,a,t)!==!1&&(n[a]=i)}),Object.defineProperties(t,n)},E2=t=>{e1(t,(e,r)=>{let n=t[r];if(!!aa(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not read-only method '"+r+"'")})}})},w2=(t,e)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return eo(t)?n(t):n(String(t).split(e)),r},R2=()=>{},T2=(t,e)=>(t=+t,Number.isFinite(t)?t:e),ge={isArray:eo,isArrayBuffer:Zc,isBuffer:Jd,isFormData:l2,isArrayBufferView:e2,isString:t2,isNumber:Qc,isBoolean:r2,isObject:Jc,isPlainObject:$o,isUndefined:y0,isDate:n2,isFile:i2,isBlob:a2,isRegExp:y2,isFunction:aa,isStream:s2,isURLSearchParams:c2,isTypedArray:_2,isFileList:o2,forEach:Qo,merge:E0,extend:f2,trim:u2,stripBOM:d2,inherits:v2,toFlatObject:m2,kindOf:R0,kindOfTest:Kn,endsWith:p2,toArray:h2,forEachEntry:S2,matchAll:g2,isHTMLForm:b2,hasOwnProperty:Yc,hasOwnProp:Yc,reduceDescriptors:e1,freezeMethods:E2,toObjectSet:w2,toCamelCase:x2,noop:R2,toFiniteNumber:T2};function oa(t,e,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}ge.inherits(oa,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var t1=oa.prototype,r1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{r1[t]={value:t}});Object.defineProperties(oa,r1);Object.defineProperty(t1,"isAxiosError",{value:!0});oa.from=(t,e,r,n,i,a)=>{let s=Object.create(t1);return ge.toFlatObject(t,s,function(d){return d!==Error.prototype},v=>v!=="isAxiosError"),oa.call(s,t.message,e,r,n,i),s.cause=t,s.name=t.name,a&&Object.assign(s,a),s};var wt=oa;var a1=Qd(i1(),1),o1=a1.default;function T0(t){return ge.isPlainObject(t)||ge.isArray(t)}function l1(t){return ge.endsWith(t,"[]")?t.slice(0,-2):t}function s1(t,e,r){return t?t.concat(e).map(function(i,a){return i=l1(i),!r&&a?"["+i+"]":i}).join(r?".":""):e}function A2(t){return ge.isArray(t)&&!t.some(T0)}var I2=ge.toFlatObject(ge,{},null,function(e){return/^is[A-Z]/.test(e)});function C2(t){return t&&ge.isFunction(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator]}function M2(t,e,r){if(!ge.isObject(t))throw new TypeError("target must be an object");e=e||new(o1||FormData),r=ge.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ce,P){return!ge.isUndefined(P[ce])});let n=r.metaTokens,i=r.visitor||B,a=r.dots,s=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&C2(e);if(!ge.isFunction(i))throw new TypeError("visitor must be a function");function p(k){if(k===null)return"";if(ge.isDate(k))return k.toISOString();if(!d&&ge.isBlob(k))throw new wt("Blob is not supported. Use a Buffer instead.");return ge.isArrayBuffer(k)||ge.isTypedArray(k)?d&&typeof Blob=="function"?new Blob([k]):Buffer.from(k):k}function B(k,ce,P){let oe=k;if(k&&!P&&typeof k=="object"){if(ge.endsWith(ce,"{}"))ce=n?ce:ce.slice(0,-2),k=JSON.stringify(k);else if(ge.isArray(k)&&A2(k)||ge.isFileList(k)||ge.endsWith(ce,"[]")&&(oe=ge.toArray(k)))return ce=l1(ce),oe.forEach(function(xe,Ge){!(ge.isUndefined(xe)||xe===null)&&e.append(s===!0?s1([ce],Ge,a):s===null?ce:ce+"[]",p(xe))}),!1}return T0(k)?!0:(e.append(s1(P,ce,a),p(k)),!1)}let z=[],ee=Object.assign(I2,{defaultVisitor:B,convertValue:p,isVisitable:T0});function te(k,ce){if(!ge.isUndefined(k)){if(z.indexOf(k)!==-1)throw Error("Circular reference detected in "+ce.join("."));z.push(k),ge.forEach(k,function(oe,se){(!(ge.isUndefined(oe)||oe===null)&&i.call(e,oe,ge.isString(se)?se.trim():se,ce,ee))===!0&&te(oe,ce?ce.concat(se):[se])}),z.pop()}}if(!ge.isObject(t))throw new TypeError("data must be an object");return te(t),e}var oi=M2;function c1(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function u1(t,e){this._pairs=[],t&&oi(t,this,e)}var f1=u1.prototype;f1.append=function(e,r){this._pairs.push([e,r])};f1.toString=function(e){let r=e?function(n){return e.call(this,n,c1)}:c1;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var Jo=u1;function P2(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function to(t,e,r){if(!e)return t;let n=r&&r.encode||P2,i=r&&r.serialize,a;if(i?a=i(e,r):a=ge.isURLSearchParams(e)?e.toString():new Jo(e,r).toString(n),a){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}var A0=class{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ge.forEach(this.handlers,function(n){n!==null&&e(n)})}},I0=A0;var es={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var d1=typeof URLSearchParams<"u"?URLSearchParams:Jo;var v1=FormData;var B2=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Mr={isBrowser:!0,classes:{URLSearchParams:d1,FormData:v1,Blob},isStandardBrowserEnv:B2,protocols:["http","https","file","blob","url","data"]};function C0(t,e){return oi(t,new Mr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,a){return Mr.isNode&&ge.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function N2(t){return ge.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function k2(t){let e={},r=Object.keys(t),n,i=r.length,a;for(n=0;n<i;n++)a=r[n],e[a]=t[a];return e}function D2(t){function e(r,n,i,a){let s=r[a++],v=Number.isFinite(+s),d=a>=r.length;return s=!s&&ge.isArray(i)?i.length:s,d?(ge.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!v):((!i[s]||!ge.isObject(i[s]))&&(i[s]=[]),e(r,n,i[s],a)&&ge.isArray(i[s])&&(i[s]=k2(i[s])),!v)}if(ge.isFormData(t)&&ge.isFunction(t.entries)){let r={};return ge.forEachEntry(t,(n,i)=>{e(N2(n),i,r,0)}),r}return null}var ts=D2;function M0(t,e,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new wt("Request failed with status code "+r.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}var m1=Mr.isStandardBrowserEnv?function(){return{write:function(r,n,i,a,s,v){let d=[];d.push(r+"="+encodeURIComponent(n)),ge.isNumber(i)&&d.push("expires="+new Date(i).toGMTString()),ge.isString(a)&&d.push("path="+a),ge.isString(s)&&d.push("domain="+s),v===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(r){let n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function P0(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function B0(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function ro(t,e){return t&&!P0(e)?B0(t,e):e}var p1=Mr.isStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function i(a){let s=a;return e&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(s){let v=ge.isString(s)?i(s):s;return v.protocol===n.protocol&&v.host===n.host}}():function(){return function(){return!0}}();function h1(t,e,r){wt.call(this,t??"canceled",wt.ERR_CANCELED,e,r),this.name="CanceledError"}ge.inherits(h1,wt,{__CANCEL__:!0});var si=h1;function N0(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var O2=ge.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_1=t=>{let e={},r,n,i;return t&&t.split(`
15
+ `).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||e[r]&&O2[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e};var S1=Symbol("internals"),b1=Symbol("defaults");function io(t){return t&&String(t).trim().toLowerCase()}function rs(t){return t===!1||t==null?t:ge.isArray(t)?t.map(rs):String(t)}function L2(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}function g1(t,e,r,n){if(ge.isFunction(n))return n.call(this,e,r);if(!!ge.isString(e)){if(ge.isString(n))return e.indexOf(n)!==-1;if(ge.isRegExp(n))return n.test(e)}}function F2(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function U2(t,e){let r=ge.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(i,a,s){return this[n].call(this,e,i,a,s)},configurable:!0})})}function no(t,e){e=e.toLowerCase();let r=Object.keys(t),n=r.length,i;for(;n-- >0;)if(i=r[n],e===i.toLowerCase())return i;return null}function sa(t,e){t&&this.set(t),this[b1]=e||null}Object.assign(sa.prototype,{set:function(t,e,r){let n=this;function i(a,s,v){let d=io(s);if(!d)throw new Error("header name must be a non-empty string");let p=no(n,d);p&&v!==!0&&(n[p]===!1||v===!1)||(n[p||s]=rs(a))}return ge.isPlainObject(t)?ge.forEach(t,(a,s)=>{i(a,s,e)}):i(e,t,r),this},get:function(t,e){if(t=io(t),!t)return;let r=no(this,t);if(r){let n=this[r];if(!e)return n;if(e===!0)return L2(n);if(ge.isFunction(e))return e.call(this,n,r);if(ge.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}},has:function(t,e){if(t=io(t),t){let r=no(this,t);return!!(r&&(!e||g1(this,this[r],r,e)))}return!1},delete:function(t,e){let r=this,n=!1;function i(a){if(a=io(a),a){let s=no(r,a);s&&(!e||g1(r,r[s],s,e))&&(delete r[s],n=!0)}}return ge.isArray(t)?t.forEach(i):i(t),n},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(t){let e=this,r={};return ge.forEach(this,(n,i)=>{let a=no(r,i);if(a){e[a]=rs(n),delete e[i];return}let s=t?F2(i):String(i).trim();s!==i&&delete e[i],e[s]=rs(n),r[s]=!0}),this},toJSON:function(t){let e=Object.create(null);return ge.forEach(Object.assign({},this[b1]||null,this),(r,n)=>{r==null||r===!1||(e[n]=t&&ge.isArray(r)?r.join(", "):r)}),e}});Object.assign(sa,{from:function(t){return ge.isString(t)?new this(_1(t)):t instanceof this?t:new this(t)},accessor:function(t){let r=(this[S1]=this[S1]={accessors:{}}).accessors,n=this.prototype;function i(a){let s=io(a);r[s]||(U2(n,a),r[s]=!0)}return ge.isArray(t)?t.forEach(i):i(t),this}});sa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);ge.freezeMethods(sa.prototype);ge.freezeMethods(sa);var yn=sa;function H2(t,e){t=t||10;let r=new Array(t),n=new Array(t),i=0,a=0,s;return e=e!==void 0?e:1e3,function(d){let p=Date.now(),B=n[a];s||(s=p),r[i]=d,n[i]=p;let z=a,ee=0;for(;z!==i;)ee+=r[z++],z=z%t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),p-s<e)return;let te=B&&p-B;return te?Math.round(ee*1e3/te):void 0}}var x1=H2;function y1(t,e){let r=0,n=x1(50,250);return i=>{let a=i.loaded,s=i.lengthComputable?i.total:void 0,v=a-r,d=n(v),p=a<=s;r=a;let B={loaded:a,total:s,progress:s?a/s:void 0,bytes:v,rate:d||void 0,estimated:d&&s&&p?(s-a)/d:void 0};B[e?"download":"upload"]=!0,t(B)}}function ao(t){return new Promise(function(r,n){let i=t.data,a=yn.from(t.headers).normalize(),s=t.responseType,v;function d(){t.cancelToken&&t.cancelToken.unsubscribe(v),t.signal&&t.signal.removeEventListener("abort",v)}ge.isFormData(i)&&Mr.isStandardBrowserEnv&&a.setContentType(!1);let p=new XMLHttpRequest;if(t.auth){let te=t.auth.username||"",k=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.set("Authorization","Basic "+btoa(te+":"+k))}let B=ro(t.baseURL,t.url);p.open(t.method.toUpperCase(),to(B,t.params,t.paramsSerializer),!0),p.timeout=t.timeout;function z(){if(!p)return;let te=yn.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),ce={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:te,config:t,request:p};M0(function(oe){r(oe),d()},function(oe){n(oe),d()},ce),p=null}if("onloadend"in p?p.onloadend=z:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(z)},p.onabort=function(){!p||(n(new wt("Request aborted",wt.ECONNABORTED,t,p)),p=null)},p.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let k=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",ce=t.transitional||es;t.timeoutErrorMessage&&(k=t.timeoutErrorMessage),n(new wt(k,ce.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,t,p)),p=null},Mr.isStandardBrowserEnv){let te=(t.withCredentials||p1(B))&&t.xsrfCookieName&&m1.read(t.xsrfCookieName);te&&a.set(t.xsrfHeaderName,te)}i===void 0&&a.setContentType(null),"setRequestHeader"in p&&ge.forEach(a.toJSON(),function(k,ce){p.setRequestHeader(ce,k)}),ge.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),s&&s!=="json"&&(p.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&p.addEventListener("progress",y1(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",y1(t.onUploadProgress)),(t.cancelToken||t.signal)&&(v=te=>{!p||(n(!te||te.type?new si(null,t,p):te),p.abort(),p=null)},t.cancelToken&&t.cancelToken.subscribe(v),t.signal&&(t.signal.aborted?v():t.signal.addEventListener("abort",v)));let ee=N0(B);if(ee&&Mr.protocols.indexOf(ee)===-1){n(new wt("Unsupported protocol "+ee+":",wt.ERR_BAD_REQUEST,t));return}p.send(i||null)})}var E1={http:ao,xhr:ao},k0={getAdapter:t=>{if(ge.isString(t)){let e=E1[t];if(!t)throw Error(ge.hasOwnProp(t)?`Adapter '${t}' is not available in the build`:`Can not resolve adapter '${t}'`);return e}if(!ge.isFunction(t))throw new TypeError("adapter is not a function");return t},adapters:E1};var V2={"Content-Type":"application/x-www-form-urlencoded"};function q2(){let t;return typeof XMLHttpRequest<"u"?t=k0.getAdapter("xhr"):typeof process<"u"&&ge.kindOf(process)==="process"&&(t=k0.getAdapter("http")),t}function z2(t,e,r){if(ge.isString(t))try{return(e||JSON.parse)(t),ge.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var ns={transitional:es,adapter:q2(),transformRequest:[function(e,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=ge.isObject(e);if(a&&ge.isHTMLForm(e)&&(e=new FormData(e)),ge.isFormData(e))return i&&i?JSON.stringify(ts(e)):e;if(ge.isArrayBuffer(e)||ge.isBuffer(e)||ge.isStream(e)||ge.isFile(e)||ge.isBlob(e))return e;if(ge.isArrayBufferView(e))return e.buffer;if(ge.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let v;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return C0(e,this.formSerializer).toString();if((v=ge.isFileList(e))||n.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return oi(v?{"files[]":e}:e,d&&new d,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),z2(e)):e}],transformResponse:[function(e){let r=this.transitional||ns.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(e&&ge.isString(e)&&(n&&!this.responseType||i)){let s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(v){if(s)throw v.name==="SyntaxError"?wt.from(v,wt.ERR_BAD_RESPONSE,this,null,this.response):v}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mr.classes.FormData,Blob:Mr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ge.forEach(["delete","get","head"],function(e){ns.headers[e]={}});ge.forEach(["post","put","patch"],function(e){ns.headers[e]=ge.merge(V2)});var la=ns;function oo(t,e){let r=this||la,n=e||r,i=yn.from(n.headers),a=n.data;return ge.forEach(t,function(v){a=v.call(r,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function so(t){return!!(t&&t.__CANCEL__)}function D0(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new si}function is(t){return D0(t),t.headers=yn.from(t.headers),t.data=oo.call(t,t.transformRequest),(t.adapter||la.adapter)(t).then(function(n){return D0(t),n.data=oo.call(t,t.transformResponse,n),n.headers=yn.from(n.headers),n},function(n){return so(n)||(D0(t),n&&n.response&&(n.response.data=oo.call(t,t.transformResponse,n.response),n.response.headers=yn.from(n.response.headers))),Promise.reject(n)})}function li(t,e){e=e||{};let r={};function n(p,B){return ge.isPlainObject(p)&&ge.isPlainObject(B)?ge.merge(p,B):ge.isPlainObject(B)?ge.merge({},B):ge.isArray(B)?B.slice():B}function i(p){if(ge.isUndefined(e[p])){if(!ge.isUndefined(t[p]))return n(void 0,t[p])}else return n(t[p],e[p])}function a(p){if(!ge.isUndefined(e[p]))return n(void 0,e[p])}function s(p){if(ge.isUndefined(e[p])){if(!ge.isUndefined(t[p]))return n(void 0,t[p])}else return n(void 0,e[p])}function v(p){if(p in e)return n(t[p],e[p]);if(p in t)return n(void 0,t[p])}let d={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:v};return ge.forEach(Object.keys(t).concat(Object.keys(e)),function(B){let z=d[B]||i,ee=z(B);ge.isUndefined(ee)&&z!==v||(r[B]=ee)}),r}var as="1.1.3";var O0={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{O0[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var w1={};O0.transitional=function(e,r,n){function i(a,s){return"[Axios v"+as+"] Transitional option '"+a+"'"+s+(n?". "+n:"")}return(a,s,v)=>{if(e===!1)throw new wt(i(s," has been removed"+(r?" in "+r:"")),wt.ERR_DEPRECATED);return r&&!w1[s]&&(w1[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,s,v):!0}};function j2(t,e,r){if(typeof t!="object")throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);let n=Object.keys(t),i=n.length;for(;i-- >0;){let a=n[i],s=e[a];if(s){let v=t[a],d=v===void 0||s(v,a,t);if(d!==!0)throw new wt("option "+a+" must be "+d,wt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new wt("Unknown option "+a,wt.ERR_BAD_OPTION)}}var os={assertOptions:j2,validators:O0};var ci=os.validators,ca=class{constructor(e){this.defaults=e,this.interceptors={request:new I0,response:new I0}}request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=li(this.defaults,r);let{transitional:n,paramsSerializer:i}=r;n!==void 0&&os.assertOptions(n,{silentJSONParsing:ci.transitional(ci.boolean),forcedJSONParsing:ci.transitional(ci.boolean),clarifyTimeoutError:ci.transitional(ci.boolean)},!1),i!==void 0&&os.assertOptions(i,{encode:ci.function,serialize:ci.function},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=r.headers&&ge.merge(r.headers.common,r.headers[r.method]);a&&ge.forEach(["delete","get","head","post","put","patch","common"],function(k){delete r.headers[k]}),r.headers=new yn(r.headers,a);let s=[],v=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(r)===!1||(v=v&&k.synchronous,s.unshift(k.fulfilled,k.rejected))});let d=[];this.interceptors.response.forEach(function(k){d.push(k.fulfilled,k.rejected)});let p,B=0,z;if(!v){let te=[is.bind(this),void 0];for(te.unshift.apply(te,s),te.push.apply(te,d),z=te.length,p=Promise.resolve(r);B<z;)p=p.then(te[B++],te[B++]);return p}z=s.length;let ee=r;for(B=0;B<z;){let te=s[B++],k=s[B++];try{ee=te(ee)}catch(ce){k.call(this,ce);break}}try{p=is.call(this,ee)}catch(te){return Promise.reject(te)}for(B=0,z=d.length;B<z;)p=p.then(d[B++],d[B++]);return p}getUri(e){e=li(this.defaults,e);let r=ro(e.baseURL,e.url);return to(r,e.params,e.paramsSerializer)}};ge.forEach(["delete","get","head","options"],function(e){ca.prototype[e]=function(r,n){return this.request(li(n||{},{method:e,url:r,data:(n||{}).data}))}});ge.forEach(["post","put","patch"],function(e){function r(n){return function(a,s,v){return this.request(li(v||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}ca.prototype[e]=r(),ca.prototype[e+"Form"]=r(!0)});var lo=ca;var co=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});let n=this;this.promise.then(i=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a,s=new Promise(v=>{n.subscribe(v),a=v}).then(i);return s.cancel=function(){n.unsubscribe(a)},s},e(function(a,s,v){n.reason||(n.reason=new si(a,s,v),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}static source(){let e;return{token:new co(function(i){e=i}),cancel:e}}},R1=co;function L0(t){return function(r){return t.apply(null,r)}}function F0(t){return ge.isObject(t)&&t.isAxiosError===!0}function T1(t){let e=new lo(t),r=Ja(lo.prototype.request,e);return ge.extend(r,lo.prototype,e,{allOwnKeys:!0}),ge.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return T1(li(t,i))},r}var Vr=T1(la);Vr.Axios=lo;Vr.CanceledError=si;Vr.CancelToken=R1;Vr.isCancel=so;Vr.VERSION=as;Vr.toFormData=oi;Vr.AxiosError=wt;Vr.Cancel=Vr.CanceledError;Vr.all=function(e){return Promise.all(e)};Vr.spread=L0;Vr.isAxiosError=F0;Vr.formToJSON=t=>ts(ge.isHTMLForm(t)?new FormData(t):t);var U0=Vr;var{Axios:f_,AxiosError:d_,CanceledError:v_,isCancel:m_,CancelToken:p_,VERSION:h_,all:__,Cancel:S_,isAxiosError:g_,spread:b_,toFormData:x_}=U0,ua=U0;var A1={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5};var En="function",qr="object",wn="undefined",Gt="prototype",uo="hasOwnProperty";var Yr=Object,fa=Yr[Gt],da=Yr.assign,ss=Yr.create,ls=Yr.defineProperty,ui=fa[uo];var va=null;function cn(t){return t===void 0&&(t=!0),(!va||!t)&&(typeof globalThis!==wn&&globalThis&&(va=globalThis),typeof self!==wn&&self&&(va=self),typeof window!==wn&&window&&(va=window),typeof global!==wn&&global&&(va=global)),va}function ma(t){throw new TypeError(t)}function pa(t){var e=ss;if(e)return e(t);if(t==null)return{};var r=typeof t;r!==qr&&r!==En&&ma("Object prototype may only be an Object:"+t);function n(){}return n[Gt]=t,new n}var C_=(cn()||{}).Symbol,M_=(cn()||{}).Reflect;var X2=function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)fa[uo].call(e,i)&&(t[i]=e[i])}return t},Qt=da||X2,H0=function(t,e){return H0=Yr.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n[uo](i)&&(r[i]=n[i])},H0(t,e)};function ut(t,e){typeof e!==En&&e!==null&&ma("Class extends value "+String(e)+" is not a constructor or null"),H0(t,e);function r(){this.constructor=t}t[Gt]=e===null?pa(e):(r[Gt]=e[Gt],new r)}function cs(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t}var us="constructor",Wn="prototype",fs="function",ds="_dynInstFuncs",z0="_isDynProxy",ha="_dynClass",K2="_dynCls$",j0="_dynInstChk",fo=j0,P1="_dfOpts",I1="_unknown_",W2="__proto__",V0="useBaseInst",C1="setInstFuncs",ps=Object,vo=ps.getPrototypeOf,M1=0;function fi(t,e){return t&&ps[Wn].hasOwnProperty.call(t,e)}function B1(t){return t&&(t===ps[Wn]||t===Array[Wn])}function G0(t){return B1(t)||t===Function[Wn]}function Bi(t){if(t){if(vo)return vo(t);var e=t[W2]||t[Wn]||(t[us]?t[us][Wn]:null);if(e)return e}return null}function vs(t,e){var r=[],n=ps.getOwnPropertyNames;if(n)r=n(t);else for(var i in t)typeof i=="string"&&fi(t,i)&&r.push(i);if(r&&r.length>0)for(var a=0;a<r.length;a++)e(r[a])}function X0(t,e,r){return e!==us&&typeof t[e]===fs&&(r||fi(t,e))}function ms(t){throw new TypeError("DynamicProto: "+t)}function Y2(t){var e={};return vs(t,function(r){!e[r]&&X0(t,r,!1)&&(e[r]=t[r])}),e}function K0(t,e){for(var r=t.length-1;r>=0;r--)if(t[r]===e)return!0;return!1}function $2(t,e,r,n){function i(d,p,B){var z=p[B];if(z[z0]&&n){var ee=d[ds]||{};ee[fo]!==!1&&(z=(ee[p[ha]]||{})[B]||z)}return function(){return z.apply(d,arguments)}}var a={};vs(r,function(d){a[d]=i(e,r,d)});for(var s=Bi(t),v=[];s&&!G0(s)&&!K0(v,s);)vs(s,function(d){!a[d]&&X0(s,d,!vo)&&(a[d]=i(e,s,d))}),v.push(s),s=Bi(s);return a}function Z2(t,e,r,n){var i=null;if(t&&fi(r,ha)){var a=t[ds]||{};if(i=(a[r[ha]]||{})[e],i||ms("Missing ["+e+"] "+fs),!i[j0]&&a[fo]!==!1){for(var s=!fi(t,e),v=Bi(t),d=[];s&&v&&!G0(v)&&!K0(d,v);){var p=v[e];if(p){s=p===n;break}d.push(v),v=Bi(v)}try{s&&(t[e]=i),i[j0]=1}catch{a[fo]=!1}}}return i}function Q2(t,e,r){var n=e[t];return n===r&&(n=Bi(e)[t]),typeof n!==fs&&ms("["+t+"] is not a "+fs),n}function J2(t,e,r,n,i){function a(d,p){var B=function(){var z=Z2(this,p,d,B)||Q2(p,d,B);return z.apply(this,arguments)};return B[z0]=1,B}if(!B1(t)){var s=r[ds]=r[ds]||{},v=s[e]=s[e]||{};s[fo]!==!1&&(s[fo]=!!i),vs(r,function(d){X0(r,d,!1)&&r[d]!==n[d]&&(v[d]=r[d],delete r[d],(!fi(t,d)||t[d]&&!t[d][z0])&&(t[d]=a(t,d)))})}}function ev(t,e){if(vo)for(var r=[],n=Bi(e);n&&!G0(n)&&!K0(r,n);){if(n===t)return!0;r.push(n),n=Bi(n)}return!1}function q0(t,e){return fi(t,Wn)?t.name||e||I1:((t||{})[us]||{}).name||e||I1}function W0(t,e,r,n){fi(t,Wn)||ms("theClass is an invalid class definition.");var i=t[Wn];ev(i,e)||ms("["+q0(t)+"] is not in class hierarchy of ["+q0(e)+"]");var a=null;fi(i,ha)?a=i[ha]:(a=K2+q0(t,"_")+"$"+M1,M1++,i[ha]=a);var s=W0[P1],v=!!s[V0];v&&n&&n[V0]!==void 0&&(v=!!n[V0]);var d=Y2(e),p=$2(i,e,d,v);r(e,p);var B=!!vo&&!!s[C1];B&&n&&(B=!!n[C1]),J2(i,a,e,d,B!==!1)}var tv={setInstFuncs:!0,useBaseInst:!0};W0[P1]=tv;var gt=W0;var Pe;(function(t){t[t.CRITICAL=1]="CRITICAL",t[t.WARNING=2]="WARNING"})(Pe||(Pe={}));var we={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105};var rv="on",N1="attachEvent",k1="addEventListener";var q1="toISOString",z1="endsWith",nv="startsWith",D1="indexOf",O1="map",L1="reduce",$0="trim",j1="toString",iv="__proto__",av="constructor",F1=ls,e3=Yr.freeze,t3=Yr.seal,U1=Yr.keys,Z0=String[Gt],ov=Z0[$0],sv=Z0[z1],r3=Z0[nv],lv=Date[Gt],cv=lv[q1],uv=Array.isArray,G1=fa[j1],fv=ui[j1],n3=fv.call(Yr),dv=/-([a-z])/g,vv=/([^\w\d_$])/g,mv=/^(\d+[\w\d_$])/,H1=Object.getPrototypeOf;function X1(t){if(t){if(H1)return H1(t);var e=t[iv]||t[Gt]||t[av];if(e)return e}return null}function Wt(t){return t===void 0||typeof t===wn}function ke(t){return t===null||Wt(t)}function Q0(t){return!ke(t)}function mo(t,e){return!!(t&&ui.call(t,e))}function Rn(t){return!!(t&&typeof t===qr)}function at(t){return!!(t&&typeof t===En)}function Tn(t,e,r,n){n===void 0&&(n=!1);var i=!1;if(!ke(t))try{ke(t[k1])?ke(t[N1])||(t[N1](rv+e,r),i=!0):(t[k1](e,r,n),i=!0)}catch{}return i}function J0(t){var e=t;return e&&et(e)&&(e=e.replace(dv,function(r,n){return n.toUpperCase()}),e=e.replace(vv,"_"),e=e.replace(mv,function(r,n){return"_"+n})),e}function Tt(t,e){if(t)for(var r in t)ui.call(t,r)&&e.call(t,r,t[r])}function el(t,e){var r=!1;return t&&e&&!(r=t===e)&&(r=sv?t[z1](e):pv(t,e)),r}function pv(t,e){var r=!1,n=e?e.length:0,i=t?t.length:0;if(n&&i&&i>=n&&!(r=t===e)){for(var a=i-1,s=n-1;s>=0;s--){if(t[a]!=e[s])return!1;a--}r=!0}return r}function cr(t,e){return t&&e?t.indexOf(e)!==-1:!1}var ur=uv||hv;function hv(t){return!!(t&&G1.call(t)==="[object Array]")}function _a(t){return!!(t&&G1.call(t)==="[object Error]")}function et(t){return typeof t=="string"}function Sa(t){return typeof t=="number"}function Pr(t){if(t)return cv?t[q1]():_v(t)}function _v(t){if(t&&t.getUTCFullYear){var e=function(r){var n=String(r);return n.length===1&&(n="0"+n),n};return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}function tt(t,e,r){var n=t.length;try{for(var i=0;i<n&&!(i in t&&e.call(r||t,t[i],i,t)===-1);i++);}catch{}}function Un(t,e,r){if(t){if(t[D1])return t[D1](e,r);var n=t.length,i=r||0;try{for(var a=Math.max(i>=0?i:n-Math.abs(i),0);a<n;a++)if(a in t&&t[a]===e)return a}catch{}}return-1}function Ni(t,e,r){var n;if(t){if(t[O1])return t[O1](e,r);var i=t.length,a=r||t;n=new Array(i);try{for(var s=0;s<i;s++)s in t&&(n[s]=e.call(a,t[s],t))}catch{}}return n}function hs(t,e,r){var n;if(t){if(t[L1])return t[L1](e,r);var i=t.length,a=0;if(arguments.length>=3)n=arguments[2];else{for(;a<i&&!(a in t);)a++;n=t[a++]}for(;a<i;)a in t&&(n=e(n,t[a],a,t)),a++}return n}function Jt(t){return t&&(t=ov&&t[$0]?t[$0]():t.replace?t.replace(/^\s+|\s+$/g,""):t),t}var V1=!{toString:null}.propertyIsEnumerable("toString"),Y0=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function un(t){var e=typeof t;if(e!==En&&(e!==qr||t===null)&&ma("objKeys called on non-object"),!V1&&U1)return U1(t);var r=[];for(var n in t)t&&ui.call(t,n)&&r.push(n);if(V1)for(var i=Y0.length,a=0;a<i;a++)t&&ui.call(t,Y0[a])&&r.push(Y0[a]);return r}function di(t,e,r,n){if(F1)try{var i={enumerable:!0,configurable:!0};return r&&(i.get=r),n&&(i.set=n),F1(t,e,i),!0}catch{}return!1}function fr(){var t=Date;return t.now?t.now():new t().getTime()}function _t(t){return _a(t)?t.name:""}function ht(t,e,r,n,i){var a=r;return t&&(a=t[e],a!==r&&(!i||i(a))&&(!n||n(r))&&(a=r,t[e]=a)),a}function dr(t,e,r){var n;return t?(n=t[e],!n&&ke(n)&&(n=Wt(r)?{}:r,t[e]=n)):n=Wt(r)?{}:r,n}function _s(t){return!t}function ga(t){return!!t}function wr(t){throw new Error(t)}function tl(t,e,r){if(t&&e&&t!==e&&Rn(t)&&Rn(e)){var n=function(a){if(et(a)){var s=e[a];at(s)?(!r||r(a,!0,e,t))&&(t[a]=function(v){return function(){var d=arguments;return e[v].apply(e,d)}}(a)):(!r||r(a,!1,e,t))&&(mo(t,a)&&delete t[a],di(t,a,function(){return e[a]},function(v){e[a]=v})||(t[a]=s))}};for(var i in e)n(i)}return t}function rl(t){return function(){function e(){var r=this;t&&Tt(t,function(n,i){r[n]=i})}return e}()}function Ss(t){return t&&da&&(t=Yr(da({},t))),t}var K1="window",Sv="document",gv="documentMode",bv="navigator",xv="history",yv="location",Ev="console",wv="performance",W1="JSON",Rv="crypto",Tv="msCrypto",Av="ReactNative",ol="msie",sl="trident/",nl=null,il=null,Iv=!1,ba=null,al=null;function Y1(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[Gt];n&&(r=e in n)}}catch{}if(!r)try{var i=new t;r=!Wt(i[e])}catch{}}return r}function er(t){var e=cn();return e&&e[t]?e[t]:t===K1&&ki()?window:null}function ki(){return Boolean(typeof window===qr&&window)}function Hn(){return ki()?window:er(K1)}function gs(){return Boolean(typeof document===qr&&document)}function ir(){return gs()?document:er(Sv)}function ll(){return Boolean(typeof navigator===qr&&navigator)}function Rr(){return ll()?navigator:er(bv)}function $1(){return Boolean(typeof history===qr&&history)}function cl(){return $1()?history:er(xv)}function $r(t){if(t&&Iv){var e=er("__mockLocation");if(e)return e}return typeof location===qr&&location?location:er(yv)}function ul(){return typeof console!==wn?console:er(Ev)}function Zr(){return er(wv)}function An(){return Boolean(typeof JSON===qr&&JSON||er(W1)!==null)}function vr(){return An()?JSON||er(W1):null}function fl(){return er(Rv)}function dl(){return er(Tv)}function vl(){var t=Rr();return t&&t.product?t.product===Av:!1}function Di(){var t=Rr();if(t&&(t.userAgent!==il||nl===null)){il=t.userAgent;var e=(il||"").toLowerCase();nl=cr(e,ol)||cr(e,sl)}return nl}function xa(t){if(t===void 0&&(t=null),!t){var e=Rr()||{};t=e?(e.userAgent||"").toLowerCase():""}var r=(t||"").toLowerCase();if(cr(r,ol)){var n=ir()||{};return Math.max(parseInt(r.split(ol)[1]),n[gv]||0)}else if(cr(r,sl)){var i=parseInt(r.split(sl)[1]);if(i)return i+4}return null}function it(t){var e=Object[Gt].toString.call(t),r="";return e==="[object Error]"?r="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t.name+"'":An()&&(r=vr().stringify(t)),e+r}function Oi(){return al===null&&(al=ll()&&Boolean(Rr().sendBeacon)),al}function bs(t){var e=!1;try{var r=er("fetch");e=!!r;var n=er("Request");e&&t&&n&&(e=Y1(n,"keepalive"))}catch{}return e}function xs(){return ba===null&&(ba=typeof XDomainRequest<"u",ba&&Li()&&(ba=ba&&!Y1(er("XMLHttpRequest"),"withCredentials"))),ba}function Li(){var t=!1;try{var e=er("XMLHttpRequest");t=!!e}catch{}return t}var ml=["eventsSent","eventsDiscarded","eventsSendRequest","perfEvent"],Es=null,ys;function Cv(t,e){return function(){var r=arguments,n=pl(e);if(n){var i=n.listener;i&&i[t]&&i[t].apply(i,r)}}}function Mv(){var t=er("Microsoft");return t&&(Es=t.ApplicationInsights),Es}function pl(t){var e=Es;return!e&&t.disableDbgExt!==!0&&(e=Es||Mv()),e?e.ChromeDbgExt:null}function Z1(t){if(!ys){ys={};for(var e=0;e<ml.length;e++)ys[ml[e]]=Cv(ml[e],t)}return ys}var Pv="AI (Internal): ",Bv="AI: ",Nv="AITR_",kv="errorToConsole",Dv="warnToConsole";function Q1(t){return t?'"'+t.replace(/\"/g,"")+'"':""}function J1(t,e){var r=ul();if(r){var n="log";r[t]&&(n=t),at(r[n])&&r[n](e)}}var Yn=function(){function t(e,r,n,i){n===void 0&&(n=!1);var a=this;a.messageId=e,a.message=(n?Bv:Pv)+e;var s="";An()&&(s=vr().stringify(i));var v=(r?" message:"+Q1(r):"")+(i?" props:"+Q1(s):"");a.message+=v}return t.dataType="MessageData",t}();function $n(t,e){return(t||{}).logger||new ya(e)}var ya=function(){function t(e){this.identifier="DiagnosticLogger",this.queue=[];var r=0,n={};gt(t,this,function(i){ke(e)&&(e={}),i.consoleLoggingLevel=function(){return a("loggingLevelConsole",0)},i.telemetryLoggingLevel=function(){return a("loggingLevelTelemetry",1)},i.maxInternalMessageLimit=function(){return a("maxMessageLimit",25)},i.enableDebugExceptions=function(){return a("enableDebugExceptions",!1)},i.throwInternal=function(d,p,B,z,ee){ee===void 0&&(ee=!1);var te=new Yn(p,B,ee,z);if(i.enableDebugExceptions())throw te;var k=d===Pe.CRITICAL?kv:Dv;if(Wt(te.message))v("throw"+(d===Pe.CRITICAL?"Critical":"Warning"),te);else{var ce=i.consoleLoggingLevel();if(ee){var P=+te.messageId;!n[P]&&ce>=d&&(i[k](te.message),n[P]=!0)}else ce>=d&&i[k](te.message);i.logInternalMessage(d,te)}},i.warnToConsole=function(d){J1("warn",d),v("warning",d)},i.errorToConsole=function(d){J1("error",d),v("error",d)},i.resetInternalMessageCount=function(){r=0,n={}},i.logInternalMessage=function(d,p){if(!s()){var B=!0,z=Nv+p.messageId;if(n[z]?B=!1:n[z]=!0,B&&(d<=i.telemetryLoggingLevel()&&(i.queue.push(p),r++,v(d===Pe.CRITICAL?"error":"warn",p)),r===i.maxInternalMessageLimit())){var ee="Internal events throttle limit per PageView reached for this app.",te=new Yn(we.MessageLimitPerPVExceeded,ee,!1);i.queue.push(te),d===Pe.CRITICAL?i.errorToConsole(ee):i.warnToConsole(ee)}}};function a(d,p){var B=e[d];return ke(B)?p:B}function s(){return r>=i.maxInternalMessageLimit()}function v(d,p){var B=pl(e);B&&B.diagLog&&B.diagLog(d,p)}})}return t}();var Ea="ctx",Ov=null,po=function(){function t(e,r,n){var i=this,a=!1;if(i.start=fr(),i.name=e,i.isAsync=n,i.isChildEvt=function(){return!1},at(r)){var s;a=di(i,"payload",function(){return!s&&at(r)&&(s=r(),r=null),s})}i.getCtx=function(v){return v?v===t.ParentContextKey||v===t.ChildrenContextKey?i[v]:(i[Ea]||{})[v]:null},i.setCtx=function(v,d){if(v)if(v===t.ParentContextKey)i[v]||(i.isChildEvt=function(){return!0}),i[v]=d;else if(v===t.ChildrenContextKey)i[v]=d;else{var p=i[Ea]=i[Ea]||{};p[v]=d}},i.complete=function(){var v=0,d=i.getCtx(t.ChildrenContextKey);if(ur(d))for(var p=0;p<d.length;p++){var B=d[p];B&&(v+=B.time)}i.time=fr()-i.start,i.exTime=i.time-v,i.complete=function(){},!a&&at(r)&&(i.payload=r())}}return t.ParentContextKey="parent",t.ChildrenContextKey="childEvts",t}();var _l=function(){function t(e){this.ctx={},gt(t,this,function(r){r.create=function(n,i,a){return new po(n,i,a)},r.fire=function(n){n&&(n.complete(),e&&at(e.perfEvent)&&e.perfEvent(n))},r.setCtx=function(n,i){if(n){var a=r[Ea]=r[Ea]||{};a[n]=i}},r.getCtx=function(n){return(r[Ea]||{})[n]}})}return t}();var hl="CoreUtils.doPerf";function Vn(t,e,r,n,i){if(t){var a=t;if(at(a.getPerfMgr)&&(a=a.getPerfMgr()),a){var s=void 0,v=a.getCtx(hl);try{if(s=a.create(e(),n,i),s){if(v&&s.setCtx&&(s.setCtx(po.ParentContextKey,v),v.getCtx&&v.setCtx)){var d=v.getCtx(po.ChildrenContextKey);d||(d=[],v.setCtx(po.ChildrenContextKey,d)),d.push(s)}return a.setCtx(hl,s),r(s)}}catch(p){s&&s.setCtx&&s.setCtx("exception",p)}finally{s&&a.fire(s),a.setCtx(hl,v)}}}return r()}function Sl(){return Ov}var eu=function(){function t(e,r){var n=this,i=null,a=at(e.processTelemetry),s=at(e.setNextPlugin);n._hasRun=!1,n.getPlugin=function(){return e},n.getNext=function(){return i},n.setNext=function(v){i=v},n.processTelemetry=function(v,d){d||(d=r);var p=e?e.identifier:"TelemetryPluginChain";Vn(d?d.core():null,function(){return p+":processTelemetry"},function(){if(e&&a){n._hasRun=!0;try{d.setNext(i),s&&e.setNextPlugin(i),i&&(i._hasRun=!1),e.processTelemetry(v,d)}catch(z){var B=i&&i._hasRun;(!i||!B)&&d.diagLog().throwInternal(Pe.CRITICAL,we.PluginException,"Plugin ["+e.identifier+"] failed during processTelemetry - "+it(z)),i&&!B&&i.processTelemetry(v,d)}}else i&&(n._hasRun=!0,i.processTelemetry(v,d))},function(){return{item:v}},!v.sync)}}return t}();function gl(t,e){var r=[];if(t&&t.length>0)for(var n=null,i=0;i<t.length;i++){var a=t[i];if(a&&at(a.processTelemetry)){var s=new eu(a,e);r.push(s),n&&n.setNext(s),n=s}}return r.length>0?r[0]:null}function Lv(t,e,r){var n=[],i=!r;if(t)for(;t;){var a=t.getPlugin();(i||a===r)&&(i=!0,n.push(a)),t=t.getNext()}return i||n.push(r),gl(n,e)}function Fv(t,e,r){var n=t,i=!1;return r&&t&&(n=[],tt(t,function(a){(i||a===r)&&(i=!0,n.push(a))})),r&&!i&&(n||(n=[]),n.push(r)),gl(n,e)}var Zn=function(){function t(e,r,n,i){var a=this,s=null;i!==null&&(e&&at(e.getPlugin)?s=Lv(e,a,i||e.getPlugin()):i?s=Fv(e,a,i):Wt(i)&&(s=gl(e,a))),a.core=function(){return n},a.diagLog=function(){return $n(n,r)},a.getCfg=function(){return r},a.getExtCfg=function(v,d){d===void 0&&(d={});var p;if(r){var B=r.extensionConfig;B&&v&&(p=B[v])}return p||d},a.getConfig=function(v,d,p){p===void 0&&(p=!1);var B,z=a.getExtCfg(v,null);return z&&!ke(z[d])?B=z[d]:r&&!ke(r[d])&&(B=r[d]),ke(B)?p:B},a.hasNext=function(){return s!=null},a.getNext=function(){return s},a.setNext=function(v){s=v},a.processNext=function(v){var d=s;d&&(s=d.getNext(),d.processTelemetry(v,a))},a.createNew=function(v,d){return v===void 0&&(v=null),new t(v||s,r,n,d)}}return t}();var tu="iKey",ws="extensionConfig";var Rs="getPlugin",In=function(){function t(){var e=this,r=!1,n=null,i=null;e.core=null,e.diagLog=function(a){return e._getTelCtx(a).diagLog()},e.isInitialized=function(){return r},e.setInitialized=function(a){r=a},e.setNextPlugin=function(a){i=a},e.processNext=function(a,s){s?s.processNext(a):i&&at(i.processTelemetry)&&i.processTelemetry(a,null)},e._getTelCtx=function(a){a===void 0&&(a=null);var s=a;if(!s){var v=n||new Zn(null,{},e.core);i&&i[Rs]?s=v.createNew(null,i[Rs]):s=v.createNew(null,i)}return s},e._baseTelInit=function(a,s,v,d){a&&ht(a,ws,[],null,ke),!d&&s&&(d=s.getProcessTelContext().getNext());var p=i;i&&i[Rs]&&(p=i[Rs]()),e.core=s,n=new Zn(d,a,s,p),r=!0}}return t.prototype.initialize=function(e,r,n,i){this._baseTelInit(e,r,n,i)},t}();var bl="processTelemetry",ru="priority",nu="setNextPlugin",iu="isInitialized";function ho(t,e){for(var r=[],n=null,i=t.getNext();i;){var a=i.getPlugin();a&&(n&&at(n[nu])&&at(a[bl])&&n[nu](a),(!at(a[iu])||!a[iu]())&&r.push(a),n=a,i=i.getNext())}tt(r,function(s){s.initialize(t.getCfg(),t.core(),e,t.getNext())})}function xl(t){return t.sort(function(e,r){var n=0,i=at(r[bl]);return at(e[bl])?n=i?e[ru]-r[ru]:1:i&&(n=-1),n})}var yl=500,Uv="Channel has invalid priority",au=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier="ChannelControllerPlugin",r.priority=yl;var n;gt(e,r,function(v,d){v.setNextPlugin=function(p){},v.processTelemetry=function(p,B){n&&tt(n,function(z){if(z.length>0){var ee=r._getTelCtx(B).createNew(z);ee.processNext(p)}})},v.getChannelControls=function(){return n},v.initialize=function(p,B,z){v.isInitialized()||(d.initialize(p,B,z),s((p||{}).channels,z),tt(n,function(ee){return ho(new Zn(ee,p,B),z)}))}});function i(v){tt(v,function(d){d.priority<yl&&wr(Uv+d.identifier)})}function a(v){v&&v.length>0&&(v=v.sort(function(d,p){return d.priority-p.priority}),i(v),n.push(v))}function s(v,d){if(n=[],v&&tt(v,function(B){return a(B)}),d){var p=[];tt(d,function(B){B.priority>yl&&p.push(B)}),a(p)}}return r}return e._staticInit=function(){var r=e.prototype;di(r,"ChannelControls",r.getChannelControls),di(r,"channelQueue",r.getChannelControls)}(),e}(In);var ou="toGMTString",su="toUTCString",Al="cookie",El="expires",Rl="enabled",lu="isCookieUseDisabled",cu="disableCookiesUsage",vi="_ckMgr",Cn="",Ts=null,wl=null,uu=null,_o=ir(),fu={},Is={};function Hv(t,e){var r=Fi[vi]||Is[vi];return r||(r=Fi[vi]=Fi(t,e),Is[vi]=r),r}function As(t){return t?t.isEnabled():!0}function Vv(t){var e=t.cookieCfg=t.cookieCfg||{};if(ht(e,"domain",t.cookieDomain,Q0,ke),ht(e,"path",t.cookiePath||"/",null,ke),ke(e[Rl])){var r=void 0;Wt(t[lu])||(r=!t[lu]),Wt(t[cu])||(r=!t[cu]),e[Rl]=r}return e}function Ui(t,e){var r;if(t)r=t.getCookieMgr();else if(e){var n=e.cookieCfg;n[vi]?r=n[vi]:r=Fi(e)}return r||(r=Hv(e,(t||{}).logger)),r}function Fi(t,e){var r=Vv(t||Is),n=r.path||"/",i=r.domain,a=r[Rl]!==!1,s={isEnabled:function(){var v=a&&Tl(e),d=Is[vi];return v&&d&&s!==d&&(v=As(d)),v},setEnabled:function(v){a=v!==!1},set:function(v,d,p,B,z){var ee=!1;if(As(s)){var te={},k=Jt(d||Cn),ce=k.indexOf(";");if(ce!==-1&&(k=Jt(d.substring(0,ce)),te=pu(d.substring(ce+1))),ht(te,"domain",B||i,ga,Wt),!ke(p)){var P=Di();if(Wt(te[El])){var oe=fr(),se=oe+p*1e3;if(se>0){var xe=new Date;xe.setTime(se),ht(te,El,du(xe,P?ou:su)||du(xe,P?ou:su)||Cn,ga)}}P||ht(te,"max-age",Cn+p,null,Wt)}var Ge=$r();Ge&&Ge.protocol==="https:"&&(ht(te,"secure",null,null,Wt),wl===null&&(wl=!Il((Rr()||{}).userAgent)),wl&&ht(te,"SameSite","None",null,Wt)),ht(te,"path",z||n,null,Wt);var lt=r.setCookie||mu;lt(v,vu(k,te)),ee=!0}return ee},get:function(v){var d=Cn;return As(s)&&(d=(r.getCookie||qv)(v)),d},del:function(v,d){var p=!1;return As(s)&&(p=s.purge(v,d)),p},purge:function(v,d){var p,B=!1;if(Tl(e)){var z=(p={},p.path=d||"/",p[El]="Thu, 01 Jan 1970 00:00:01 GMT",p);Di()||(z["max-age"]="0");var ee=r.delCookie||mu;ee(v,vu(Cn,z)),B=!0}return B}};return s[vi]=s,s}function Tl(t){if(Ts===null){Ts=!1;try{var e=_o||{};Ts=e[Al]!==void 0}catch(r){t&&t.throwInternal(Pe.WARNING,we.CannotAccessCookie,"Cannot access document.cookie - "+_t(r),{exception:it(r)})}}return Ts}function pu(t){var e={};if(t&&t.length){var r=Jt(t).split(";");tt(r,function(n){if(n=Jt(n||Cn),n){var i=n.indexOf("=");i===-1?e[n]=null:e[Jt(n.substring(0,i))]=Jt(n.substring(i+1))}})}return e}function du(t,e){return at(t[e])?t[e]():null}function vu(t,e){var r=t||Cn;return Tt(e,function(n,i){r+="; "+n+(ke(i)?Cn:"="+i)}),r}function qv(t){var e=Cn;if(_o){var r=_o[Al]||Cn;uu!==r&&(fu=pu(r),uu=r),e=Jt(fu[t]||Cn)}return e}function mu(t,e){_o&&(_o[Al]=t+"="+e)}function Il(t){return et(t)?!!(cr(t,"CPU iPhone OS 12")||cr(t,"iPad; CPU OS 12")||cr(t,"Macintosh; Intel Mac OS X 10_14")&&cr(t,"Version/")&&cr(t,"Safari")||cr(t,"Macintosh; Intel Mac OS X 10_14")&&el(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||cr(t,"Chrome/5")||cr(t,"Chrome/6")||cr(t,"UnrealEngine")&&!cr(t,"Chrome")||cr(t,"UCBrowser/12")||cr(t,"UCBrowser/11")):!1}var zv="Extensions must provide callback to initialize",hu="_notificationManager";function jv(t,e){return new _l(e)}var _u=function(){function t(){var e=!1,r,n,i,a,s;gt(t,this,function(v){v._extensions=new Array,n=new au,v.logger=new ya({loggingLevelConsole:Pe.CRITICAL}),r=[],v.isInitialized=function(){return e},v.initialize=function(d,p,B,z){v.isInitialized()&&wr("Core should not be initialized more than once"),(!d||ke(d.instrumentationKey))&&wr("Please provide instrumentation key"),i=z,v[hu]=z,v.config=d||{},z&&v.config.disableDbgExt!==!0&&z.addNotificationListener(Z1(d)),v.config.enablePerfMgr&&ht(v.config,"createPerfMgr",jv),d.extensions=ke(d.extensions)?[]:d.extensions;var ee=dr(d,ws);ee.NotificationManager=z,B&&(v.logger=B);var te=[];te.push.apply(te,cs(cs([],p,!1),d.extensions,!1)),te=xl(te);var k=[],ce=[],P={};tt(te,function(oe){(ke(oe)||ke(oe.initialize))&&wr(zv);var se=oe.priority,xe=oe.identifier;oe&&se&&(ke(P[se])?P[se]=xe:B.warnToConsole("Two extensions have same priority #"+se+" - "+P[se]+", "+xe)),!se||se<n.priority?k.push(oe):ce.push(oe)}),te.push(n),k.push(n),te=xl(te),v._extensions=te,ho(new Zn([n],d,v),te),ho(new Zn(k,d,v),te),v._extensions=k,v.getTransmissionControls().length===0&&wr("No channels available"),e=!0,v.releaseQueue()},v.getTransmissionControls=function(){return n.getChannelControls()},v.track=function(d){ht(d,tu,v.config.instrumentationKey,null,_s),ht(d,"time",Pr(new Date),null,_s),ht(d,"ver","4.0",null,ke),v.isInitialized()?v.getProcessTelContext().processNext(d):r.push(d)},v.getProcessTelContext=function(){var d=v._extensions,p=d;return(!d||d.length===0)&&(p=[n]),new Zn(p,v.config,v)},v.getNotifyMgr=function(){return i||(i=pa({addNotificationListener:function(d){},removeNotificationListener:function(d){},eventsSent:function(d){},eventsDiscarded:function(d,p){},eventsSendRequest:function(d,p){}}),v[hu]=i),i},v.getCookieMgr=function(){return s||(s=Fi(v.config,v.logger)),s},v.setCookieMgr=function(d){s=d},v.getPerfMgr=function(){return a||v.config&&v.config.enablePerfMgr&&at(v.config.createPerfMgr)&&(a=v.config.createPerfMgr(v,v.getNotifyMgr())),a||Sl()},v.setPerfMgr=function(d){a=d},v.eventCnt=function(){return r.length},v.releaseQueue=function(){r.length>0&&(tt(r,function(d){v.getProcessTelContext().processNext(d)}),r=[])}})}return t}();var Su=function(){function t(e){this.listeners=[];var r=!!(e||{}).perfEvtsSendAll;gt(t,this,function(n){n.addNotificationListener=function(i){n.listeners.push(i)},n.removeNotificationListener=function(i){for(var a=Un(n.listeners,i);a>-1;)n.listeners.splice(a,1),a=Un(n.listeners,i)},n.eventsSent=function(i){tt(n.listeners,function(a){a&&a.eventsSent&&setTimeout(function(){return a.eventsSent(i)},0)})},n.eventsDiscarded=function(i,a){tt(n.listeners,function(s){s&&s.eventsDiscarded&&setTimeout(function(){return s.eventsDiscarded(i,a)},0)})},n.eventsSendRequest=function(i,a){tt(n.listeners,function(s){if(s&&s.eventsSendRequest)if(a)setTimeout(function(){return s.eventsSendRequest(i,a)},0);else try{s.eventsSendRequest(i,a)}catch{}})},n.perfEvent=function(i){i&&(r||!i.isChildEvt())&&tt(n.listeners,function(a){if(a&&a.perfEvent)if(i.isAsync)setTimeout(function(){return a.perfEvent(i)},0);else try{a.perfEvent(i)}catch{}})}})}return t}();var Cl=function(t){ut(e,t);function e(){var r=t.call(this)||this,n=0;return gt(e,r,function(i,a){i.initialize=function(d,p,B,z){a.initialize(d,p,B||new ya(d),z||new Su(d))},i.track=function(d){Vn(i.getPerfMgr(),function(){return"AppInsightsCore:track"},function(){d===null&&(v(d),wr("Invalid telemetry item")),s(d),a.track(d)},function(){return{item:d}},!d.sync)},i.addNotificationListener=function(d){var p=i.getNotifyMgr();p&&p.addNotificationListener(d)},i.removeNotificationListener=function(d){var p=i.getNotifyMgr();p&&p.removeNotificationListener(d)},i.pollInternalLogs=function(d){var p=i.config.diagnosticLogInterval;return(!p||!(p>0))&&(p=1e4),n&&i.stopPollingInternalLogs(),n=setInterval(function(){var B=i.logger?i.logger.queue:[];tt(B,function(z){var ee={name:d||"InternalMessageId: "+z.messageId,iKey:i.config.instrumentationKey,time:Pr(new Date),baseType:Yn.dataType,baseData:{message:z.message}};i.track(ee)}),B.length=0},p),n},i.stopPollingInternalLogs=function(){!n||(clearInterval(n),n=0)};function s(d){if(ke(d.name))throw v(d),Error("telemetry name required")}function v(d){var p=i.getNotifyMgr();p&&p.eventsDiscarded([d],A1.InvalidEvent)}}),r}return e}(_u);var gu=4294967296,Hi=4294967295,bu=!1,So=123456789,go=987654321;function Gv(t){t<0&&(t>>>=0),So=123456789+t&Hi,go=987654321-t&Hi,bu=!0}function Xv(){try{var t=fr()&2147483647;Gv((Math.random()*gu^t)+t)}catch{}}function wa(t){var e,r=fl()||dl();return r&&r.getRandomValues?e=r.getRandomValues(new Uint32Array(1))[0]&Hi:Di()?(bu||Xv(),e=xu()&Hi):e=Math.floor(gu*Math.random()|0),t||(e>>>=0),e}function xu(t){go=36969*(go&65535)+(go>>16)&Hi,So=18e3*(So&65535)+(So>>16)&Hi;var e=(go<<16)+(So&65535)>>>0&Hi|0;return t||(e>>>=0),e}var yu="visibilitychange",Eu="pagehide";function Cs(t,e){var r=!1,n=Hn();n&&(r=Tn(n,t,e),r=Tn(n.body,t,e)||r);var i=ir();return i&&(r=Tn(i,t,e)||r),r}function Ml(t,e,r){var n=!1;if(e&&t&&ur(t)){var i=[];tt(t,function(a){et(a)&&(!r||Un(r,a)===-1?n=Cs(a,e)||n:i.push(a))}),!n&&i.length>0&&(n=Ml(i,e))}return n}function Pl(t,e){return Ml(["beforeunload","unload","pagehide"],t,e)}function bo(t,e){function r(i){var a=ir();t&&a&&a.visibilityState==="hidden"&&t(i)}var n=!1;return(!e||Un(e,Eu)===-1)&&(n=Cs(Eu,t)),(!e||Un(e,yu)===-1)&&(n=Cs(yu,r)||n),!n&&e&&(n=bo(t)),n}function Ra(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=wa()>>>0,n=0,i="";i.length<t;)n++,i+=e.charAt(r&63),r>>>=6,n===5&&(r=(wa()<<2&4294967295|r&3)>>>0,n=0);return i}function zr(){for(var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],e="",r,n=0;n<4;n++)r=wa(),e+=t[r&15]+t[r>>4&15]+t[r>>8&15]+t[r>>12&15]+t[r>>16&15]+t[r>>20&15]+t[r>>24&15]+t[r>>28&15];var i=t[8+(wa()&3)|0];return e.substr(0,8)+e.substr(9,4)+"4"+e.substr(13,3)+i+e.substr(16,3)+e.substr(19,12)}var Ru="_aiHooks",Tu=["req","rsp","hkErr","fnErr"];function Nl(t,e){if(t)for(var r=0;r<t.length&&!e(t[r],r);r++);}function Bl(t,e,r,n,i){i>=0&&i<=2&&Nl(t,function(a,s){var v=a.cbks,d=v[Tu[i]];if(d){e.ctx=function(){var z=n[s]=n[s]||{};return z};try{d.apply(e.inst,r)}catch(z){var p=e.err;try{var B=v[Tu[2]];B&&(e.err=z,B.apply(e.inst,r))}catch{}finally{e.err=p}}}})}function $v(t){return function(){var e=this,r=arguments,n=t.h,i={name:t.n,inst:e,ctx:null,set:d},a=[],s=v([i],r);function v(B,z){return Nl(z,function(ee){B.push(ee)}),B}function d(B,z){r=v([],r),r[B]=z,s=v([i],r)}Bl(n,i,s,a,0);var p=t.f;try{i.rslt=p.apply(e,r)}catch(B){throw i.err=B,Bl(n,i,s,a,3),B}return Bl(n,i,s,a,1),i.rslt}}function Au(t,e,r){var n=null;return t&&(mo(t,e)?n=t:r&&(n=Au(X1(t),e,!1))),n}function kl(t,e,r){return t?xo(t[Gt],e,r,!1):null}function xo(t,e,r,n){if(n===void 0&&(n=!0),t&&e&&r){var i=Au(t,e,n);if(i){var a=i[e];if(typeof a===En){var s=a[Ru];if(!s){s={i:0,n:e,f:a,h:[]};var v=$v(s);v[Ru]=s,i[e]=v}var d={id:s.i,cbks:r,rm:function(){var p=this.id;Nl(s.h,function(B,z){if(B.id===p)return s.h.splice(z,1),1})}};return s.i++,s.h.push(d),d}}}return null}var Ct={requestContextHeader:"Request-Context",requestContextTargetKey:"appId",requestContextAppIdFormat:"appId=cid-v1:",requestIdHeader:"Request-Id",traceParentHeader:"traceparent",traceStateHeader:"tracestate",sdkContextHeader:"Sdk-Context",sdkContextHeaderAppIdRequest:"appId",requestContextHeaderLowerCase:"request-context"};function Dl(t,e,r){var n=e.length,i=Iu(t,e);if(i.length!==n){for(var a=0,s=i;r[s]!==void 0;)a++,s=i.substring(0,150-3)+Cu(a);i=s}return i}function Iu(t,e){var r;return e&&(e=Jt(e.toString()),e.length>150&&(r=e.substring(0,150),t&&t.throwInternal(Pe.WARNING,we.NameTooLong,"name is too long. It has been truncated to "+150+" characters.",{name:e},!0))),r||e}function Mt(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Jt(e),e.toString().length>r&&(n=e.toString().substring(0,r),t&&t.throwInternal(Pe.WARNING,we.StringValueTooLong,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}function Qn(t,e){return Fl(t,e,2048,we.UrlTooLong)}function yo(t,e){var r;return e&&e.length>32768&&(r=e.substring(0,32768),t&&t.throwInternal(Pe.WARNING,we.MessageTruncated,"message is too long, it has been truncated to "+32768+" characters.",{message:e},!0)),r||e}function Ol(t,e){var r;if(e){var n=""+e;n.length>32768&&(r=n.substring(0,32768),t&&t.throwInternal(Pe.WARNING,we.ExceptionTruncated,"exception is too long, it has been truncated to "+32768+" characters.",{exception:e},!0))}return r||e}function Br(t,e){if(e){var r={};Tt(e,function(n,i){if(Rn(i)&&An())try{i=vr().stringify(i)}catch(a){t&&t.throwInternal(Pe.WARNING,we.CannotSerializeObjectNonSerializable,"custom property is not valid",{exception:a},!0)}i=Mt(t,i,8192),n=Dl(t,n,r),r[n]=i}),e=r}return e}function Nr(t,e){if(e){var r={};Tt(e,function(n,i){n=Dl(t,n,r),r[n]=i}),e=r}return e}function Ll(t,e){return e&&Fl(t,e,128,we.IdTooLong).toString()}function Fl(t,e,r,n){var i;return e&&(e=Jt(e),e.length>r&&(i=e.substring(0,r),t&&t.throwInternal(Pe.WARNING,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),i||e}function Cu(t){var e="00"+t;return e.substr(e.length-3)}function Vi(t){var e=null;if(at(Event))e=new Event(t);else{var r=ir();r&&r.createEvent&&(e=r.createEvent("Event"),e.initEvent(t,!0,!0))}return e}function fn(t,e){return e===void 0&&(e=!1),t==null?e:t.toString().toLowerCase()==="true"}function Qr(t){(isNaN(t)||t<0)&&(t=0),t=Math.round(t);var e=""+t%1e3,r=""+Math.floor(t/1e3)%60,n=""+Math.floor(t/(1e3*60))%60,i=""+Math.floor(t/(1e3*60*60))%24,a=Math.floor(t/(1e3*60*60*24));return e=e.length===1?"00"+e:e.length===2?"0"+e:e,r=r.length<2?"0"+r:r,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(a>0?a+".":"")+i+":"+n+":"+r+"."+e}function Ul(t,e){var r=null;return tt(t,function(n){if(n.identifier===e)return r=n,-1}),r}function Hl(t,e,r,n,i){return!i&&et(t)&&(t==="Script error."||t==="Script error")}var Mn="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Ta="sampleRate",Aa="ProcessLegacy",Eo="http.method",Ms="https://dc.services.visualstudio.com",ar="not_specified",Ps="iKey";var mi;(function(t){t[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage"})(mi||(mi={}));var dn;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C",t[t.W3C=2]="W3C"})(dn||(dn={}));var qi=void 0,zi=void 0;function Vl(){return Ns()?Bs(mi.LocalStorage):null}function Bs(t){try{if(ke(cn()))return null;var e=new Date,r=er(t===mi.LocalStorage?"localStorage":"sessionStorage");r.setItem(e.toString(),e.toString());var n=r.getItem(e.toString())!==e.toString();if(r.removeItem(e.toString()),!n)return r}catch{}return null}function ql(){return ji()?Bs(mi.SessionStorage):null}function zl(){qi=!1,zi=!1}function Ns(){return qi===void 0&&(qi=!!Bs(mi.LocalStorage)),qi}function jl(t,e){var r=Vl();if(r!==null)try{return r.getItem(e)}catch(n){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+_t(n),{exception:it(n)})}return null}function Gl(t,e,r){var n=Vl();if(n!==null)try{return n.setItem(e,r),!0}catch(i){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+_t(i),{exception:it(i)})}return!1}function Xl(t,e){var r=Vl();if(r!==null)try{return r.removeItem(e),!0}catch(n){qi=!1,t.throwInternal(Pe.WARNING,we.BrowserFailedRemovalFromLocalStorage,"Browser failed removal of local storage item. "+_t(n),{exception:it(n)})}return!1}function ji(){return zi===void 0&&(zi=!!Bs(mi.SessionStorage)),zi}function Ia(t,e){var r=ql();if(r!==null)try{return r.getItem(e)}catch(n){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotReadSessionStorage,"Browser failed read of session storage. "+_t(n),{exception:it(n)})}return null}function Ca(t,e,r){var n=ql();if(n!==null)try{return n.setItem(e,r),!0}catch(i){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserCannotWriteSessionStorage,"Browser failed write to session storage. "+_t(i),{exception:it(i)})}return!1}function Kl(t,e){var r=ql();if(r!==null)try{return r.removeItem(e),!0}catch(n){zi=!1,t.throwInternal(Pe.WARNING,we.BrowserFailedRemovalFromSessionStorage,"Browser failed removal of session storage item. "+_t(n),{exception:it(n)})}return!1}var Mu=ir()||{},Pu=0,rm=[null,null,null,null,null];function wo(t){var e=Pu,r=rm,n=r[e];return Mu.createElement?r[e]||(n=r[e]=Mu.createElement("a")):n={host:Wl(t,!0)},n.href=t,e++,e>=r.length&&(e=0),Pu=e,n}function ks(t){var e,r=wo(t);return r&&(e=r.href),e}function Ds(t,e){return t?t.toUpperCase()+" "+e:e}function Wl(t,e){var r=Os(t,e)||"";if(r){var n=r.match(/(www[0-9]?\.)?(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>3&&et(n[2])&&n[2].length>0)return n[2]+(n[3]||"")}return r}function Os(t,e){var r=null;if(t){var n=t.match(/(\w*):\/\/(.[^/:]+)(\:[\d]+)?/i);if(n!=null&&n.length>2&&et(n[2])&&n[2].length>0&&(r=n[2]||"",e&&n.length>2)){var i=(n[1]||"").toLowerCase(),a=n[3]||"";(i==="http"&&a===":80"||i==="https"&&a===":443")&&(a=""),r+=a}}return r}var im=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"];function Gi(t){return im.indexOf(t.toLowerCase())!==-1}var Jn={correlationIdPrefix:"cid-v1:",canIncludeCorrelationHeader:function(t,e,r){if(!e||t&&t.disableCorrelationHeaders)return!1;if(t&&t.correlationHeaderExcludePatterns){for(var n=0;n<t.correlationHeaderExcludePatterns.length;n++)if(t.correlationHeaderExcludePatterns[n].test(e))return!1}var i=wo(e).host.toLowerCase();if(i&&(i.indexOf(":443")!==-1||i.indexOf(":80")!==-1)&&(i=(Os(e,!0)||"").toLowerCase()),(!t||!t.enableCorsCorrelation)&&i&&i!==r)return!1;var a=t&&t.correlationHeaderDomains;if(a){var s;if(tt(a,function(p){var B=new RegExp(p.toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));s=s||B.test(i)}),!s)return!1}var v=t&&t.correlationHeaderExcludedDomains;if(!v||v.length===0)return!0;for(var n=0;n<v.length;n++){var d=new RegExp(v[n].toLowerCase().replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\*/g,".*"));if(d.test(i))return!1}return i&&i.length>0},getCorrelationContext:function(t){if(t){var e=Jn.getCorrelationContextValue(t,Ct.requestContextTargetKey);if(e&&e!==Jn.correlationIdPrefix)return e}},getCorrelationContextValue:function(t,e){if(t)for(var r=t.split(","),n=0;n<r.length;++n){var i=r[n].split("=");if(i.length===2&&i[0]===e)return i[1]}}};function Bu(t,e,r,n){var i,a=n,s=n;if(e&&e.length>0){var v=wo(e);if(i=v.host,!a)if(v.pathname!=null){var d=v.pathname.length===0?"/":v.pathname;d.charAt(0)!=="/"&&(d="/"+d),s=v.pathname,a=Mt(t,r?r+" "+d:d)}else a=Mt(t,e)}else i=n,a=n;return{target:i,name:a,data:s}}function Ma(){var t=Zr();if(t&&t.now&&t.timing){var e=t.now()+t.timing.navigationStart;if(e>0)return e}return fr()}function mr(t,e){var r=null;return t!==0&&e!==0&&!ke(t)&&!ke(e)&&(r=e-t),r}var am=";",om="=";function Yl(t){if(!t)return{};var e=t.split(am),r=hs(e,function(i,a){var s=a.split(om);if(s.length===2){var v=s[0].toLowerCase(),d=s[1];i[v]=d}return i},{});if(un(r).length>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r.ingestionendpoint=r.ingestionendpoint||"https://"+n+"dc."+r.endpointsuffix}r.ingestionendpoint=r.ingestionendpoint||Ms}return r}var $l=function(){function t(){}return t}();var Zl=function(t){ut(e,t);function e(){return t.call(this)||this}return e}($l);var Nu=function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return t}();var Ls=function(t){ut(e,t);function e(r,n,i){var a=t.call(this)||this;return a.name=Mt(r,i)||ar,a.data=n,a.time=Pr(new Date),a.aiDataContract={time:1,iKey:1,name:1,sampleRate:function(){return a.sampleRate===100?4:1},tags:1,data:1},a}return e}(Nu);var Fs=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Jr=function(t){ut(e,t);function e(r,n,i,a){var s=t.call(this)||this;return s.aiDataContract={ver:1,name:1,properties:0,measurements:0},s.name=Mt(r,n)||ar,s.properties=Br(r,i),s.measurements=Nr(r,a),s}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(Fs);var ku=function(){function t(){}return t}();var Du=function(){function t(){this.ver=2,this.exceptions=[],this.properties={},this.measurements={}}return t}();var Ou=function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return t}();var sm="<no_method>",Ba="error",vn="stack",Jl="stackDetails",Lu="errorSrc",ec="message",Hu="description";function tc(t,e){var r=t;return r&&!et(r)&&(JSON&&JSON.stringify?(r=JSON.stringify(t),e&&(!r||r==="{}")&&(at(t.toString)?r=t.toString():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}function Vu(t,e){var r=t;return t&&(r&&!et(r)&&(r=t[ec]||t[Hu]||r),r&&!et(r)&&(r=tc(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&(r||"").indexOf(e)===-1&&(r=e+": "+r),r||""}function lm(t){try{if(Rn(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}function cm(t){try{if(Rn(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}function Fu(t){return t&&t.src&&et(t.src)&&t.obj&&ur(t.obj)}function Pa(t){var e=t||"";et(e)||(et(e[vn])?e=e[vn]:e=""+e);var r=e.split(`
16
16
  `);return{src:e,obj:r}}function um(t){for(var e=[],r=t.split(`
17
17
  `),n=0;n<r.length;n++){var i=r[n];r[n+1]&&(i+="@"+r[n+1],n++),e.push(i)}return{src:t,obj:e}}function qu(t){var e=null;if(t)try{if(t[vn])e=Pa(t[vn]);else if(t[Ba]&&t[Ba][vn])e=Pa(t[Ba][vn]);else if(t.exception&&t.exception[vn])e=Pa(t.exception[vn]);else if(Fu(t))e=t;else if(Fu(t[Jl]))e=t[Jl];else if(window&&window.opera&&t[ec])e=um(t.message);else if(et(t))e=Pa(t);else{var r=t[ec]||t[Hu]||"";et(t[Lu])&&(r&&(r+=`
18
18
  `),r+=" from "+t[Lu]),r&&(e=Pa(r))}}catch(n){e=Pa(n)}return e||{src:"",obj:null}}function fm(t){var e="";return t&&(t.obj?tt(t.obj,function(r){e+=r+`
19
- `}):e=t.src||""),e}function dm(t){var e,r=t.obj;if(r&&r.length>0){e=[];var n=0,i=0;tt(r,function(D){var ce=D.toString();if(rc.regex.test(ce)){var P=new rc(ce,n++);i+=P.sizeInBytes,e.push(P)}});var a=32*1024;if(i>a)for(var s=0,v=e.length-1,d=0,p=s,B=v;s<v;){var z=e[s].sizeInBytes,ee=e[v].sizeInBytes;if(d+=z+ee,d>a){var te=B-p+1;e.splice(p,te);break}p=s,B=v,s++,v--}}return e}function Us(t){var e="";if(t&&(e=t.typeName||t.name||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor.toString());e=n&&n.length>1?n[1]:""}catch{}return e}function Ql(t){if(t)try{if(!et(t)){var e=Us(t),r=tc(t,!1);return(!r||r==="{}")&&(t[Ba]&&(t=t[Ba],e=Us(t)),r=tc(t,!0)),r.indexOf(e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}var xr=function(t){ut(e,t);function e(r,n,i,a,s,v){var d=t.call(this)||this;return d.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0},cm(n)?(d.exceptions=n.exceptions,d.properties=n.properties,d.measurements=n.measurements,n.severityLevel&&(d.severityLevel=n.severityLevel),n.id&&(d.id=n.id),n.problemGroup&&(d.problemGroup=n.problemGroup),d.ver=2,De(n.isManual)||(d.isManual=n.isManual)):(i||(i={}),d.exceptions=[new Uu(r,n,i)],d.properties=Br(r,i),d.measurements=Nr(r,a),s&&(d.severityLevel=s),v&&(d.id=v)),d}return e.CreateAutoException=function(r,n,i,a,s,v,d,p){var B=Us(s||v||r);return{message:Vu(r,B),url:n,lineNumber:i,columnNumber:a,error:Ql(s||v||r),evt:Ql(v||r),typeName:B,stackDetails:qu(d||s||v),errorSrc:p}},e.CreateFromInterface=function(r,n,i,a){var s=n.exceptions&&Ni(n.exceptions,function(d){return Uu.CreateFromInterface(r,d)}),v=new e(r,Qt(Qt({},n),{exceptions:s}),i,a);return v},e.prototype.toInterface=function(){var r=this,n=r.exceptions,i=r.properties,a=r.measurements,s=r.severityLevel,v=r.problemGroup,d=r.id,p=r.isManual,B=n instanceof Array&&Ni(n,function(z){return z.toInterface()})||void 0;return{ver:"4.0",exceptions:B,severityLevel:s,properties:i,measurements:a,problemGroup:v,id:d,isManual:p}},e.CreateSimpleException=function(r,n,i,a,s,v){return{exceptions:[{hasFullStack:!0,message:r,stack:s,typeName:n}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e.formatError=Ql,e}(ku);var Uu=function(t){ut(e,t);function e(r,n,i){var a=t.call(this)||this;if(a.aiDataContract={id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2},lm(n))a.typeName=n.typeName,a.message=n.message,a[vn]=n[vn],a.parsedStack=n.parsedStack,a.hasFullStack=n.hasFullStack;else{var s=n,v=s&&s.evt;_a(s)||(s=s[Ba]||v||s),a.typeName=Mt(r,Us(s))||ar,a.message=yo(r,Vu(n||s,a.typeName))||ar;var d=n[Jl]||qu(n);a.parsedStack=dm(d),a[vn]=Ol(r,fm(d)),a.hasFullStack=ur(a.parsedStack)&&a.parsedStack.length>0,i&&(i.typeName=i.typeName||a.typeName)}return a}return e.prototype.toInterface=function(){var r=this.parsedStack instanceof Array&&Ni(this.parsedStack,function(i){return i.toInterface()}),n={id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this[vn],parsedStack:r||void 0};return n},e.CreateFromInterface=function(r,n){var i=n.parsedStack instanceof Array&&Ni(n.parsedStack,function(s){return rc.CreateFromInterface(s)})||n.parsedStack,a=new e(r,Qt(Qt({},n),{parsedStack:i}));return a},e}(Ou);var rc=function(t){ut(e,t);function e(r,n){var i=t.call(this)||this;if(i.sizeInBytes=0,i.aiDataContract={level:1,method:1,assembly:0,fileName:0,line:0},typeof r=="string"){var a=r;i.level=n,i.method=sm,i.assembly=Jt(a),i.fileName="",i.line=0;var s=a.match(e.regex);s&&s.length>=5&&(i.method=Jt(s[2])||i.method,i.fileName=Jt(s[4]),i.line=parseInt(s[5])||0)}else i.level=r.level,i.method=r.method,i.assembly=r.assembly,i.fileName=r.fileName,i.line=r.line,i.sizeInBytes=0;return i.sizeInBytes+=i.method.length,i.sizeInBytes+=i.fileName.length,i.sizeInBytes+=i.assembly.length,i.sizeInBytes+=e.baseSize,i.sizeInBytes+=i.level.toString().length,i.sizeInBytes+=i.line.toString().length,i}return e.CreateFromInterface=function(r){return new e(r,null)},e.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},e.regex=/^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/,e.baseSize=58,e}(Du);var zu=function(){function t(){this.ver=2,this.metrics=[],this.properties={},this.measurements={}}return t}();var Hs;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(Hs||(Hs={}));var ju=function(){function t(){this.kind=Hs.Measurement}return t}();var Gu=function(t){ut(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},r}return e}(ju);var en=function(t){ut(e,t);function e(r,n,i,a,s,v,d,p,B){var z=t.call(this)||this;z.aiDataContract={ver:1,metrics:1,properties:0};var ee=new Gu;return ee.count=a>0?a:void 0,ee.max=isNaN(v)||v===null?void 0:v,ee.min=isNaN(s)||s===null?void 0:s,ee.name=Mt(r,n)||ar,ee.value=i,ee.stdDev=isNaN(d)||d===null?void 0:d,z.metrics=[ee],z.properties=Br(r,p),z.measurements=Nr(r,B),z}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(zu);var Ro=function(t){ut(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(Fs);var Dr=function(t){ut(e,t);function e(r,n,i,a,s,v,d){var p=t.call(this)||this;return p.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0},p.id=Ll(r,d),p.url=Qn(r,i),p.name=Mt(r,n)||ar,isNaN(a)||(p.duration=Qr(a)),p.properties=Br(r,s),p.measurements=Nr(r,v),p}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(Ro);var Xu=function(){function t(){this.ver=2,this.success=!0,this.properties={},this.measurements={}}return t}();var tn=function(t){ut(e,t);function e(r,n,i,a,s,v,d,p,B,z,ee,te){B===void 0&&(B="Ajax");var D=t.call(this)||this;D.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0},D.id=n,D.duration=Qr(s),D.success=v,D.resultCode=d+"",D.type=Mt(r,B);var ce=Bu(r,i,p,a);return D.data=Qn(r,a)||ce.data,D.target=Mt(r,ce.target),z&&(D.target="".concat(D.target," | ").concat(z)),D.name=Mt(r,ce.name),D.properties=Br(r,ee),D.measurements=Nr(r,te),D}return e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(Xu);var Ku=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Pn=function(t){ut(e,t);function e(r,n,i,a,s){var v=t.call(this)||this;return v.aiDataContract={ver:1,message:1,severityLevel:0,properties:0},n=n||ar,v.message=yo(r,n),v.properties=Br(r,a),v.measurements=Nr(r,s),i&&(v.severityLevel=i),v}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(Ku);var Wu=function(t){ut(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(Ro);var Bn=function(t){ut(e,t);function e(r,n,i,a,s,v,d){var p=t.call(this)||this;return p.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0},p.url=Qn(r,i),p.name=Mt(r,n)||ar,p.properties=Br(r,s),p.measurements=Nr(r,v),d&&(p.domProcessing=d.domProcessing,p.duration=d.duration,p.networkConnect=d.networkConnect,p.perfTotal=d.perfTotal,p.receivedResponse=d.receivedResponse,p.sentRequest=d.sentRequest),p}return e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(Wu);var qn=function(t){ut(e,t);function e(r,n){var i=t.call(this)||this;return i.aiDataContract={baseType:1,baseData:1},i.baseType=r,i.baseData=n,i}return e}(Zl);var Na;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(Na||(Na={}));function hi(t){var e="ai."+t+".";return function(r){return e+r}}var To=hi("application"),pr=hi("device"),Vs=hi("location"),Da=hi("operation"),nc=hi("session"),pi=hi("user"),Xi=hi("cloud"),Ao=hi("internal"),ka=function(t){ut(e,t);function e(){return t.call(this)||this}return e}(rl({applicationVersion:To("ver"),applicationBuild:To("build"),applicationTypeId:To("typeId"),applicationId:To("applicationId"),applicationLayer:To("layer"),deviceId:pr("id"),deviceIp:pr("ip"),deviceLanguage:pr("language"),deviceLocale:pr("locale"),deviceModel:pr("model"),deviceFriendlyName:pr("friendlyName"),deviceNetwork:pr("network"),deviceNetworkName:pr("networkName"),deviceOEMName:pr("oemName"),deviceOS:pr("os"),deviceOSVersion:pr("osVersion"),deviceRoleInstance:pr("roleInstance"),deviceRoleName:pr("roleName"),deviceScreenResolution:pr("screenResolution"),deviceType:pr("type"),deviceMachineName:pr("machineName"),deviceVMName:pr("vmName"),deviceBrowser:pr("browser"),deviceBrowserVersion:pr("browserVersion"),locationIp:Vs("ip"),locationCountry:Vs("country"),locationProvince:Vs("province"),locationCity:Vs("city"),operationId:Da("id"),operationName:Da("name"),operationParentId:Da("parentId"),operationRootId:Da("rootId"),operationSyntheticSource:Da("syntheticSource"),operationCorrelationVector:Da("correlationVector"),sessionId:nc("id"),sessionIsFirst:nc("isFirst"),sessionIsNew:nc("isNew"),userAccountAcquisitionDate:pi("accountAcquisitionDate"),userAccountId:pi("accountId"),userAgent:pi("userAgent"),userId:pi("id"),userStoreRegion:pi("storeRegion"),userAuthUserId:pi("authUserId"),userAnonymousUserAcquisitionDate:pi("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:pi("authUserAcquisitionDate"),cloudName:Xi("name"),cloudRole:Xi("role"),cloudRoleVer:Xi("roleVer"),cloudRoleInstance:Xi("roleInstance"),cloudEnvironment:Xi("environment"),cloudLocation:Xi("location"),cloudDeploymentUnit:Xi("deploymentUnit"),internalNodeName:Ao("nodeName"),internalSdkVersion:Ao("sdkVersion"),internalAgentVersion:Ao("agentVersion"),internalSnippet:Ao("snippet"),internalSdkSrc:Ao("sdkSrc")}));var mn=function(){function t(){}return t.create=function(e,r,n,i,a,s){if(n=Mt(i,n)||ar,De(e)||De(r)||De(n))throw Error("Input doesn't contain all required fields");var v="";e[Ps]&&(v=e[Ps],delete e[Ps]);var d={name:n,time:Pr(new Date),iKey:v,ext:s||{},tags:[],data:{},baseType:r,baseData:e};return De(a)||Tt(a,function(p,B){d.data[p]=B}),d},t}();var kr={UserExt:"user",DeviceExt:"device",TraceExt:"trace",WebExt:"web",AppExt:"app",OSExt:"os",SessionExt:"ses",SDKExt:"sdk"},Pt=new ka;var _i="AppInsightsPropertiesPlugin",Io="AppInsightsChannelPlugin",ic="ApplicationInsightsAnalytics";var Yu=function(){function t(e,r,n,i){gt(t,this,function(a){var s=null,v=[],d=!1,p;n&&(p=n.logger);function B(){n&&tt(n.getTransmissionControls(),function(ee){tt(ee,function(te){return te.flush(!0)})})}function z(ee){v.push(ee),s||(s=setInterval(function(){var te=v.slice(0),D=!1;v=[],tt(te,function(ce){ce()?D=!0:v.push(ce)}),v.length===0&&(clearInterval(s),s=null),D&&B()},100))}a.trackPageView=function(ee,te){var D=ee.name;if(De(D)||typeof D!="string"){var ce=ir();D=ee.name=ce&&ce.title||""}var P=ee.uri;if(De(P)||typeof P!="string"){var oe=$r();P=ee.uri=oe&&oe.href||""}if(!i.isPerformanceTimingSupported()){e.sendPageViewInternal(ee,te),B(),p.throwInternal(Pe.WARNING,we.NavigationTimingNotSupported,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");return}var se=!1,xe,Ge=i.getPerformanceTiming().navigationStart;Ge>0&&(xe=mr(Ge,+new Date),i.shouldCollectDuration(xe)||(xe=void 0));var lt;!De(te)&&!De(te.duration)&&(lt=te.duration),(r||!isNaN(lt))&&(isNaN(lt)&&(te||(te={}),te.duration=xe),e.sendPageViewInternal(ee,te),B(),se=!0);var ft=6e4;te||(te={}),z(function(){var st=!1;try{if(i.isPerformanceTimingDataReady()){st=!0;var yt={name:D,uri:P};i.populatePageViewPerformanceEvent(yt),!yt.isValid&&!se?(te.duration=xe,e.sendPageViewInternal(ee,te)):(se||(te.duration=yt.durationMs,e.sendPageViewInternal(ee,te)),d||(e.sendPageViewPerformanceInternal(yt,te),d=!0))}else Ge>0&&mr(Ge,+new Date)>ft&&(st=!0,se||(te.duration=ft,e.sendPageViewInternal(ee,te)))}catch(Xt){p.throwInternal(Pe.CRITICAL,we.TrackPVFailedCalc,"trackPageView failed on page load calculation: "+_t(Xt),{exception:it(Xt)})}return st})}})}return t}();var $u=function(){function t(e,r){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=r,this._logger=e}return t.prototype.trackPreviousPageVisit=function(e,r){try{var n=this.restartPageVisitTimer(e,r);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(i){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+it(i))}},t.prototype.restartPageVisitTimer=function(e,r){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,r),n}catch(i){return this._logger.warnToConsole("Call to restart failed: "+it(i)),null}},t.prototype.startPageVisitTimer=function(e,r){try{if(ji()){Ia(this._logger,this.prevPageVisitDataKeyName)!=null&&wr("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new Sm(e,r),i=vr().stringify(n);Ca(this._logger,this.prevPageVisitDataKeyName,i)}}catch(a){this._logger.warnToConsole("Call to start failed: "+it(a))}},t.prototype.stopPageVisitTimer=function(){try{if(ji()){var e=fr(),r=Ia(this._logger,this.prevPageVisitDataKeyName);if(r&&An()){var n=vr().parse(r);return n.pageVisitTime=e-n.pageVisitStartTime,Kl(this._logger,this.prevPageVisitDataKeyName),n}else return null}return null}catch(i){return this._logger.warnToConsole("Stop page visit timer failed: "+it(i)),null}},t}();var Sm=function(){function t(e,r){this.pageVisitStartTime=fr(),this.pageName=e,this.pageUrl=r}return t}();var Zu=function(){function t(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}return t.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var r=this.getPerformanceNavigationTiming(),n=this.getPerformanceTiming(),i=0,a=0,s=0,v=0,d=0;(r||n)&&(r?(i=r.duration,a=r.startTime===0?r.connectEnd:mr(r.startTime,r.connectEnd),s=mr(r.requestStart,r.responseStart),v=mr(r.responseStart,r.responseEnd),d=mr(r.responseEnd,r.loadEventEnd)):(i=mr(n.navigationStart,n.loadEventEnd),a=mr(n.navigationStart,n.connectEnd),s=mr(n.requestStart,n.responseStart),v=mr(n.responseStart,n.responseEnd),d=mr(n.responseEnd,n.loadEventEnd)),i===0?this._logger.throwInternal(Pe.WARNING,we.ErrorPVCalc,"error calculating page view performance.",{total:i,network:a,request:s,response:v,dom:d}):this.shouldCollectDuration(i,a,s,v,d)?i<Math.floor(a)+Math.floor(s)+Math.floor(v)+Math.floor(d)?this._logger.throwInternal(Pe.WARNING,we.ClientPerformanceMathError,"client performance math error.",{total:i,network:a,request:s,response:v,dom:d}):(e.durationMs=i,e.perfTotal=e.duration=Qr(i),e.networkConnect=Qr(a),e.sentRequest=Qr(s),e.receivedResponse=Qr(v),e.domProcessing=Qr(d),e.isValid=!0):this._logger.throwInternal(Pe.WARNING,we.InvalidDurationValue,"Invalid page load duration value. Browser perf data won't be sent.",{total:i,network:a,request:s,response:v,dom:d}))},t.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?Zr().timing:null},t.prototype.getPerformanceNavigationTiming=function(){return this.isPerformanceNavigationTimingSupported()?Zr().getEntriesByType("navigation")[0]:null},t.prototype.isPerformanceNavigationTimingSupported=function(){var e=Zr();return e&&e.getEntriesByType&&e.getEntriesByType("navigation").length>0},t.prototype.isPerformanceTimingSupported=function(){var e=Zr();return e&&e.timing},t.prototype.isPerformanceTimingDataReady=function(){var e=Zr(),r=e?e.timing:0;return r&&r.domainLookupStart>0&&r.navigationStart>0&&r.responseStart>0&&r.requestStart>0&&r.loadEventEnd>0&&r.responseEnd>0&&r.connectEnd>0&&r.domLoading>0},t.prototype.shouldCollectDuration=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=Rr()||{},i=["googlebot","adsbot-google","apis-google","mediapartners-google"],a=n.userAgent,s=!1;if(a)for(var v=0;v<i.length;v++)s=s||a.toLowerCase().indexOf(i[v])!==-1;if(s)return!1;for(var v=0;v<e.length;v++)if(e[v]<0||e[v]>=this.MAX_DURATION_ALLOWED)return!1;return!0},t}();var Qu="duration",ac="event";function Co(t,e){t&&t.dispatchEvent&&e&&t.dispatchEvent(e)}function gm(t){if(t&&t.reason){var e=t.reason;return!et(e)&&at(e.toString)?e.toString():it(e)}return t||""}var oc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier=ic,r.priority=180,r.autoRoutePVDelay=500;var n,i,a,s=0,v,d;return gt(e,r,function(p,B){var z=$r(!0);v=z&&z.href||"",p.getCookieMgr=function(){return Ui(p.core)},p.processTelemetry=function(P,oe){Vn(p.core,function(){return p.identifier+":processTelemetry"},function(){var se=!1,xe=p._telemetryInitializers.length;oe=p._getTelCtx(oe);for(var Ge=0;Ge<xe;++Ge){var lt=p._telemetryInitializers[Ge];if(lt)try{if(lt.apply(null,[P])===!1){se=!0;break}}catch(ft){oe.diagLog().throwInternal(Pe.CRITICAL,we.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+_t(ft),{exception:it(ft)},!0)}}se||p.processNext(P,oe)},function(){return{item:P}},!P.sync)},p.trackEvent=function(P,oe){try{var se=mn.create(P,Jr.dataType,Jr.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.WARNING,we.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+_t(xe),{exception:it(xe)})}},p.startTrackEvent=function(P){try{n.start(P)}catch(oe){p.diagLog().throwInternal(Pe.CRITICAL,we.StartTrackEventFailed,"startTrackEvent failed, event will not be collected: "+_t(oe),{exception:it(oe)})}},p.stopTrackEvent=function(P,oe,se){try{n.stop(P,void 0,oe)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.StopTrackEventFailed,"stopTrackEvent failed, event will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackTrace=function(P,oe){try{var se=mn.create(P,Pn.dataType,Pn.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.WARNING,we.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackMetric=function(P,oe){try{var se=mn.create(P,en.dataType,en.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackMetricFailed,"trackMetric failed, metric will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackPageView=function(P,oe){try{var se=P||{};p._pageViewManager.trackPageView(se,Qt(Qt(Qt({},se.properties),se.measurements),oe)),p.config.autoTrackPageVisitTime&&p._pageVisitTimeManager.trackPreviousPageVisit(se.name,se.uri)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackPVFailed,"trackPageView failed, page view will not be collected: "+_t(xe),{exception:it(xe)})}},p.sendPageViewInternal=function(P,oe,se){var xe=ir();xe&&(P.refUri=P.refUri===void 0?xe.referrer:P.refUri);var Ge=mn.create(P,Dr.dataType,Dr.envelopeType,p.diagLog(),oe,se);p.core.track(Ge),s=0},p.sendPageViewPerformanceInternal=function(P,oe,se){var xe=mn.create(P,Bn.dataType,Bn.envelopeType,p.diagLog(),oe,se);p.core.track(xe)},p.trackPageViewPerformance=function(P,oe){try{p._pageViewPerformanceManager.populatePageViewPerformanceEvent(P),p.sendPageViewPerformanceInternal(P,oe)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackPVFailed,"trackPageViewPerformance failed, page view will not be collected: "+_t(se),{exception:it(se)})}},p.startTrackPage=function(P){try{if(typeof P!="string"){var oe=ir();P=oe&&oe.title||""}i.start(P)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.StartTrackFailed,"startTrackPage failed, page view may not be collected: "+_t(se),{exception:it(se)})}},p.stopTrackPage=function(P,oe,se,xe){try{if(typeof P!="string"){var Ge=ir();P=Ge&&Ge.title||""}if(typeof oe!="string"){var lt=$r();oe=lt&&lt.href||""}i.stop(P,oe,se,xe),p.config.autoTrackPageVisitTime&&p._pageVisitTimeManager.trackPreviousPageVisit(P,oe)}catch(ft){p.diagLog().throwInternal(Pe.CRITICAL,we.StopTrackFailed,"stopTrackPage failed, page view will not be collected: "+_t(ft),{exception:it(ft)})}},p.sendExceptionInternal=function(P,oe,se){var xe=P.exception||P.error||new Error(ar),Ge=new xr(p.diagLog(),xe,P.properties||oe,P.measurements,P.severityLevel,P.id).toInterface(),lt=mn.create(Ge,xr.dataType,xr.envelopeType,p.diagLog(),oe,se);p.core.track(lt)},p.trackException=function(P,oe){try{p.sendExceptionInternal(P,oe)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackExceptionFailed,"trackException failed, exception will not be collected: "+_t(se),{exception:it(se)})}},p._onerror=function(P){var oe=P&&P.error,se=P&&P.evt;try{if(!se){var xe=Hn();xe&&(se=xe[ac])}var Ge=P&&P.url||(ir()||{}).URL,lt=P.errorSrc||"window.onerror@"+Ge+":"+(P.lineNumber||0)+":"+(P.columnNumber||0),ft={errorSrc:lt,url:Ge,lineNumber:P.lineNumber||0,columnNumber:P.columnNumber||0,message:P.message};Hl(P.message,P.url,P.lineNumber,P.columnNumber,P.error)?ce(xr.CreateAutoException("Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",Ge,P.lineNumber||0,P.columnNumber||0,oe,se,null,lt),ft):(P.errorSrc||(P.errorSrc=lt),p.trackException({exception:P,severityLevel:Na.Error},ft))}catch(yt){var st=oe?oe.name+", "+oe.message:"null";p.diagLog().throwInternal(Pe.CRITICAL,we.ExceptionWhileLoggingError,"_onError threw exception while logging error, error will not be collected: "+_t(yt),{exception:it(yt),errorString:st})}},p.addTelemetryInitializer=function(P){p._telemetryInitializers.push(P)},p.initialize=function(P,oe,se,xe){if(!p.isInitialized()){if(De(oe))throw Error("Error initializing");B.initialize(P,oe,se,xe),p.setInitialized(!1);var Ge=p._getTelCtx(),lt=p.identifier;p.config=Ge.getExtCfg(lt);var ft=e.getDefaultConfig(P);ft!==void 0&&Tt(ft,function(St,kt){p.config[St]=Ge.getConfig(lt,St,kt),p.config[St]===void 0&&(p.config[St]=kt)}),p.config.isStorageUseDisabled&&zl();var st={instrumentationKey:function(){return P.instrumentationKey},accountId:function(){return p.config.accountId||P.accountId},sessionRenewalMs:function(){return p.config.sessionRenewalMs||P.sessionRenewalMs},sessionExpirationMs:function(){return p.config.sessionExpirationMs||P.sessionExpirationMs},sampleRate:function(){return p.config.samplingPercentage||P.samplingPercentage},sdkExtension:function(){return p.config.sdkExtension||P.sdkExtension},isBrowserLinkTrackingEnabled:function(){return p.config.isBrowserLinkTrackingEnabled||P.isBrowserLinkTrackingEnabled},appId:function(){return p.config.appId||P.appId}};p._pageViewPerformanceManager=new Zu(p.core),p._pageViewManager=new Yu(r,p.config.overridePageViewDuration,p.core,p._pageViewPerformanceManager),p._pageVisitTimeManager=new $u(p.diagLog(),function(St,kt,Nt){return ee(St,kt,Nt)}),p._telemetryInitializers=p._telemetryInitializers||[],te(st),n=new Ju(p.diagLog(),"trackEvent"),n.action=function(St,kt,Nt,It){It||(It={}),It[Qu]=Nt.toString(),p.trackEvent({name:St,properties:It})},i=new Ju(p.diagLog(),"trackPageView"),i.action=function(St,kt,Nt,It,Qe){De(It)&&(It={}),It[Qu]=Nt.toString();var T={name:St,uri:kt,properties:It,measurements:Qe};p.sendPageViewInternal(T,It)};var yt=Hn(),Xt=cl(),tr=$r(!0),sr=r;if(p.config.disableExceptionTracking===!1&&!p.config.autoExceptionInstrumented&&yt){var an="onerror",Tr=yt[an];yt.onerror=function(St,kt,Nt,It,Qe){var T=yt[ac],le=Tr&&Tr(St,kt,Nt,It,Qe);return le!==!0&&sr._onerror(xr.CreateAutoException(St,kt,Nt,It,Qe,T)),le},p.config.autoExceptionInstrumented=!0}if(p.config.disableExceptionTracking===!1&&p.config.enableUnhandledPromiseRejectionTracking===!0&&!p.config.autoUnhandledPromiseInstrumented&&yt){var hr="onunhandledrejection",gr=yt[hr];yt[hr]=function(St){var kt=yt[ac],Nt=gr&&gr.call(yt,St);return Nt!==!0&&sr._onerror(xr.CreateAutoException(gm(St),tr?tr.href:"",0,0,St,kt)),Nt},p.config.autoUnhandledPromiseInstrumented=!0}if(p.config.enableAutoRouteTracking===!0&&Xt&&at(Xt.pushState)&&at(Xt.replaceState)&&yt&&typeof Event<"u"){var $t=r;tt(se,function(St){St.identifier===_i&&(a=St)}),Xt.pushState=function(St){return function(){var Nt=St.apply(this,arguments);return Co(yt,Vi($t.config.namePrefix+"pushState")),Co(yt,Vi($t.config.namePrefix+"locationchange")),Nt}}(Xt.pushState),Xt.replaceState=function(St){return function(){var Nt=St.apply(this,arguments);return Co(yt,Vi($t.config.namePrefix+"replaceState")),Co(yt,Vi($t.config.namePrefix+"locationchange")),Nt}}(Xt.replaceState),yt.addEventListener&&(yt.addEventListener($t.config.namePrefix+"popstate",function(){Co(yt,Vi($t.config.namePrefix+"locationchange"))}),yt.addEventListener($t.config.namePrefix+"locationchange",function(){if(a&&a.context&&a.context.telemetryTrace){a.context.telemetryTrace.traceID=zr();var St="_unknown_";tr&&tr.pathname&&(St=tr.pathname+(tr.hash||"")),a.context.telemetryTrace.name=Mt($t.diagLog(),St)}d&&(v=d),d=tr&&tr.href||"",setTimeout(function(kt){$t.trackPageView({refUri:kt,properties:{duration:0}})}.bind(r,v),$t.autoRoutePVDelay)}))}p.setInitialized(!0)}};function ee(P,oe,se){var xe={PageName:P,PageUrl:oe};p.trackMetric({name:"PageVisitTime",average:se,max:se,min:se,sampleCount:1},xe)}function te(P){if(!P.isBrowserLinkTrackingEnabled()){var oe=["/browserLinkSignalR/","/__browserLink/"],se=function(xe){if(xe.baseType===tn.dataType){var Ge=xe.baseData;if(Ge){for(var lt=0;lt<oe.length;lt++)if(Ge.target&&Ge.target.indexOf(oe[lt])>=0)return!1}}return!0};D(se)}}function D(P){p._telemetryInitializers.push(P)}function ce(P,oe){var se=mn.create(P,xr.dataType,xr.envelopeType,p.diagLog(),oe);p.core.track(se)}}),r}return e.getDefaultConfig=function(r){return r||(r={}),r.sessionRenewalMs=30*60*1e3,r.sessionExpirationMs=24*60*60*1e3,r.disableExceptionTracking=fn(r.disableExceptionTracking),r.autoTrackPageVisitTime=fn(r.autoTrackPageVisitTime),r.overridePageViewDuration=fn(r.overridePageViewDuration),r.enableUnhandledPromiseRejectionTracking=fn(r.enableUnhandledPromiseRejectionTracking),(isNaN(r.samplingPercentage)||r.samplingPercentage<=0||r.samplingPercentage>=100)&&(r.samplingPercentage=100),r.isStorageUseDisabled=fn(r.isStorageUseDisabled),r.isBrowserLinkTrackingEnabled=fn(r.isBrowserLinkTrackingEnabled),r.enableAutoRouteTracking=fn(r.enableAutoRouteTracking),r.namePrefix=r.namePrefix||"",r.enableDebug=fn(r.enableDebug),r.disableFlushOnBeforeUnload=fn(r.disableFlushOnBeforeUnload),r.disableFlushOnUnload=fn(r.disableFlushOnUnload,r.disableFlushOnBeforeUnload),r},e.Version="2.7.4",e}(In);var Ju=function(){function t(e,r){var n=this,i={};n.start=function(a){typeof i[a]<"u"&&e.throwInternal(Pe.WARNING,we.StartCalledMoreThanOnce,"start was called more than once for this event without calling stop.",{name:a,key:a},!0),i[a]=+new Date},n.stop=function(a,s,v,d){var p=i[a];if(isNaN(p))e.throwInternal(Pe.WARNING,we.StopCalledWithoutStart,"stop was called without a corresponding start.",{name:a,key:a},!0);else{var B=+new Date,z=mr(p,B);n.action(a,s,z,v,d)}delete i[a],i[a]=void 0}}return t}();var ef=function(){function t(e,r){var n=[],i=!1;this._get=function(){return n},this._set=function(a){return n=a,n},gt(t,this,function(a){a.enqueue=function(s){if(a.count()>=r.eventsLimitInMem()){i||(e.throwInternal(Pe.WARNING,we.InMemoryStorageBufferFull,"Maximum in-memory buffer size reached: "+a.count(),!0),i=!0);return}n.push(s)},a.count=function(){return n.length},a.size=function(){for(var s=n.length,v=0;v<n.length;v++)s+=n[v].length;return r.emitLineDelimitedJson()||(s+=2),s},a.clear=function(){n=[],i=!1},a.getItems=function(){return n.slice(0)},a.batchPayloads=function(s){if(s&&s.length>0){var v=r.emitLineDelimitedJson()?s.join(`
20
- `):"["+s.join(",")+"]";return v}return null}})}return t}(),tf=function(t){ut(e,t);function e(r,n){var i=t.call(this,r,n)||this;return gt(e,i,function(a,s){a.markAsSent=function(v){s.clear()},a.clearSent=function(v){}}),i}return e}(ef);var rf=function(t){ut(e,t);function e(r,n){var i=t.call(this,r,n)||this,a=!1;return gt(e,i,function(s,v){var d=ee(e.BUFFER_KEY),p=ee(e.SENT_BUFFER_KEY),B=s._set(d.concat(p));B.length>e.MAX_BUFFER_SIZE&&(B.length=e.MAX_BUFFER_SIZE),te(e.SENT_BUFFER_KEY,[]),te(e.BUFFER_KEY,B),s.enqueue=function(D){if(s.count()>=e.MAX_BUFFER_SIZE){a||(r.throwInternal(Pe.WARNING,we.SessionStorageBufferFull,"Maximum buffer size reached: "+s.count(),!0),a=!0);return}v.enqueue(D),te(e.BUFFER_KEY,s._get())},s.clear=function(){v.clear(),te(e.BUFFER_KEY,s._get()),te(e.SENT_BUFFER_KEY,[]),a=!1},s.markAsSent=function(D){te(e.BUFFER_KEY,s._set(z(D,s._get())));var ce=ee(e.SENT_BUFFER_KEY);ce instanceof Array&&D instanceof Array&&(ce=ce.concat(D),ce.length>e.MAX_BUFFER_SIZE&&(r.throwInternal(Pe.CRITICAL,we.SessionStorageBufferFull,"Sent buffer reached its maximum size: "+ce.length,!0),ce.length=e.MAX_BUFFER_SIZE),te(e.SENT_BUFFER_KEY,ce))},s.clearSent=function(D){var ce=ee(e.SENT_BUFFER_KEY);ce=z(D,ce),te(e.SENT_BUFFER_KEY,ce)};function z(D,ce){var P=[];return tt(ce,function(oe){!at(oe)&&Un(D,oe)===-1&&P.push(oe)}),P}function ee(D){var ce=D;try{ce=n.namePrefix&&n.namePrefix()?n.namePrefix()+"_"+ce:ce;var P=Ia(r,ce);if(P){var oe=vr().parse(P);if(et(oe)&&(oe=vr().parse(oe)),oe&&ur(oe))return oe}}catch(se){r.throwInternal(Pe.CRITICAL,we.FailedToRestoreStorageBuffer," storage key: "+ce+", "+_t(se),{exception:it(se)})}return[]}function te(D,ce){var P=D;try{P=n.namePrefix&&n.namePrefix()?n.namePrefix()+"_"+P:P;var oe=JSON.stringify(ce);Ca(r,P,oe)}catch(se){Ca(r,P,JSON.stringify([])),r.throwInternal(Pe.WARNING,we.FailedToSetStorageBuffer," storage key: "+P+", "+_t(se)+". Buffer cleared",{exception:it(se)})}}}),i}return e.BUFFER_KEY="AI_buffer",e.SENT_BUFFER_KEY="AI_sentBuffer",e.MAX_BUFFER_SIZE=2e3,e}(ef);var sc="baseType",zt="baseData",Sr="properties",nf="true";function or(t,e,r){return ht(t,e,r,ga)}function bm(t,e,r){var n=r.tags=r.tags||{},i=e.ext=e.ext||{},a=e.tags=e.tags||[],s=i.user;s&&(or(n,Pt.userAuthUserId,s.authId),or(n,Pt.userId,s.id||s.localId));var v=i.app;v&&or(n,Pt.sessionId,v.sesId);var d=i.device;d&&(or(n,Pt.deviceId,d.id||d.localId),or(n,Pt.deviceType,d.deviceClass),or(n,Pt.deviceIp,d.ip),or(n,Pt.deviceModel,d.model),or(n,Pt.deviceType,d.deviceType));var p=e.ext.web;if(p){or(n,Pt.deviceLanguage,p.browserLang),or(n,Pt.deviceBrowserVersion,p.browserVer),or(n,Pt.deviceBrowser,p.browser);var B=r.data=r.data||{},z=B[zt]=B[zt]||{},ee=z[Sr]=z[Sr]||{};or(ee,"domain",p.domain),or(ee,"isManual",p.isManual?nf:null),or(ee,"screenRes",p.screenRes),or(ee,"userConsent",p.userConsent?nf:null)}var te=i.os;te&&or(n,Pt.deviceOS,te.name);var D=i.trace;D&&(or(n,Pt.operationParentId,D.parentID),or(n,Pt.operationName,Mt(t,D.name)),or(n,Pt.operationId,D.traceID));for(var ce={},P=a.length-1;P>=0;P--){var oe=a[P];Tt(oe,function(xe,Ge){ce[xe]=Ge}),a.splice(P,1)}Tt(a,function(xe,Ge){ce[xe]=Ge});var se=Qt(Qt({},n),ce);se[Pt.internalSdkVersion]||(se[Pt.internalSdkVersion]="javascript:".concat(xm.Version)),r.tags=Ss(se)}function Si(t,e,r){De(t)||Tt(t,function(n,i){Sa(i)?r[n]=i:et(i)?e[n]=i:An()&&(e[n]=vr().stringify(i))})}function Ki(t,e){De(t)||Tt(t,function(r,n){t[r]=n||e})}function Wi(t,e,r,n){var i=new Ls(t,n,e);or(i,"sampleRate",r[Ta]),(r[zt]||{}).startTime&&(i.time=Pr(r[zt].startTime)),i.iKey=r.iKey;var a=r.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),bm(t,r,i),r.tags=r.tags||[],Ss(i)}function Yi(t,e){De(e[zt])&&t.throwInternal(Pe.CRITICAL,we.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.")}var xm={Version:"2.7.4"};function af(t,e,r){Yi(t,e);var n=e[zt].measurements||{},i=e[zt][Sr]||{};Si(e.data,i,n),De(r)||Ki(i,r);var a=e[zt];if(De(a))return t.warnToConsole("Invalid input for dependency data"),null;var s=a[Sr]&&a[Sr][Eo]?a[Sr][Eo]:"GET",v=new tn(t,a.id,a.target,a.name,a.duration,a.success,a.responseCode,s,a.type,a.correlationContext,i,n),d=new qn(tn.dataType,v);return Wi(t,tn.envelopeType,e,d)}function lc(t,e,r){Yi(t,e);var n={},i={};e[sc]!==Jr.dataType&&(n.baseTypeSource=e[sc]),e[sc]===Jr.dataType?(n=e[zt][Sr]||{},i=e[zt].measurements||{}):e[zt]&&Si(e[zt],n,i),Si(e.data,n,i),De(r)||Ki(n,r);var a=e[zt].name,s=new Jr(t,a,n,i),v=new qn(Jr.dataType,s);return Wi(t,Jr.envelopeType,e,v)}function of(t,e,r){Yi(t,e);var n=e[zt].measurements||{},i=e[zt][Sr]||{};Si(e.data,i,n),De(r)||Ki(i,r);var a=e[zt],s=xr.CreateFromInterface(t,a,i,n),v=new qn(xr.dataType,s);return Wi(t,xr.envelopeType,e,v)}function sf(t,e,r){Yi(t,e);var n=e[zt],i=n[Sr]||{},a=n.measurements||{};Si(e.data,i,a),De(r)||Ki(i,r);var s=new en(t,n.name,n.average,n.sampleCount,n.min,n.max,n.stdDev,i,a),v=new qn(en.dataType,s);return Wi(t,en.envelopeType,e,v)}function lf(t,e,r){Yi(t,e);var n="duration",i,a=e[zt];!De(a)&&!De(a[Sr])&&!De(a[Sr][n])?(i=a[Sr][n],delete a[Sr][n]):!De(e.data)&&!De(e.data[n])&&(i=e.data[n],delete e.data[n]);var s=e[zt],v;((e.ext||{}).trace||{}).traceID&&(v=e.ext.trace.traceID);var d=s.id||v,p=s.name,B=s.uri,z=s[Sr]||{},ee=s.measurements||{};if(De(s.refUri)||(z.refUri=s.refUri),De(s.pageType)||(z.pageType=s.pageType),De(s.isLoggedIn)||(z.isLoggedIn=s.isLoggedIn.toString()),!De(s[Sr])){var te=s[Sr];Tt(te,function(P,oe){z[P]=oe})}Si(e.data,z,ee),De(r)||Ki(z,r);var D=new Dr(t,p,B,i,z,ee,d),ce=new qn(Dr.dataType,D);return Wi(t,Dr.envelopeType,e,ce)}function cf(t,e,r){Yi(t,e);var n=e[zt],i=n.name,a=n.uri||n.url,s=n[Sr]||{},v=n.measurements||{};Si(e.data,s,v),De(r)||Ki(s,r);var d=new Bn(t,i,a,void 0,s,v,n),p=new qn(Bn.dataType,d);return Wi(t,Bn.envelopeType,e,p)}function uf(t,e,r){Yi(t,e);var n=e[zt].message,i=e[zt].severityLevel,a=e[zt][Sr]||{},s=e[zt].measurements||{};Si(e.data,a,s),De(r)||Ki(a,r);var v=new Pn(t,n,i,a,s),d=new qn(Pn.dataType,v);return Wi(t,Pn.envelopeType,e,d)}var ff=function(){function t(e){gt(t,this,function(r){r.serialize=function(s){var v=n(s,"root");try{return vr().stringify(v)}catch(d){e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,d&&at(d.toString)?d.toString():"Error serializing object",null,!0)}};function n(s,v){var d="__aiCircularRefCheck",p={};if(!s)return e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,"cannot serialize object because it is null or undefined",{name:v},!0),p;if(s[d])return e.throwInternal(Pe.WARNING,we.CircularReferenceDetected,"Circular reference detected while serializing object",{name:v},!0),p;if(!s.aiDataContract){if(v==="measurements")p=a(s,"number",v);else if(v==="properties")p=a(s,"string",v);else if(v==="tags")p=a(s,"string",v);else if(ur(s))p=i(s,v);else{e.throwInternal(Pe.WARNING,we.CannotSerializeObjectNonSerializable,"Attempting to serialize an object which does not implement ISerializable",{name:v},!0);try{vr().stringify(s),p=s}catch(B){e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,B&&at(B.toString)?B.toString():"Error serializing object",null,!0)}}return p}return s[d]=!0,Tt(s.aiDataContract,function(B,z){var ee=at(z)?z()&1:z&1,te=at(z)?z()&4:z&4,D=z&2,ce=s[B]!==void 0,P=Rn(s[B])&&s[B]!==null;if(ee&&!ce&&!D)e.throwInternal(Pe.CRITICAL,we.MissingRequiredFieldSpecification,"Missing required field specification. The field is required but not present on source",{field:B,name:v});else if(!te){var oe=void 0;P?D?oe=i(s[B],B):oe=n(s[B],B):oe=s[B],oe!==void 0&&(p[B]=oe)}}),delete s[d],p}function i(s,v){var d;if(s)if(!ur(s))e.throwInternal(Pe.CRITICAL,we.ItemNotInArray,`This field was specified as an array in the contract but the item is not an array.\r
21
- `,{name:v},!0);else{d=[];for(var p=0;p<s.length;p++){var B=s[p],z=n(B,v+"["+p+"]");d.push(z)}}return d}function a(s,v,d){var p;return s&&(p={},Tt(s,function(B,z){if(v==="string")z===void 0?p[B]="undefined":z===null?p[B]="null":z.toString?p[B]=z.toString():p[B]="invalid field: toString() is not defined.";else if(v==="number")if(z===void 0)p[B]="undefined";else if(z===null)p[B]="null";else{var ee=parseFloat(z);isNaN(ee)?p[B]="NaN":p[B]=ee}else p[B]="invalid field: "+d+" is of unknown type.",e.throwInternal(Pe.CRITICAL,p[B],null,!0)})),p}})}return t}();var ym=function(){function t(){var e=Hn(),r=ir(),n=!1,i=!0;gt(t,this,function(a){try{if(e&&Tn(e,"online",d)&&(Tn(e,"offline",p),n=!0),r){var s=r.body||r;Wt(s.ononline)||(s.ononline=d,s.onoffline=p,n=!0)}if(n){var v=Rr();v&&!De(v.onLine)&&(i=v.onLine)}}catch{n=!1}a.isListening=n,a.isOnline=function(){var B=!0,z=Rr();return n?B=i:z&&!De(z.onLine)&&(B=z.onLine),B},a.isOffline=function(){return!a.isOnline()};function d(){i=!0}function p(){i=!1}})}return t.Offline=new t,t}();var cc=ym.Offline;var Em=8,df=function(){function t(){}return t.prototype.getHashCodeScore=function(e){var r=this.getHashCode(e)/t.INT_MAX_VALUE;return r*100},t.prototype.getHashCode=function(e){if(e==="")return 0;for(;e.length<Em;)e=e.concat(e);for(var r=5381,n=0;n<e.length;++n)r=(r<<5)+r+e.charCodeAt(n),r=r&r;return Math.abs(r)},t.INT_MAX_VALUE=2147483647,t}();var vf=function(){function t(){var e=this,r=new df,n=new ka;e.getSamplingScore=function(i){var a=0;return i.tags&&i.tags[n.userId]?a=r.getHashCodeScore(i.tags[n.userId]):i.ext&&i.ext.user&&i.ext.user.id?a=r.getHashCodeScore(i.ext.user.id):i.tags&&i.tags[n.operationId]?a=r.getHashCodeScore(i.tags[n.operationId]):i.ext&&i.ext.telemetryTrace&&i.ext.telemetryTrace.traceID?a=r.getHashCodeScore(i.ext.telemetryTrace.traceID):a=Math.random()*100,a}}return t}();var mf=function(){function t(e,r){this.INT_MAX_VALUE=2147483647;var n=r||$n(null);(e>100||e<0)&&(n.throwInternal(Pe.WARNING,we.SampleRateOutOfRange,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this.sampleRate=e,this.samplingScoreGenerator=new vf}return t.prototype.isSampledIn=function(e){var r=this.sampleRate,n=!1;return r==null||r>=100||e.baseType===en.dataType?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)<r,n)},t}();var ei,wm=65e3;function qs(t){try{return t.responseText}catch{}return null}function pf(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},disableXhr:function(){return!1},onunloadDisableFetch:function(){return!1},onunloadDisableBeacon:function(){return!1},instrumentationKey:function(){},namePrefix:function(){},samplingPercentage:function(){return 100},customHeaders:function(){},convertUndefined:function(){},eventsLimitInMem:function(){return 1e4}}}var Rm=(ei={},ei[Jr.dataType]=lc,ei[Pn.dataType]=uf,ei[Dr.dataType]=lf,ei[Bn.dataType]=cf,ei[xr.dataType]=of,ei[en.dataType]=sf,ei[tn.dataType]=af,ei),uc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=Io;var n,i,a,s=!1,v,d,p,B={},z=0,ee,te;return r._senderConfig=pf(),gt(e,r,function(D,ce){function P(){wr("Method not implemented.")}D.pause=function(){gr(),s=!0},D.resume=function(){s&&(s=!1,i=null,D._buffer.size()>D._senderConfig.maxBatchSizeInBytes()&&D.triggerSend(!0,null,10),hr())},D.flush=function(){if(!s){gr();try{D.triggerSend(!0,null,1)}catch(le){D.diagLog().throwInternal(Pe.CRITICAL,we.FlushFailed,"flush failed, telemetry will not be collected: "+_t(le),{exception:it(le)})}}},D.onunloadFlush=function(){if(!s)if((D._senderConfig.onunloadDisableBeacon()===!1||D._senderConfig.isBeaconApiDisabled()===!1)&&Oi())try{D.triggerSend(!0,Ge,2)}catch(le){D.diagLog().throwInternal(Pe.CRITICAL,we.FailedToSendQueuedTelemetry,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+_t(le),{exception:it(le)})}else D.flush()},D.teardown=P,D.addHeader=function(le,Le){B[le]=Le},D.initialize=function(le,Le,$e,ae){ce.initialize(le,Le,$e,ae);var be=D._getTelCtx(),Ie=D.identifier;d=new ff(Le.logger),n=0,i=null,a=0,D._sender=null,p=0;var Ce=D.diagLog(),Be=pf();Tt(Be,function(ot,mt){D._senderConfig[ot]=function(){return be.getConfig(Ie,ot,mt())}}),D._buffer=D._senderConfig.enableSessionStorageBuffer()&&ji()?new rf(Ce,D._senderConfig):new tf(Ce,D._senderConfig),D._sample=new mf(D._senderConfig.samplingPercentage(),Ce),T(le)||Ce.throwInternal(Pe.CRITICAL,we.InvalidInstrumentationKey,"Invalid Instrumentation key "+le.instrumentationKey),!Gi(D._senderConfig.endpointUrl())&&D._senderConfig.customHeaders()&&D._senderConfig.customHeaders().length>0&&tt(D._senderConfig.customHeaders(),function(ot){r.addHeader(ot.header,ot.value)});var Ye=D._senderConfig,Fe=null;!Ye.disableXhr()&&xs()?Fe=kt:!Ye.disableXhr()&&Li()&&(Fe=st),!Fe&&bs()&&(Fe=Xt),ee=Fe||st,!Ye.isBeaconApiDisabled()&&Oi()&&(Fe=ft),D._sender=Fe||st,!Ye.onunloadDisableFetch()&&bs(!0)?te=yt:Oi()?te=ft:!Ye.disableXhr()&&xs()?te=kt:!Ye.disableXhr()&&Li()?te=st:te=ee},D.processTelemetry=function(le,Le){Le=D._getTelCtx(Le);try{if(D._senderConfig.disableTelemetry())return;if(!le){Le.diagLog().throwInternal(Pe.CRITICAL,we.CannotSendEmptyTelemetry,"Cannot send empty telemetry");return}if(le.baseData&&!le.baseType){Le.diagLog().throwInternal(Pe.CRITICAL,we.InvalidEvent,"Cannot send telemetry without baseData and baseType");return}if(le.baseType||(le.baseType="EventData"),!D._sender){Le.diagLog().throwInternal(Pe.CRITICAL,we.SenderNotInitialized,"Sender was not initialized");return}if(oe(le))le[Ta]=D._sample.sampleRate;else{Le.diagLog().throwInternal(Pe.WARNING,we.TelemetrySampledAndNotSent,"Telemetry item was sampled out and not sent",{SampleRate:D._sample.sampleRate});return}var $e=D._senderConfig.convertUndefined()||void 0,ae=le.iKey||D._senderConfig.instrumentationKey(),be=e.constructEnvelope(le,ae,Le.diagLog(),$e);if(!be){Le.diagLog().throwInternal(Pe.CRITICAL,we.CreateEnvelopeError,"Unable to create an AppInsights envelope");return}var Ie=!1;if(le.tags&&le.tags[Aa]&&(tt(le.tags[Aa],function(Fe){try{Fe&&Fe(be)===!1&&(Ie=!0,Le.diagLog().warnToConsole("Telemetry processor check returns false"))}catch(ot){Le.diagLog().throwInternal(Pe.CRITICAL,we.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+_t(ot),{exception:it(ot)},!0)}}),delete le.tags[Aa]),Ie)return;var Ce=d.serialize(be),Be=D._buffer,Ye=Be.size();Ye+Ce.length>D._senderConfig.maxBatchSizeInBytes()&&D.triggerSend(!0,null,10),Be.enqueue(Ce),hr()}catch(Fe){Le.diagLog().throwInternal(Pe.WARNING,we.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+_t(Fe),{exception:it(Fe)})}D.processNext(le,Le)},D._xhrReadyStateChange=function(le,Le,$e){le.readyState===4&&se(le.status,Le,le.responseURL,$e,St(le),qs(le)||le.response)},D.triggerSend=function(le,Le,$e){if(le===void 0&&(le=!0),!s)try{var ae=D._buffer;if(D._senderConfig.disableTelemetry())ae.clear();else{if(ae.count()>0){var be=ae.getItems();Qe($e||0,le),Le?Le.call(r,be,le):D._sender(be,le)}a=+new Date}gr()}catch(Ce){var Ie=xa();(!Ie||Ie>9)&&D.diagLog().throwInternal(Pe.CRITICAL,we.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+_t(Ce),{exception:it(Ce)})}},D._onError=function(le,Le,$e){D.diagLog().throwInternal(Pe.WARNING,we.OnError,"Failed to send telemetry.",{message:Le}),D._buffer.clearSent(le)},D._onPartialSuccess=function(le,Le){for(var $e=[],ae=[],be=Le.errors.reverse(),Ie=0,Ce=be;Ie<Ce.length;Ie++){var Be=Ce[Ie],Ye=le.splice(Be.index,1)[0];$t(Be.statusCode)?ae.push(Ye):$e.push(Ye)}le.length>0&&D._onSuccess(le,Le.itemsAccepted),$e.length>0&&D._onError($e,St(null,["partial success",Le.itemsAccepted,"of",Le.itemsReceived].join(" "))),ae.length>0&&(an(ae),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,"Partial success. Delivered: "+le.length+", Failed: "+$e.length+". Will retry to send "+ae.length+" our of "+Le.itemsReceived+" items"))},D._onSuccess=function(le,Le){D._buffer.clearSent(le)},D._xdrOnLoad=function(le,Le){var $e=qs(le);if(le&&($e+""=="200"||$e===""))n=0,D._onSuccess(Le,0);else{var ae=sr($e);ae&&ae.itemsReceived&&ae.itemsReceived>ae.itemsAccepted&&!D._senderConfig.isRetryDisabled()?D._onPartialSuccess(Le,ae):D._onError(Le,Nt(le))}};function oe(le){return D._sample.isSampledIn(le)}function se(le,Le,$e,ae,be,Ie){var Ce=null;if(D._appId||(Ce=sr(Ie),Ce&&Ce.appId&&(D._appId=Ce.appId)),(le<200||le>=300)&&le!==0){if((le===301||le===307||le===308)&&!xe($e)){D._onError(Le,be);return}!D._senderConfig.isRetryDisabled()&&$t(le)?(an(Le),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Response code "+le+". Will retry to send "+Le.length+" items.")):D._onError(Le,be)}else if(cc.isOffline()){if(!D._senderConfig.isRetryDisabled()){var Be=10;an(Le,Be),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Offline - Response Code: ".concat(le,". Offline status: ").concat(cc.isOffline(),". Will retry to send ").concat(Le.length," items."))}}else xe($e),le===206?(Ce||(Ce=sr(Ie)),Ce&&!D._senderConfig.isRetryDisabled()?D._onPartialSuccess(Le,Ce):D._onError(Le,be)):(n=0,D._onSuccess(Le,ae))}function xe(le){return p>=10?!1:!De(le)&&le!==""&&le!==D._senderConfig.endpointUrl()?(D._senderConfig.endpointUrl=function(){return le},++p,!0):!1}function Ge(le,Le){te?te(le,!1):ft(le,Le)}function lt(le){var Le=Rr(),$e=D._buffer,ae=D._senderConfig.endpointUrl(),be=D._buffer.batchPayloads(le),Ie=new Blob([be],{type:"text/plain;charset=UTF-8"}),Ce=Le.sendBeacon(ae,Ie);return Ce&&($e.markAsSent(le),D._onSuccess(le,le.length)),Ce}function ft(le,Le){if(ur(le)&&le.length>0&&!lt(le)){for(var $e=[],ae=0;ae<le.length;ae++){var be=le[ae];lt([be])||$e.push(be)}$e.length>0&&(ee($e,!0),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with normal sender."))}}function st(le,Le){var $e=new XMLHttpRequest,ae=D._senderConfig.endpointUrl();try{$e[Mn]=!0}catch{}$e.open("POST",ae,Le),$e.setRequestHeader("Content-type","application/json"),Gi(ae)&&$e.setRequestHeader(Ct.sdkContextHeader,Ct.sdkContextHeaderAppIdRequest),tt(un(B),function(Ie){$e.setRequestHeader(Ie,B[Ie])}),$e.onreadystatechange=function(){return D._xhrReadyStateChange($e,le,le.length)},$e.onerror=function(Ie){return D._onError(le,St($e),Ie)};var be=D._buffer.batchPayloads(le);$e.send(be),D._buffer.markAsSent(le)}function yt(le,Le){if(ur(le)){for(var $e=le.length,ae=0;ae<le.length;ae++)$e+=le[ae].length;z+$e<=wm?tr(le,!1):Oi()?ft(le,Le):(ee&&ee(le,!0),D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with xhrSender."))}}function Xt(le,Le){tr(le,!0)}function tr(le,Le){var $e,ae=D._senderConfig.endpointUrl(),be=D._buffer.batchPayloads(le),Ie=new Blob([be],{type:"application/json"}),Ce=new Headers,Be=be.length,Ye=!1,Fe=!1;Gi(ae)&&Ce.append(Ct.sdkContextHeader,Ct.sdkContextHeaderAppIdRequest),tt(un(B),function(Ee){Ce.append(Ee,B[Ee])});var ot=($e={method:"POST",headers:Ce,body:Ie},$e[Mn]=!0,$e);Le||(ot.keepalive=!0,Ye=!0,z+=Be);var mt=new Request(ae,ot);try{mt[Mn]=!0}catch{}D._buffer.markAsSent(le);try{fetch(mt).then(function(Ee){Le||(z-=Be,Be=0),Fe||(Fe=!0,Ee.ok?Ee.text().then(function(br){se(Ee.status,le,Ee.url,le.length,Ee.statusText,br)}):D._onError(le,Ee.statusText))}).catch(function(Ee){Le||(z-=Be,Be=0),Fe||(Fe=!0,D._onError(le,Ee.message))})}catch(Ee){Fe||D._onError(le,it(Ee))}Ye&&!Fe&&(Fe=!0,D._onSuccess(le,le.length))}function sr(le){try{if(le&&le!==""){var Le=vr().parse(le);if(Le&&Le.itemsReceived&&Le.itemsReceived>=Le.itemsAccepted&&Le.itemsReceived-Le.itemsAccepted===Le.errors.length)return Le}}catch($e){D.diagLog().throwInternal(Pe.CRITICAL,we.InvalidBackendResponse,"Cannot parse the response. "+_t($e),{response:le})}return null}function an(le,Le){if(Le===void 0&&(Le=1),!(!le||le.length===0)){var $e=D._buffer;$e.clearSent(le),n++;for(var ae=0,be=le;ae<be.length;ae++){var Ie=be[ae];$e.enqueue(Ie)}Tr(Le),hr()}}function Tr(le){var Le=10,$e;if(n<=1)$e=Le;else{var ae=(Math.pow(2,n)-1)/2,be=Math.floor(Math.random()*ae*Le)+1;be=le*be,$e=Math.max(Math.min(be,3600),Le)}var Ie=fr()+$e*1e3;i=Ie}function hr(){if(!v&&!s){var le=i?Math.max(0,i-fr()):0,Le=Math.max(D._senderConfig.maxBatchInterval(),le);v=setTimeout(function(){v=null,D.triggerSend(!0,null,1)},Le)}}function gr(){clearTimeout(v),v=null,i=null}function $t(le){return le===408||le===429||le===500||le===503}function St(le,Le){return le?"XMLHttpRequest,Status:"+le.status+",Response:"+qs(le)||le.response||"":Le}function kt(le,Le){var $e=D._buffer,ae=Hn(),be=new XDomainRequest;be.onload=function(){return D._xdrOnLoad(be,le)},be.onerror=function(Ye){return D._onError(le,Nt(be),Ye)};var Ie=ae&&ae.location&&ae.location.protocol||"";if(D._senderConfig.endpointUrl().lastIndexOf(Ie,0)!==0){D.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),$e.clear();return}var Ce=D._senderConfig.endpointUrl().replace(/^(https?:)/,"");be.open("POST",Ce);var Be=$e.batchPayloads(le);be.send(Be),$e.markAsSent(le)}function Nt(le,Le){return le?"XDomainRequest,Response:"+qs(le)||"":Le}function It(){var le="getNotifyMgr";return D.core[le]?D.core[le]():D.core._notificationManager}function Qe(le,Le){var $e=It();if($e&&$e.eventsSendRequest)try{$e.eventsSendRequest(le,Le)}catch(ae){D.diagLog().throwInternal(Pe.CRITICAL,we.NotificationException,"send request notification failed: "+_t(ae),{exception:it(ae)})}}function T(le){var Le=De(le.disableInstrumentationKeyValidation)?!1:le.disableInstrumentationKeyValidation;if(Le)return!0;var $e="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",ae=new RegExp($e);return ae.test(le.instrumentationKey)}}),r}return e.constructEnvelope=function(r,n,i,a){var s;n!==r.iKey&&!De(n)?s=Qt(Qt({},r),{iKey:n}):s=r;var v=Rm[s.baseType]||lc;return v(i,s,a)},e}(In);var Tm="ai_session",fc=function(){function t(){}return t}();var hf=function(){function t(e,r){var n=this,i,a,s=$n(r),v=Ui(r);gt(t,n,function(d){e||(e={}),at(e.sessionExpirationMs)||(e.sessionExpirationMs=function(){return t.acquisitionSpan}),at(e.sessionRenewalMs)||(e.sessionRenewalMs=function(){return t.renewalSpan}),d.config=e;var p=d.config.sessionCookiePostfix&&d.config.sessionCookiePostfix()?d.config.sessionCookiePostfix():d.config.namePrefix&&d.config.namePrefix()?d.config.namePrefix():"";i=function(){return Tm+p},d.automaticSession=new fc,d.update=function(){var ce=fr(),P=!1,oe=d.automaticSession;oe.id||(P=!B(oe,ce));var se=d.config.sessionExpirationMs();if(!P&&se>0){var xe=d.config.sessionRenewalMs(),Ge=ce-oe.acquisitionDate,lt=ce-oe.renewalDate;P=Ge<0||lt<0,P=P||Ge>se,P=P||lt>xe}P?ee(ce):(!a||ce-a>t.cookieUpdateInterval)&&te(oe,ce)},d.backup=function(){var ce=d.automaticSession;D(ce.id,ce.acquisitionDate,ce.renewalDate)};function B(ce,P){var oe=!1,se=v.get(i());if(se&&at(se.split))oe=z(ce,se);else{var xe=jl(s,i());xe&&(oe=z(ce,xe))}return oe||!!ce.id}function z(ce,P){var oe=!1,se=", session will be reset",xe=P.split("|");if(xe.length>=2)try{var Ge=+xe[1]||0,lt=+xe[2]||0;isNaN(Ge)||Ge<=0?s.throwInternal(Pe.WARNING,we.SessionRenewalDateIsZero,"AI session acquisition date is 0"+se):isNaN(lt)||lt<=0?s.throwInternal(Pe.WARNING,we.SessionRenewalDateIsZero,"AI session renewal date is 0"+se):xe[0]&&(ce.id=xe[0],ce.acquisitionDate=Ge,ce.renewalDate=lt,oe=!0)}catch(ft){s.throwInternal(Pe.CRITICAL,we.ErrorParsingAISessionCookie,"Error parsing ai_session value ["+(P||"")+"]"+se+" - "+_t(ft),{exception:it(ft)})}return oe}function ee(ce){var P=d.config||{},oe=(P.getNewId?P.getNewId():null)||Ra;d.automaticSession.id=oe(P.idLength?P.idLength():22),d.automaticSession.acquisitionDate=ce,te(d.automaticSession,ce),Ns()||s.throwInternal(Pe.WARNING,we.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")}function te(ce,P){var oe=ce.acquisitionDate;ce.renewalDate=P;var se=d.config,xe=se.sessionRenewalMs(),Ge=oe+se.sessionExpirationMs()-P,lt=[ce.id,oe,P],ft=0;Ge<xe?ft=Ge/1e3:ft=xe/1e3;var st=se.cookieDomain?se.cookieDomain():null;v.set(i(),lt.join("|"),se.sessionExpirationMs()>0?ft:null,st),a=P}function D(ce,P,oe){Gl(s,i(),[ce,P,oe].join("|"))}})}return t.acquisitionSpan=864e5,t.renewalSpan=18e5,t.cookieUpdateInterval=6e4,t}();var _f=function(){function t(){}return t}();var Sf=function(){function t(){this.id="browser",this.deviceClass="Browser"}return t}();var Am="2.7.4",gf=function(){function t(e){this.sdkVersion=(e.sdkExtension&&e.sdkExtension()?e.sdkExtension()+"_":"")+"javascript:"+Am}return t}();function bf(t){return!(typeof t!="string"||!t||t.match(/,|;|=| |\|/))}var xf=function(){function t(e,r){this.isNewUser=!1,this.isUserCookieSet=!1;var n=$n(r),i=Ui(r),a;gt(t,this,function(s){s.config=e;var v=s.config.userCookiePostfix&&s.config.userCookiePostfix()?s.config.userCookiePostfix():"";a=function(){return t.userCookieName+v};var d=i.get(a());if(d){s.isNewUser=!1;var p=d.split(t.cookieSeparator);p.length>0&&(s.id=p[0],s.isUserCookieSet=!!s.id)}function B(){var oe=e||{},se=(oe.getNewId?oe.getNewId():null)||Ra,xe=se(oe.idLength?e.idLength():22);return xe}function z(oe){var se=Pr(new Date);s.accountAcquisitionDate=se,s.isNewUser=!0;var xe=[oe,se];return xe}function ee(oe){var se=31536e3;s.isUserCookieSet=i.set(a(),oe,se)}if(!s.id){s.id=B();var te=z(s.id);ee(te.join(t.cookieSeparator));var D=e.namePrefix&&e.namePrefix()?e.namePrefix()+"ai_session":"ai_session";Xl(n,D)}s.accountId=e.accountId?e.accountId():void 0;var ce=i.get(t.authUserCookieName);if(ce){ce=decodeURI(ce);var P=ce.split(t.cookieSeparator);P[0]&&(s.authenticatedId=P[0]),P.length>1&&P[1]&&(s.accountId=P[1])}s.setAuthenticatedUserContext=function(oe,se,xe){xe===void 0&&(xe=!1);var Ge=!bf(oe)||se&&!bf(se);if(Ge){n.throwInternal(Pe.WARNING,we.SetAuthContextFailedAccountName,"Setting auth user context failed. User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",!0);return}s.authenticatedId=oe;var lt=s.authenticatedId;se&&(s.accountId=se,lt=[s.authenticatedId,s.accountId].join(t.cookieSeparator)),xe&&i.set(t.authUserCookieName,encodeURI(lt))},s.clearAuthenticatedUserContext=function(){s.authenticatedId=null,s.accountId=null,i.del(t.authUserCookieName)},s.update=function(oe){if(s.id!==oe||!s.isUserCookieSet){var se=oe||B(),xe=z(se);ee(xe.join(t.cookieSeparator))}}})}return t.cookieSeparator="|",t.userCookieName="ai_user",t.authUserCookieName="ai_authUser",t}();var yf=function(){function t(){}return t}();var Ef=function(){function t(e,r,n,i){var a=this;a.traceID=e||zr(),a.parentID=r,a.name=n;var s=$r();!n&&s&&s.pathname&&(a.name=s.pathname),a.name=Mt(i,a.name)}return t}();var zs="ext",js="tags";function Oa(t,e){t&&t[e]&&un(t[e]).length===0&&delete t[e]}var wf=function(){function t(e,r){var n=this,i=e.logger;this.appId=function(){return null},this.getSessionId=function(){return null},gt(t,this,function(a){a.application=new _f,a.internal=new gf(r),Di()&&(a.sessionManager=new hf(r,e),a.device=new Sf,a.location=new yf,a.user=new xf(r,e),a.telemetryTrace=new Ef(void 0,void 0,void 0,i),a.session=new fc),a.getSessionId=function(){var s=a.session,v=null;if(s&&et(s.id))v=s.id;else{var d=(a.sessionManager||{}).automaticSession;v=d&&et(d.id)?d.id:null}return v},a.applySessionContext=function(s,v){ht(dr(s.ext,kr.AppExt),"sesId",a.getSessionId(),et)},a.applyOperatingSystemContxt=function(s,v){ht(s.ext,kr.OSExt,a.os)},a.applyApplicationContext=function(s,v){var d=a.application;if(d){var p=dr(s,js);ht(p,Pt.applicationVersion,d.ver,et),ht(p,Pt.applicationBuild,d.build,et)}},a.applyDeviceContext=function(s,v){var d=a.device;if(d){var p=dr(dr(s,zs),kr.DeviceExt);ht(p,"localId",d.id,et),ht(p,"ip",d.ip,et),ht(p,"model",d.model,et),ht(p,"deviceClass",d.deviceClass,et)}},a.applyInternalContext=function(s,v){var d=a.internal;if(d){var p=dr(s,js);ht(p,Pt.internalAgentVersion,d.agentVersion,et),ht(p,Pt.internalSdkVersion,d.sdkVersion,et),(s.baseType===Yn.dataType||s.baseType===Dr.dataType)&&(ht(p,Pt.internalSnippet,d.snippetVer,et),ht(p,Pt.internalSdkSrc,d.sdkSrc,et))}},a.applyLocationContext=function(s,v){var d=n.location;d&&ht(dr(s,js,[]),Pt.locationIp,d.ip,et)},a.applyOperationContext=function(s,v){var d=a.telemetryTrace;if(d){var p=dr(dr(s,zs),kr.TraceExt,{traceID:void 0,parentID:void 0});ht(p,"traceID",d.traceID,et),ht(p,"name",d.name,et),ht(p,"parentID",d.parentID,et)}},a.applyWebContext=function(s,v){var d=n.web;d&&ht(dr(s,zs),kr.WebExt,d)},a.applyUserContext=function(s,v){var d=a.user;if(d){var p=dr(s,js,[]);ht(p,Pt.userAccountId,d.accountId,et);var B=dr(dr(s,zs),kr.UserExt);ht(B,"id",d.id,et),ht(B,"authId",d.authenticatedId,et)}},a.cleanUp=function(s,v){var d=s.ext;d&&(Oa(d,kr.DeviceExt),Oa(d,kr.UserExt),Oa(d,kr.WebExt),Oa(d,kr.OSExt),Oa(d,kr.AppExt),Oa(d,kr.TraceExt))}})}return t}();var Im=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.priority=110,r.identifier=_i;var n,i;return gt(e,r,function(a,s){a.initialize=function(d,p,B,z){s.initialize(d,p,B,z);var ee=a._getTelCtx(),te=a.identifier,D=e.getDefaultConfig();i=i||{},Tt(D,function(ce,P){i[ce]=function(){return ee.getConfig(te,ce,P())}}),a.context=new wf(p,i),n=Ul(B,Io),a.context.appId=function(){return n?n._appId:null},a._extConfig=i},a.processTelemetry=function(d,p){if(!De(d)){p=a._getTelCtx(p),d.name===Dr.envelopeType&&p.diagLog().resetInternalMessageCount();var B=a.context||{};B.session&&typeof a.context.session.id!="string"&&B.sessionManager&&B.sessionManager.update();var z=B.user;if(z&&!z.isUserCookieSet&&z.update(B.user.id),v(d,p),z&&z.isNewUser){z.isNewUser=!1;var ee=new Yn(we.SendBrowserInfoOnUserInit,(Rr()||{}).userAgent||"");p.diagLog().logInternalMessage(Pe.CRITICAL,ee)}a.processNext(d,p)}};function v(d,p){dr(d,"tags",[]),dr(d,"ext",{});var B=a.context;B.applySessionContext(d,p),B.applyApplicationContext(d,p),B.applyDeviceContext(d,p),B.applyOperationContext(d,p),B.applyUserContext(d,p),B.applyOperatingSystemContxt(d,p),B.applyWebContext(d,p),B.applyLocationContext(d,p),B.applyInternalContext(d,p),B.cleanUp(d,p)}}),r}return e.getDefaultConfig=function(){var r={instrumentationKey:function(){},accountId:function(){return null},sessionRenewalMs:function(){return 18e5},samplingPercentage:function(){return 100},sessionExpirationMs:function(){return 864e5},cookieDomain:function(){return null},sdkExtension:function(){return null},isBrowserLinkTrackingEnabled:function(){return!1},appId:function(){return null},getSessionId:function(){return null},namePrefix:function(){},sessionCookiePostfix:function(){},userCookiePostfix:function(){},idLength:function(){return 22},getNewId:function(){return null}};return r},e}(In),dc=Im;var rn="properties";function Rf(t,e,r){var n=0,i=t[e],a=t[r];return i&&a&&(n=mr(i,a)),n}function $i(t,e,r,n,i){var a=0,s=Rf(r,n,i);return s&&(a=gi(t,e,Qr(s))),a}function gi(t,e,r){var n="ajaxPerf",i=0;if(t&&e&&r){var a=t[n]=t[n]||{};a[e]=r,i=1}return i}function Cm(t,e){var r=t.perfTiming,n=e[rn]||{},i=0,a="name",s="Start",v="End",d="domainLookup",p="connect",B="redirect",z="request",ee="response",te="duration",D="startTime",ce=d+s,P=d+v,oe=p+s,se=p+v,xe=z+s,Ge=z+v,lt=ee+s,ft=ee+v,st=B+s,yt=B=v,Xt="transferSize",tr="encodedBodySize",sr="decodedBodySize",an="serverTiming";if(r){i|=$i(n,B,r,st,yt),i|=$i(n,d,r,ce,P),i|=$i(n,p,r,oe,se),i|=$i(n,z,r,xe,Ge),i|=$i(n,ee,r,lt,ft),i|=$i(n,"networkConnect",r,D,se),i|=$i(n,"sentRequest",r,xe,ft);var Tr=r[te];Tr||(Tr=Rf(r,D,ft)||0),i|=gi(n,te,Tr),i|=gi(n,"perfTotal",Tr);var hr=r[an];if(hr){var gr={};tt(hr,function($t,St){var kt=J0($t[a]||""+St),Nt=gr[kt]||{};Tt($t,function(It,Qe){(It!==a&&et(Qe)||Sa(Qe))&&(Nt[It]&&(Qe=Nt[It]+";"+Qe),(Qe||!et(Qe))&&(Nt[It]=Qe))}),gr[kt]=Nt}),i|=gi(n,an,gr)}i|=gi(n,Xt,r[Xt]),i|=gi(n,tr,r[tr]),i|=gi(n,sr,r[sr])}else t.perfMark&&(i|=gi(n,"missing",t.perfAttempts));i&&(e[rn]=n)}var Mm=function(){function t(){var e=this;e.openDone=!1,e.setRequestHeaderDone=!1,e.sendDone=!1,e.abortDone=!1,e.stateChangeAttached=!1}return t}();var vc=function(){function t(e,r,n){var i=this,a=n,s="responseText";i.perfMark=null,i.completed=!1,i.requestHeadersSize=null,i.requestHeaders=null,i.responseReceivingDuration=null,i.callbackDuration=null,i.ajaxTotalDuration=null,i.aborted=0,i.pageUrl=null,i.requestUrl=null,i.requestSize=0,i.method=null,i.status=null,i.requestSentTime=null,i.responseStartedTime=null,i.responseFinishedTime=null,i.callbackFinishedTime=null,i.endTime=null,i.xhrMonitoringState=new Mm,i.clientFailure=0,i.traceID=e,i.spanID=r,gt(t,i,function(v){v.getAbsoluteUrl=function(){return v.requestUrl?Ds(v.requestUrl):null},v.getPathName=function(){return v.requestUrl?Qn(a,ks(v.method,v.requestUrl)):null},v.CreateTrackItem=function(d,p,B){var z;if(v.ajaxTotalDuration=Math.round(mr(v.requestSentTime,v.responseFinishedTime)*1e3)/1e3,v.ajaxTotalDuration<0)return null;var ee=(z={id:"|"+v.traceID+"."+v.spanID,target:v.getAbsoluteUrl(),name:v.getPathName(),type:d,startTime:null,duration:v.ajaxTotalDuration,success:+v.status>=200&&+v.status<400,responseCode:+v.status,method:v.method},z[rn]={HttpMethod:v.method},z);if(v.requestSentTime&&(ee.startTime=new Date,ee.startTime.setTime(v.requestSentTime)),Cm(v,ee),p&&un(v.requestHeaders).length>0&&(ee[rn]=ee[rn]||{},ee[rn].requestHeaders=v.requestHeaders),B){var te=B();if(te){var D=te.correlationContext;if(D&&(ee.correlationContext=D),te.headerMap&&un(te.headerMap).length>0&&(ee[rn]=ee[rn]||{},ee[rn].responseHeaders=te.headerMap),v.errorStatusText&&v.status>=400){var ce=te.type;ee[rn]=ee[rn]||{},(ce===""||ce==="text")&&(ee[rn][s]=te[s]?te.statusText+" - "+te[s]:te.statusText),ce==="json"&&(ee[rn][s]=te.response?te.statusText+" - "+JSON.stringify(te.response):te.statusText)}}}return ee}})}return t}();var mc=function(){function t(e,r){var n=this;n.traceFlag=t.DEFAULT_TRACE_FLAG,n.version=t.DEFAULT_VERSION,e&&t.isValidTraceId(e)?n.traceId=e:n.traceId=zr(),r&&t.isValidSpanId(r)?n.spanId=r:n.spanId=zr().substr(0,16)}return t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.prototype.toString=function(){var e=this;return"".concat(e.version,"-").concat(e.traceId,"-").concat(e.spanId,"-").concat(e.traceFlag)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t}();var Tf="ai.ajxmn.",Po="diagLog",nn="ajaxData",If="throwInternal",Bo="fetch",Af=0;function Pm(){var t=cn();return!t||De(t.Request)||De(t.Request[Gt])||De(t[Bo])?null:t[Bo]}function Bm(t){var e=!1;if(Li()){var r=XMLHttpRequest[Gt];e=!De(r)&&!De(r.open)&&!De(r.send)&&!De(r.abort)}var n=xa();if(n&&n<9&&(e=!1),e)try{var i=new XMLHttpRequest;i[nn]={};var a=XMLHttpRequest[Gt].open;XMLHttpRequest[Gt].open=a}catch(s){e=!1,No(t,we.FailedMonitorAjaxOpen,"Failed to enable XMLHttpRequest monitoring, extension is not supported",{exception:it(s)})}return e}function Gs(t){var e="";try{!De(t)&&!De(t[nn])&&!De(t[nn].requestUrl)&&(e+="(url: '"+t[nn].requestUrl+"')")}catch{}return e}function No(t,e,r,n,i){t[Po]()[If](Pe.CRITICAL,e,r,n,i)}function La(t,e,r,n,i){t[Po]()[If](Pe.WARNING,e,r,n,i)}function Mo(t,e,r){return function(n){No(t,e,r,{ajaxDiagnosticsMessage:Gs(n.inst),exception:it(n.err)})}}function Fa(t,e){return t&&e?t.indexOf(e):-1}var pc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier=e.identifier,r.priority=120;var n="trackDependencyDataInternal",i=$r(),a=!1,s=!1,v=i&&i.host&&i.host.toLowerCase(),d=e.getEmptyConfig(),p=!1,B=!1,z=0,ee,te,D,ce,P=!1,oe=0,se=!1,xe=[],Ge={},lt,ft;return gt(e,r,function(st,yt){st.initialize=function(ae,be,Ie,Ce){if(!st.isInitialized()){yt.initialize(ae,be,Ie,Ce);var Be=st._getTelCtx(),Ye=e.getDefaultConfig();Tt(Ye,function(br,Ar){d[br]=Be.getConfig(e.identifier,br,Ar)});var Fe=d.distributedTracingMode;if(p=d.enableRequestHeaderTracking,B=d.enableAjaxErrorStatusText,P=d.enableAjaxPerfTracking,oe=d.maxAjaxCallsPerView,se=d.enableResponseHeaderTracking,lt=d.excludeRequestFromAutoTrackingPatterns,ft=d.addRequestContext,D=Fe===dn.AI||Fe===dn.AI_AND_W3C,te=Fe===dn.AI_AND_W3C||Fe===dn.W3C,P){var ot=ae.instrumentationKey||"unkwn";ot.length>5?ce=Tf+ot.substring(ot.length-5)+".":ce=Tf+ot+"."}if(d.disableAjaxTracking===!1&&an(),tr(),Ie.length>0&&Ie){for(var mt=void 0,Ee=0;!mt&&Ee<Ie.length;)Ie[Ee]&&Ie[Ee].identifier===_i&&(mt=Ie[Ee]),Ee++;mt&&(ee=mt.context)}}},st.teardown=function(){tt(xe,function(ae){ae.rm()}),xe=[],a=!1,s=!1,st.setInitialized(!1)},st.trackDependencyData=function(ae,be){st[n](ae,be)},st.includeCorrelationHeaders=function(ae,be,Ie,Ce){var Be=st._currentWindowHost||v;if(be){if(Jn.canIncludeCorrelationHeader(d,ae.getAbsoluteUrl(),Be)){if(Ie||(Ie={}),Ie.headers=new Headers(Ie.headers||(be instanceof Request?be.headers||{}:{})),D){var Ye="|"+ae.traceID+"."+ae.spanID;Ie.headers.set(Ct.requestIdHeader,Ye),p&&(ae.requestHeaders[Ct.requestIdHeader]=Ye)}var Fe=d.appId||ee&&ee.appId();if(Fe&&(Ie.headers.set(Ct.requestContextHeader,Ct.requestContextAppIdFormat+Fe),p&&(ae.requestHeaders[Ct.requestContextHeader]=Ct.requestContextAppIdFormat+Fe)),te){var ot=new mc(ae.traceID,ae.spanID);Ie.headers.set(Ct.traceParentHeader,ot.toString()),p&&(ae.requestHeaders[Ct.traceParentHeader]=ot.toString())}}return Ie}else if(Ce){if(Jn.canIncludeCorrelationHeader(d,ae.getAbsoluteUrl(),Be)){if(D){var Ye="|"+ae.traceID+"."+ae.spanID;Ce.setRequestHeader(Ct.requestIdHeader,Ye),p&&(ae.requestHeaders[Ct.requestIdHeader]=Ye)}var Fe=d.appId||ee&&ee.appId();if(Fe&&(Ce.setRequestHeader(Ct.requestContextHeader,Ct.requestContextAppIdFormat+Fe),p&&(ae.requestHeaders[Ct.requestContextHeader]=Ct.requestContextAppIdFormat+Fe)),te){var ot=new mc(ae.traceID,ae.spanID);Ce.setRequestHeader(Ct.traceParentHeader,ot.toString()),p&&(ae.requestHeaders[Ct.traceParentHeader]=ot.toString())}}return Ce}},st[n]=function(ae,be,Ie){if(oe===-1||z<oe){(d.distributedTracingMode===dn.W3C||d.distributedTracingMode===dn.AI_AND_W3C)&&typeof ae.id=="string"&&ae.id[ae.id.length-1]!=="."&&(ae.id+="."),De(ae.startTime)&&(ae.startTime=new Date);var Ce=mn.create(ae,tn.dataType,tn.envelopeType,st[Po](),be,Ie);st.core.track(Ce)}else z===oe&&No(st,we.MaxAjaxPerPVExceeded,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++z};function Xt(ae){var be=!0;return(ae||d.ignoreHeaders)&&tt(d.ignoreHeaders,function(Ie){if(Ie.toLowerCase()===ae.toLowerCase())return be=!1,-1}),be}function tr(){var ae=Pm();if(!!ae){var be=cn(),Ie=ae.polyfill;d.disableFetchTracking===!1?(xe.push(xo(be,Bo,{req:function(Ce,Be,Ye){var Fe;if(a&&!Tr(null,Be,Ye)&&!(Ie&&s)){var ot=Ce.ctx();Fe=T(Be,Ye);var mt=st.includeCorrelationHeaders(Fe,Be,Ye);mt!==Ye&&Ce.set(1,mt),ot.data=Fe}},rsp:function(Ce,Be){var Ye=Ce.ctx().data;Ye&&(Ce.rslt=Ce.rslt.then(function(Fe){return Le(Ce,(Fe||{}).status,Be,Fe,Ye,function(){var ot={statusText:Fe.statusText,headerMap:null,correlationContext:$e(Fe)};if(se){var mt={};Fe.headers.forEach(function(Ee,br){Xt(br)&&(mt[br]=Ee)}),ot.headerMap=mt}return ot}),Fe}).catch(function(Fe){throw Le(Ce,0,Be,null,Ye,null,{error:Fe.message}),Fe}))},hkErr:Mo(st,we.FailedMonitorAjaxOpen,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")})),a=!0):Ie&&xe.push(xo(be,Bo,{req:function(Ce,Be,Ye){Tr(null,Be,Ye)}})),Ie&&(be[Bo].polyfill=Ie)}}function sr(ae,be,Ie){xe.push(Dl(ae,be,Ie))}function an(){Bm(st)&&!s&&(sr(XMLHttpRequest,"open",{req:function(ae,be,Ie,Ce){var Be=ae.inst,Ye=Be[nn];!Tr(Be,Ie)&&hr(Be,!0)&&((!Ye||!Ye.xhrMonitoringState.openDone)&&gr(Be,be,Ie,Ce),$t(Be))},hkErr:Mo(st,we.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")}),sr(XMLHttpRequest,"send",{req:function(ae,be){var Ie=ae.inst,Ce=Ie[nn];hr(Ie)&&!Ce.xhrMonitoringState.sendDone&&(It("xhr",Ce),Ce.requestSentTime=Ma(),st.includeCorrelationHeaders(Ce,void 0,void 0,Ie),Ce.xhrMonitoringState.sendDone=!0)},hkErr:Mo(st,we.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")}),sr(XMLHttpRequest,"abort",{req:function(ae){var be=ae.inst,Ie=be[nn];hr(be)&&!Ie.xhrMonitoringState.abortDone&&(Ie.aborted=1,Ie.xhrMonitoringState.abortDone=!0)},hkErr:Mo(st,we.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")}),p&&sr(XMLHttpRequest,"setRequestHeader",{req:function(ae,be,Ie){var Ce=ae.inst;hr(Ce)&&Xt(be)&&(Ce[nn].requestHeaders[be]=Ie)},hkErr:Mo(st,we.FailedMonitorAjaxSetRequestHeader,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")}),s=!0)}function Tr(ae,be,Ie){var Ce=!1,Be=((et(be)?be:(be||{}).url||"")||"").toLowerCase();if(tt(lt,function(ot){var mt=ot;et(ot)&&(mt=new RegExp(ot)),Ce||(Ce=mt.test(Be))}),Ce)return Ce;var Ye=Fa(Be,"?"),Fe=Fa(Be,"#");return(Ye===-1||Fe!==-1&&Fe<Ye)&&(Ye=Fe),Ye!==-1&&(Be=Be.substring(0,Ye)),De(ae)?De(be)||(Ce=(typeof be=="object"?be[Mn]===!0:!1)||(Ie?Ie[Mn]===!0:!1)):Ce=ae[Mn]===!0||Be[Mn]===!0,!Ce&&Be&&Gi(Be)&&(Ce=!0),Ce?Ge[Be]||(Ge[Be]=1):Ge[Be]&&(Ce=!0),Ce}function hr(ae,be){var Ie=!0,Ce=s;return De(ae)||(Ie=be===!0||!De(ae[nn])),Ce&&Ie}function gr(ae,be,Ie,Ce){var Be=ee&&ee.telemetryTrace&&ee.telemetryTrace.traceID||zr(),Ye=zr().substr(0,16),Fe=new vc(Be,Ye,st[Po]());Fe.method=be,Fe.requestUrl=Ie,Fe.xhrMonitoringState.openDone=!0,Fe.requestHeaders={},Fe.async=Ce,Fe.errorStatusText=B,ae[nn]=Fe}function $t(ae){ae[nn].xhrMonitoringState.stateChangeAttached=Tn(ae,"readystatechange",function(){try{ae&&ae.readyState===4&&hr(ae)&&kt(ae)}catch(Ie){var be=it(Ie);(!be||Fa(be.toLowerCase(),"c00c023f")===-1)&&No(st,we.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:Gs(ae),exception:be})}})}function St(ae){try{var be=ae.responseType;if(be===""||be==="text")return ae.responseText}catch{}return null}function kt(ae){var be=ae[nn];be.responseFinishedTime=Ma(),be.status=ae.status;function Ie(Ce,Be){var Ye=Be||{};Ye.ajaxDiagnosticsMessage=Gs(ae),Ce&&(Ye.exception=it(Ce)),La(st,we.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",Ye)}Qe("xmlhttprequest",be,function(){try{var Ce=be.CreateTrackItem("Ajax",p,function(){var Ye={statusText:ae.statusText,headerMap:null,correlationContext:Nt(ae),type:ae.responseType,responseText:St(ae),response:ae.response};if(se){var Fe=ae.getAllResponseHeaders();if(Fe){var ot=Jt(Fe).split(/[\r\n]+/),mt={};tt(ot,function(Ee){var br=Ee.split(": "),Ar=br.shift(),yr=br.join(": ");Xt(Ar)&&(mt[Ar]=yr)}),Ye.headerMap=mt}}return Ye}),Be=void 0;try{ft&&(Be=ft({status:ae.status,xhr:ae}))}catch{La(st,we.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}Ce?(Be!==void 0&&(Ce.properties=Qt(Qt({},Ce.properties),Be)),st[n](Ce)):Ie(null,{requestSentTime:be.requestSentTime,responseFinishedTime:be.responseFinishedTime})}finally{try{ae[nn]=null}catch{}}},function(Ce){Ie(Ce,null)})}function Nt(ae){try{var be=ae.getAllResponseHeaders();if(be!==null){var Ie=Fa(be.toLowerCase(),Ct.requestContextHeaderLowerCase);if(Ie!==-1){var Ce=ae.getResponseHeader(Ct.requestContextHeader);return Jn.getCorrelationContext(Ce)}}}catch(Be){La(st,we.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:Gs(ae),exception:it(Be)})}}function It(ae,be){if(be.requestUrl&&ce&&P){var Ie=Zr();if(Ie&&at(Ie.mark)){Af++;var Ce=ce+ae+"#"+Af;Ie.mark(Ce);var Be=Ie.getEntriesByName(Ce);Be&&Be.length===1&&(be.perfMark=Be[0])}}}function Qe(ae,be,Ie,Ce){var Be=be.perfMark,Ye=Zr(),Fe=d.maxAjaxPerfLookupAttempts,ot=d.ajaxPerfLookupDelay,mt=be.requestUrl,Ee=0;(function br(){try{if(Ye&&Be){Ee++;for(var Ar=null,yr=Ye.getEntries(),ea=yr.length-1;ea>=0;ea--){var pn=yr[ea];if(pn){if(pn.entryType==="resource")pn.initiatorType===ae&&(Fa(pn.name,mt)!==-1||Fa(mt,pn.name)!==-1)&&(Ar=pn);else if(pn.entryType==="mark"&&pn.name===Be.name){be.perfTiming=Ar;break}if(pn.startTime<Be.startTime-1e3)break}}}!Be||be.perfTiming||Ee>=Fe||be.async===!1?(Be&&at(Ye.clearMarks)&&Ye.clearMarks(Be.name),be.perfAttempts=Ee,Ie()):setTimeout(br,ot)}catch(a0){Ce(a0)}})()}function T(ae,be){var Ie=ee&&ee.telemetryTrace&&ee.telemetryTrace.traceID||zr(),Ce=zr().substr(0,16),Be=new vc(Ie,Ce,st[Po]());Be.requestSentTime=Ma(),Be.errorStatusText=B,ae instanceof Request?Be.requestUrl=ae?ae.url:"":Be.requestUrl=ae;var Ye="GET";be&&be.method?Ye=be.method:ae&&ae instanceof Request&&(Ye=ae.method),Be.method=Ye;var Fe={};if(p){var ot=new Headers((be?be.headers:0)||(ae instanceof Request?ae.headers||{}:{}));ot.forEach(function(mt,Ee){Xt(Ee)&&(Fe[Ee]=mt)})}return Be.requestHeaders=Fe,It("fetch",Be),Be}function le(ae){var be="";try{De(ae)||(typeof ae=="string"?be+="(url: '".concat(ae,"')"):be+="(url: '".concat(ae.url,"')"))}catch(Ie){No(st,we.FailedMonitorAjaxOpen,"Failed to grab failed fetch diagnostics message",{exception:it(Ie)})}return be}function Le(ae,be,Ie,Ce,Be,Ye,Fe){if(!Be)return;function ot(mt,Ee,br){var Ar=br||{};Ar.fetchDiagnosticsMessage=le(Ie),Ee&&(Ar.exception=it(Ee)),La(st,mt,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",Ar)}Be.responseFinishedTime=Ma(),Be.status=be,Qe("fetch",Be,function(){var mt=Be.CreateTrackItem("Fetch",p,Ye),Ee;try{ft&&(Ee=ft({status:be,request:Ie,response:Ce}))}catch{La(st,we.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}mt?(Ee!==void 0&&(mt.properties=Qt(Qt({},mt.properties),Ee)),st[n](mt)):ot(we.FailedMonitorAjaxDur,null,{requestSentTime:Be.requestSentTime,responseFinishedTime:Be.responseFinishedTime})},function(mt){ot(we.FailedMonitorAjaxGetCorrelationHeader,mt,null)})}function $e(ae){if(ae&&ae.headers)try{var be=ae.headers.get(Ct.requestContextHeader);return Jn.getCorrelationContext(be)}catch(Ie){La(st,we.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:le(ae),exception:it(Ie)})}}}),r}return e.getDefaultConfig=function(){var r={maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,excludeRequestFromAutoTrackingPatterns:void 0,disableCorrelationHeaders:!1,distributedTracingMode:dn.AI_AND_W3C,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:void 0,correlationHeaderExcludePatterns:void 0,appId:void 0,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1,enableAjaxErrorStatusText:!1,enableAjaxPerfTracking:!1,maxAjaxPerfLookupAttempts:3,ajaxPerfLookupDelay:25,ignoreHeaders:["Authorization","X-API-Key","WWW-Authenticate"],addRequestContext:void 0};return r},e.getEmptyConfig=function(){var r=this.getDefaultConfig();return Tt(r,function(n){r[n]=void 0}),r},e.prototype.processTelemetry=function(r,n){this.processNext(r,n)},e.identifier="AjaxDependencyPlugin",e}(In);var hc,Cf=["snippet","dependencies","properties","_snippetVersion","appInsightsNew","getSKUDefaults"];var _c=function(){function t(e){var r=this;r._snippetVersion=""+(e.sv||e.version||""),e.queue=e.queue||[],e.version=e.version||2;var n=e.config||{};if(n.connectionString){var i=Yl(n.connectionString),a=i.ingestionendpoint;n.endpointUrl=a?"".concat(a,"/v2/track"):n.endpointUrl,n.instrumentationKey=i.instrumentationkey||n.instrumentationKey}r.appInsights=new oc,r.properties=new dc,r.dependencies=new pc,r.core=new Cl,r._sender=new uc,r.snippet=e,r.config=n,r.getSKUDefaults()}return t.prototype.getCookieMgr=function(){return this.appInsights.getCookieMgr()},t.prototype.trackEvent=function(e,r){this.appInsights.trackEvent(e,r)},t.prototype.trackPageView=function(e){var r=e||{};this.appInsights.trackPageView(r)},t.prototype.trackPageViewPerformance=function(e){var r=e||{};this.appInsights.trackPageViewPerformance(r)},t.prototype.trackException=function(e,r){e&&!e.exception&&e.error&&(e.exception=e.error),this.appInsights.trackException(e,r)},t.prototype._onerror=function(e){this.appInsights._onerror(e)},t.prototype.trackTrace=function(e,r){this.appInsights.trackTrace(e,r)},t.prototype.trackMetric=function(e,r){this.appInsights.trackMetric(e,r)},t.prototype.startTrackPage=function(e){this.appInsights.startTrackPage(e)},t.prototype.stopTrackPage=function(e,r,n,i){this.appInsights.stopTrackPage(e,r,n,i)},t.prototype.startTrackEvent=function(e){this.appInsights.startTrackEvent(e)},t.prototype.stopTrackEvent=function(e,r,n){this.appInsights.stopTrackEvent(e,r,n)},t.prototype.addTelemetryInitializer=function(e){return this.appInsights.addTelemetryInitializer(e)},t.prototype.setAuthenticatedUserContext=function(e,r,n){n===void 0&&(n=!1),this.properties.context.user.setAuthenticatedUserContext(e,r,n)},t.prototype.clearAuthenticatedUserContext=function(){this.properties.context.user.clearAuthenticatedUserContext()},t.prototype.trackDependencyData=function(e){this.dependencies.trackDependencyData(e)},t.prototype.flush=function(e){var r=this;e===void 0&&(e=!0),Vn(this.core,function(){return"AISKU.flush"},function(){tt(r.core.getTransmissionControls(),function(n){tt(n,function(i){i.flush(e)})})},null,e)},t.prototype.onunloadFlush=function(e){e===void 0&&(e=!0),tt(this.core.getTransmissionControls(),function(r){tt(r,function(n){n.onunloadFlush?n.onunloadFlush():n.flush(e)})})},t.prototype.loadAppInsights=function(e,r,n){var i=this;e===void 0&&(e=!1);var a=this;function s(v){if(v){var d="";De(a._snippetVersion)||(d+=a._snippetVersion),e&&(d+=".lg"),a.context&&a.context.internal&&(a.context.internal.snippetVer=d||"-"),Tt(a,function(p,B){et(p)&&!at(B)&&p&&p[0]!=="_"&&Cf.indexOf(p)===-1&&(v[p]=B)})}}return e&&a.config.extensions&&a.config.extensions.length>0&&wr("Extensions not allowed in legacy mode"),Vn(a.core,function(){return"AISKU.loadAppInsights"},function(){var v=[];v.push(a._sender),v.push(a.properties),v.push(a.dependencies),v.push(a.appInsights),a.core.initialize(a.config,v,r,n),a.context=a.properties.context,hc&&a.context&&(a.context.internal.sdkSrc=hc),s(a.snippet),a.emptyQueue(),a.pollInternalLogs(),a.addHousekeepingBeforeUnload(i)}),a},t.prototype.updateSnippetDefinitions=function(e){tl(e,this,function(r){return r&&Cf.indexOf(r)===-1})},t.prototype.emptyQueue=function(){var e=this;try{if(ur(e.snippet.queue)){for(var r=e.snippet.queue.length,n=0;n<r;n++){var i=e.snippet.queue[n];i()}e.snippet.queue=void 0,delete e.snippet.queue}}catch(s){var a={};s&&at(s.toString)&&(a.exception=s.toString())}},t.prototype.pollInternalLogs=function(){this.core.pollInternalLogs()},t.prototype.stopPollingInternalLogs=function(){this.core.stopPollingInternalLogs()},t.prototype.addHousekeepingBeforeUnload=function(e){if(Di()||gs()){var r=function(){e.onunloadFlush(!1),tt(e.appInsights.core._extensions,function(a){if(a.identifier===_i)return a&&a.context&&a.context._sessionManager&&a.context._sessionManager.backup(),-1})},n=!1,i=e.appInsights.config.disablePageUnloadEvents;e.appInsights.config.disableFlushOnBeforeUnload||(n=Pl(r,i),n=bo(r,i)||n,!n&&!vl()&&e.appInsights.core.logger.throwInternal(Pe.CRITICAL,we.FailedToAddHandlerForOnBeforeUnload,"Could not add handler for beforeunload and pagehide")),!n&&!e.appInsights.config.disableFlushOnUnload&&bo(r,i)}},t.prototype.getSender=function(){return this._sender},t.prototype.getSKUDefaults=function(){var e=this;e.config.diagnosticLogInterval=e.config.diagnosticLogInterval&&e.config.diagnosticLogInterval>0?e.config.diagnosticLogInterval:1e4},t}();(function(){var t=null,e=!1,r=["://js.monitor.azure.com/","://az416426.vo.msecnd.net/"];try{var n=(document||{}).currentScript;n&&(t=n.src)}catch{}if(t)try{var i=t.toLowerCase();if(i){for(var a="",s=0;s<r.length;s++)if(i.indexOf(r[s])!==-1){a="cdn"+(s+1),i.indexOf("/scripts/")===-1&&(i.indexOf("/next/")!==-1?a+="-next":i.indexOf("/beta/")!==-1&&(a+="-beta")),hc=a+(e?".mod":"");break}}}catch{}})();var Ua,Mf=t=>(Ua=new _c({config:{instrumentationKey:t}}),Ua.loadAppInsights(),Ua),Zi={START:"start",FINISH:"finish",ERROR:"error",UPLOAD_VIDEO:"upload_video"},Nm=t=>Ua.trackException({exception:t}),Qi=(t,e)=>Ua.trackEvent({name:t,properties:e}),Dm=(t,e,r)=>Ua.trackPageView({name:t,uri:e,properties:r}),Yt={trackPage:Dm,trackError:Nm,registerStart:(t,e,r)=>Qi(Zi.START,{proctoringId:t,success:e,description:r}),registerFinish:(t,e,r)=>Qi(Zi.FINISH,{proctoringId:t,success:e,description:r}),registerError:(t,e)=>Qi(Zi.ERROR,{proctoringId:t,description:e}),registerUpload:(t,e,r,n,i)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,success:e,description:r,serviceType:n,uploadTime:i}),registerUploadFile:(t,e,r)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,description:e,fileType:r}),registerChangeDevice:(t,e,r)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,inOrOut:e,devicesChanged:r}),registerStopSharingScreen:(t,e)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,description:e})};var Ji=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=d=>{let p=d.loadedBytes/n.size*100;i&&i(Math.round(p))},s=await this.backend.getAzureSignedUrl(r,n,this.proctoringId),v=await ua.request({url:s,method:"PUT",headers:{"x-ms-blob-type":"BlockBlob"},data:n,onUploadProgress:d=>{a({loadedBytes:d.loaded})}}).then(()=>!0).catch(()=>!1);return{storage:"AzureBlob",url:s,uploaded:v}}catch{throw Yt.registerError(this.proctoringId,`Failed to upload to Azure
19
+ `}):e=t.src||""),e}function dm(t){var e,r=t.obj;if(r&&r.length>0){e=[];var n=0,i=0;tt(r,function(k){var ce=k.toString();if(rc.regex.test(ce)){var P=new rc(ce,n++);i+=P.sizeInBytes,e.push(P)}});var a=32*1024;if(i>a)for(var s=0,v=e.length-1,d=0,p=s,B=v;s<v;){var z=e[s].sizeInBytes,ee=e[v].sizeInBytes;if(d+=z+ee,d>a){var te=B-p+1;e.splice(p,te);break}p=s,B=v,s++,v--}}return e}function Us(t){var e="";if(t&&(e=t.typeName||t.name||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor.toString());e=n&&n.length>1?n[1]:""}catch{}return e}function Ql(t){if(t)try{if(!et(t)){var e=Us(t),r=tc(t,!1);return(!r||r==="{}")&&(t[Ba]&&(t=t[Ba],e=Us(t)),r=tc(t,!0)),r.indexOf(e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}var xr=function(t){ut(e,t);function e(r,n,i,a,s,v){var d=t.call(this)||this;return d.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0},cm(n)?(d.exceptions=n.exceptions,d.properties=n.properties,d.measurements=n.measurements,n.severityLevel&&(d.severityLevel=n.severityLevel),n.id&&(d.id=n.id),n.problemGroup&&(d.problemGroup=n.problemGroup),d.ver=2,ke(n.isManual)||(d.isManual=n.isManual)):(i||(i={}),d.exceptions=[new Uu(r,n,i)],d.properties=Br(r,i),d.measurements=Nr(r,a),s&&(d.severityLevel=s),v&&(d.id=v)),d}return e.CreateAutoException=function(r,n,i,a,s,v,d,p){var B=Us(s||v||r);return{message:Vu(r,B),url:n,lineNumber:i,columnNumber:a,error:Ql(s||v||r),evt:Ql(v||r),typeName:B,stackDetails:qu(d||s||v),errorSrc:p}},e.CreateFromInterface=function(r,n,i,a){var s=n.exceptions&&Ni(n.exceptions,function(d){return Uu.CreateFromInterface(r,d)}),v=new e(r,Qt(Qt({},n),{exceptions:s}),i,a);return v},e.prototype.toInterface=function(){var r=this,n=r.exceptions,i=r.properties,a=r.measurements,s=r.severityLevel,v=r.problemGroup,d=r.id,p=r.isManual,B=n instanceof Array&&Ni(n,function(z){return z.toInterface()})||void 0;return{ver:"4.0",exceptions:B,severityLevel:s,properties:i,measurements:a,problemGroup:v,id:d,isManual:p}},e.CreateSimpleException=function(r,n,i,a,s,v){return{exceptions:[{hasFullStack:!0,message:r,stack:s,typeName:n}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e.formatError=Ql,e}(Du);var Uu=function(t){ut(e,t);function e(r,n,i){var a=t.call(this)||this;if(a.aiDataContract={id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2},lm(n))a.typeName=n.typeName,a.message=n.message,a[vn]=n[vn],a.parsedStack=n.parsedStack,a.hasFullStack=n.hasFullStack;else{var s=n,v=s&&s.evt;_a(s)||(s=s[Ba]||v||s),a.typeName=Mt(r,Us(s))||ar,a.message=yo(r,Vu(n||s,a.typeName))||ar;var d=n[Jl]||qu(n);a.parsedStack=dm(d),a[vn]=Ol(r,fm(d)),a.hasFullStack=ur(a.parsedStack)&&a.parsedStack.length>0,i&&(i.typeName=i.typeName||a.typeName)}return a}return e.prototype.toInterface=function(){var r=this.parsedStack instanceof Array&&Ni(this.parsedStack,function(i){return i.toInterface()}),n={id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this[vn],parsedStack:r||void 0};return n},e.CreateFromInterface=function(r,n){var i=n.parsedStack instanceof Array&&Ni(n.parsedStack,function(s){return rc.CreateFromInterface(s)})||n.parsedStack,a=new e(r,Qt(Qt({},n),{parsedStack:i}));return a},e}(Ou);var rc=function(t){ut(e,t);function e(r,n){var i=t.call(this)||this;if(i.sizeInBytes=0,i.aiDataContract={level:1,method:1,assembly:0,fileName:0,line:0},typeof r=="string"){var a=r;i.level=n,i.method=sm,i.assembly=Jt(a),i.fileName="",i.line=0;var s=a.match(e.regex);s&&s.length>=5&&(i.method=Jt(s[2])||i.method,i.fileName=Jt(s[4]),i.line=parseInt(s[5])||0)}else i.level=r.level,i.method=r.method,i.assembly=r.assembly,i.fileName=r.fileName,i.line=r.line,i.sizeInBytes=0;return i.sizeInBytes+=i.method.length,i.sizeInBytes+=i.fileName.length,i.sizeInBytes+=i.assembly.length,i.sizeInBytes+=e.baseSize,i.sizeInBytes+=i.level.toString().length,i.sizeInBytes+=i.line.toString().length,i}return e.CreateFromInterface=function(r){return new e(r,null)},e.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},e.regex=/^([\s]+at)?[\s]{0,50}([^\@\()]+?)[\s]{0,50}(\@|\()([^\(\n]+):([0-9]+):([0-9]+)(\)?)$/,e.baseSize=58,e}(ku);var zu=function(){function t(){this.ver=2,this.metrics=[],this.properties={},this.measurements={}}return t}();var Hs;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(Hs||(Hs={}));var ju=function(){function t(){this.kind=Hs.Measurement}return t}();var Gu=function(t){ut(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},r}return e}(ju);var en=function(t){ut(e,t);function e(r,n,i,a,s,v,d,p,B){var z=t.call(this)||this;z.aiDataContract={ver:1,metrics:1,properties:0};var ee=new Gu;return ee.count=a>0?a:void 0,ee.max=isNaN(v)||v===null?void 0:v,ee.min=isNaN(s)||s===null?void 0:s,ee.name=Mt(r,n)||ar,ee.value=i,ee.stdDev=isNaN(d)||d===null?void 0:d,z.metrics=[ee],z.properties=Br(r,p),z.measurements=Nr(r,B),z}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(zu);var Ro=function(t){ut(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(Fs);var kr=function(t){ut(e,t);function e(r,n,i,a,s,v,d){var p=t.call(this)||this;return p.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0},p.id=Ll(r,d),p.url=Qn(r,i),p.name=Mt(r,n)||ar,isNaN(a)||(p.duration=Qr(a)),p.properties=Br(r,s),p.measurements=Nr(r,v),p}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(Ro);var Xu=function(){function t(){this.ver=2,this.success=!0,this.properties={},this.measurements={}}return t}();var tn=function(t){ut(e,t);function e(r,n,i,a,s,v,d,p,B,z,ee,te){B===void 0&&(B="Ajax");var k=t.call(this)||this;k.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0},k.id=n,k.duration=Qr(s),k.success=v,k.resultCode=d+"",k.type=Mt(r,B);var ce=Bu(r,i,p,a);return k.data=Qn(r,a)||ce.data,k.target=Mt(r,ce.target),z&&(k.target="".concat(k.target," | ").concat(z)),k.name=Mt(r,ce.name),k.properties=Br(r,ee),k.measurements=Nr(r,te),k}return e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(Xu);var Ku=function(){function t(){this.ver=2,this.properties={},this.measurements={}}return t}();var Pn=function(t){ut(e,t);function e(r,n,i,a,s){var v=t.call(this)||this;return v.aiDataContract={ver:1,message:1,severityLevel:0,properties:0},n=n||ar,v.message=yo(r,n),v.properties=Br(r,a),v.measurements=Nr(r,s),i&&(v.severityLevel=i),v}return e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(Ku);var Wu=function(t){ut(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return e}(Ro);var Bn=function(t){ut(e,t);function e(r,n,i,a,s,v,d){var p=t.call(this)||this;return p.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0},p.url=Qn(r,i),p.name=Mt(r,n)||ar,p.properties=Br(r,s),p.measurements=Nr(r,v),d&&(p.domProcessing=d.domProcessing,p.duration=d.duration,p.networkConnect=d.networkConnect,p.perfTotal=d.perfTotal,p.receivedResponse=d.receivedResponse,p.sentRequest=d.sentRequest),p}return e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(Wu);var qn=function(t){ut(e,t);function e(r,n){var i=t.call(this)||this;return i.aiDataContract={baseType:1,baseData:1},i.baseType=r,i.baseData=n,i}return e}(Zl);var Na;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(Na||(Na={}));function hi(t){var e="ai."+t+".";return function(r){return e+r}}var To=hi("application"),pr=hi("device"),Vs=hi("location"),ka=hi("operation"),nc=hi("session"),pi=hi("user"),Xi=hi("cloud"),Ao=hi("internal"),Da=function(t){ut(e,t);function e(){return t.call(this)||this}return e}(rl({applicationVersion:To("ver"),applicationBuild:To("build"),applicationTypeId:To("typeId"),applicationId:To("applicationId"),applicationLayer:To("layer"),deviceId:pr("id"),deviceIp:pr("ip"),deviceLanguage:pr("language"),deviceLocale:pr("locale"),deviceModel:pr("model"),deviceFriendlyName:pr("friendlyName"),deviceNetwork:pr("network"),deviceNetworkName:pr("networkName"),deviceOEMName:pr("oemName"),deviceOS:pr("os"),deviceOSVersion:pr("osVersion"),deviceRoleInstance:pr("roleInstance"),deviceRoleName:pr("roleName"),deviceScreenResolution:pr("screenResolution"),deviceType:pr("type"),deviceMachineName:pr("machineName"),deviceVMName:pr("vmName"),deviceBrowser:pr("browser"),deviceBrowserVersion:pr("browserVersion"),locationIp:Vs("ip"),locationCountry:Vs("country"),locationProvince:Vs("province"),locationCity:Vs("city"),operationId:ka("id"),operationName:ka("name"),operationParentId:ka("parentId"),operationRootId:ka("rootId"),operationSyntheticSource:ka("syntheticSource"),operationCorrelationVector:ka("correlationVector"),sessionId:nc("id"),sessionIsFirst:nc("isFirst"),sessionIsNew:nc("isNew"),userAccountAcquisitionDate:pi("accountAcquisitionDate"),userAccountId:pi("accountId"),userAgent:pi("userAgent"),userId:pi("id"),userStoreRegion:pi("storeRegion"),userAuthUserId:pi("authUserId"),userAnonymousUserAcquisitionDate:pi("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:pi("authUserAcquisitionDate"),cloudName:Xi("name"),cloudRole:Xi("role"),cloudRoleVer:Xi("roleVer"),cloudRoleInstance:Xi("roleInstance"),cloudEnvironment:Xi("environment"),cloudLocation:Xi("location"),cloudDeploymentUnit:Xi("deploymentUnit"),internalNodeName:Ao("nodeName"),internalSdkVersion:Ao("sdkVersion"),internalAgentVersion:Ao("agentVersion"),internalSnippet:Ao("snippet"),internalSdkSrc:Ao("sdkSrc")}));var mn=function(){function t(){}return t.create=function(e,r,n,i,a,s){if(n=Mt(i,n)||ar,ke(e)||ke(r)||ke(n))throw Error("Input doesn't contain all required fields");var v="";e[Ps]&&(v=e[Ps],delete e[Ps]);var d={name:n,time:Pr(new Date),iKey:v,ext:s||{},tags:[],data:{},baseType:r,baseData:e};return ke(a)||Tt(a,function(p,B){d.data[p]=B}),d},t}();var Dr={UserExt:"user",DeviceExt:"device",TraceExt:"trace",WebExt:"web",AppExt:"app",OSExt:"os",SessionExt:"ses",SDKExt:"sdk"},Pt=new Da;var _i="AppInsightsPropertiesPlugin",Io="AppInsightsChannelPlugin",ic="ApplicationInsightsAnalytics";var Yu=function(){function t(e,r,n,i){gt(t,this,function(a){var s=null,v=[],d=!1,p;n&&(p=n.logger);function B(){n&&tt(n.getTransmissionControls(),function(ee){tt(ee,function(te){return te.flush(!0)})})}function z(ee){v.push(ee),s||(s=setInterval(function(){var te=v.slice(0),k=!1;v=[],tt(te,function(ce){ce()?k=!0:v.push(ce)}),v.length===0&&(clearInterval(s),s=null),k&&B()},100))}a.trackPageView=function(ee,te){var k=ee.name;if(ke(k)||typeof k!="string"){var ce=ir();k=ee.name=ce&&ce.title||""}var P=ee.uri;if(ke(P)||typeof P!="string"){var oe=$r();P=ee.uri=oe&&oe.href||""}if(!i.isPerformanceTimingSupported()){e.sendPageViewInternal(ee,te),B(),p.throwInternal(Pe.WARNING,we.NavigationTimingNotSupported,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");return}var se=!1,xe,Ge=i.getPerformanceTiming().navigationStart;Ge>0&&(xe=mr(Ge,+new Date),i.shouldCollectDuration(xe)||(xe=void 0));var lt;!ke(te)&&!ke(te.duration)&&(lt=te.duration),(r||!isNaN(lt))&&(isNaN(lt)&&(te||(te={}),te.duration=xe),e.sendPageViewInternal(ee,te),B(),se=!0);var ft=6e4;te||(te={}),z(function(){var st=!1;try{if(i.isPerformanceTimingDataReady()){st=!0;var yt={name:k,uri:P};i.populatePageViewPerformanceEvent(yt),!yt.isValid&&!se?(te.duration=xe,e.sendPageViewInternal(ee,te)):(se||(te.duration=yt.durationMs,e.sendPageViewInternal(ee,te)),d||(e.sendPageViewPerformanceInternal(yt,te),d=!0))}else Ge>0&&mr(Ge,+new Date)>ft&&(st=!0,se||(te.duration=ft,e.sendPageViewInternal(ee,te)))}catch(Xt){p.throwInternal(Pe.CRITICAL,we.TrackPVFailedCalc,"trackPageView failed on page load calculation: "+_t(Xt),{exception:it(Xt)})}return st})}})}return t}();var $u=function(){function t(e,r){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=r,this._logger=e}return t.prototype.trackPreviousPageVisit=function(e,r){try{var n=this.restartPageVisitTimer(e,r);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(i){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+it(i))}},t.prototype.restartPageVisitTimer=function(e,r){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,r),n}catch(i){return this._logger.warnToConsole("Call to restart failed: "+it(i)),null}},t.prototype.startPageVisitTimer=function(e,r){try{if(ji()){Ia(this._logger,this.prevPageVisitDataKeyName)!=null&&wr("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new Sm(e,r),i=vr().stringify(n);Ca(this._logger,this.prevPageVisitDataKeyName,i)}}catch(a){this._logger.warnToConsole("Call to start failed: "+it(a))}},t.prototype.stopPageVisitTimer=function(){try{if(ji()){var e=fr(),r=Ia(this._logger,this.prevPageVisitDataKeyName);if(r&&An()){var n=vr().parse(r);return n.pageVisitTime=e-n.pageVisitStartTime,Kl(this._logger,this.prevPageVisitDataKeyName),n}else return null}return null}catch(i){return this._logger.warnToConsole("Stop page visit timer failed: "+it(i)),null}},t}();var Sm=function(){function t(e,r){this.pageVisitStartTime=fr(),this.pageName=e,this.pageUrl=r}return t}();var Zu=function(){function t(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}return t.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var r=this.getPerformanceNavigationTiming(),n=this.getPerformanceTiming(),i=0,a=0,s=0,v=0,d=0;(r||n)&&(r?(i=r.duration,a=r.startTime===0?r.connectEnd:mr(r.startTime,r.connectEnd),s=mr(r.requestStart,r.responseStart),v=mr(r.responseStart,r.responseEnd),d=mr(r.responseEnd,r.loadEventEnd)):(i=mr(n.navigationStart,n.loadEventEnd),a=mr(n.navigationStart,n.connectEnd),s=mr(n.requestStart,n.responseStart),v=mr(n.responseStart,n.responseEnd),d=mr(n.responseEnd,n.loadEventEnd)),i===0?this._logger.throwInternal(Pe.WARNING,we.ErrorPVCalc,"error calculating page view performance.",{total:i,network:a,request:s,response:v,dom:d}):this.shouldCollectDuration(i,a,s,v,d)?i<Math.floor(a)+Math.floor(s)+Math.floor(v)+Math.floor(d)?this._logger.throwInternal(Pe.WARNING,we.ClientPerformanceMathError,"client performance math error.",{total:i,network:a,request:s,response:v,dom:d}):(e.durationMs=i,e.perfTotal=e.duration=Qr(i),e.networkConnect=Qr(a),e.sentRequest=Qr(s),e.receivedResponse=Qr(v),e.domProcessing=Qr(d),e.isValid=!0):this._logger.throwInternal(Pe.WARNING,we.InvalidDurationValue,"Invalid page load duration value. Browser perf data won't be sent.",{total:i,network:a,request:s,response:v,dom:d}))},t.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?Zr().timing:null},t.prototype.getPerformanceNavigationTiming=function(){return this.isPerformanceNavigationTimingSupported()?Zr().getEntriesByType("navigation")[0]:null},t.prototype.isPerformanceNavigationTimingSupported=function(){var e=Zr();return e&&e.getEntriesByType&&e.getEntriesByType("navigation").length>0},t.prototype.isPerformanceTimingSupported=function(){var e=Zr();return e&&e.timing},t.prototype.isPerformanceTimingDataReady=function(){var e=Zr(),r=e?e.timing:0;return r&&r.domainLookupStart>0&&r.navigationStart>0&&r.responseStart>0&&r.requestStart>0&&r.loadEventEnd>0&&r.responseEnd>0&&r.connectEnd>0&&r.domLoading>0},t.prototype.shouldCollectDuration=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=Rr()||{},i=["googlebot","adsbot-google","apis-google","mediapartners-google"],a=n.userAgent,s=!1;if(a)for(var v=0;v<i.length;v++)s=s||a.toLowerCase().indexOf(i[v])!==-1;if(s)return!1;for(var v=0;v<e.length;v++)if(e[v]<0||e[v]>=this.MAX_DURATION_ALLOWED)return!1;return!0},t}();var Qu="duration",ac="event";function Co(t,e){t&&t.dispatchEvent&&e&&t.dispatchEvent(e)}function gm(t){if(t&&t.reason){var e=t.reason;return!et(e)&&at(e.toString)?e.toString():it(e)}return t||""}var oc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier=ic,r.priority=180,r.autoRoutePVDelay=500;var n,i,a,s=0,v,d;return gt(e,r,function(p,B){var z=$r(!0);v=z&&z.href||"",p.getCookieMgr=function(){return Ui(p.core)},p.processTelemetry=function(P,oe){Vn(p.core,function(){return p.identifier+":processTelemetry"},function(){var se=!1,xe=p._telemetryInitializers.length;oe=p._getTelCtx(oe);for(var Ge=0;Ge<xe;++Ge){var lt=p._telemetryInitializers[Ge];if(lt)try{if(lt.apply(null,[P])===!1){se=!0;break}}catch(ft){oe.diagLog().throwInternal(Pe.CRITICAL,we.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+_t(ft),{exception:it(ft)},!0)}}se||p.processNext(P,oe)},function(){return{item:P}},!P.sync)},p.trackEvent=function(P,oe){try{var se=mn.create(P,Jr.dataType,Jr.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.WARNING,we.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+_t(xe),{exception:it(xe)})}},p.startTrackEvent=function(P){try{n.start(P)}catch(oe){p.diagLog().throwInternal(Pe.CRITICAL,we.StartTrackEventFailed,"startTrackEvent failed, event will not be collected: "+_t(oe),{exception:it(oe)})}},p.stopTrackEvent=function(P,oe,se){try{n.stop(P,void 0,oe)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.StopTrackEventFailed,"stopTrackEvent failed, event will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackTrace=function(P,oe){try{var se=mn.create(P,Pn.dataType,Pn.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.WARNING,we.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackMetric=function(P,oe){try{var se=mn.create(P,en.dataType,en.envelopeType,p.diagLog(),oe);p.core.track(se)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackMetricFailed,"trackMetric failed, metric will not be collected: "+_t(xe),{exception:it(xe)})}},p.trackPageView=function(P,oe){try{var se=P||{};p._pageViewManager.trackPageView(se,Qt(Qt(Qt({},se.properties),se.measurements),oe)),p.config.autoTrackPageVisitTime&&p._pageVisitTimeManager.trackPreviousPageVisit(se.name,se.uri)}catch(xe){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackPVFailed,"trackPageView failed, page view will not be collected: "+_t(xe),{exception:it(xe)})}},p.sendPageViewInternal=function(P,oe,se){var xe=ir();xe&&(P.refUri=P.refUri===void 0?xe.referrer:P.refUri);var Ge=mn.create(P,kr.dataType,kr.envelopeType,p.diagLog(),oe,se);p.core.track(Ge),s=0},p.sendPageViewPerformanceInternal=function(P,oe,se){var xe=mn.create(P,Bn.dataType,Bn.envelopeType,p.diagLog(),oe,se);p.core.track(xe)},p.trackPageViewPerformance=function(P,oe){try{p._pageViewPerformanceManager.populatePageViewPerformanceEvent(P),p.sendPageViewPerformanceInternal(P,oe)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackPVFailed,"trackPageViewPerformance failed, page view will not be collected: "+_t(se),{exception:it(se)})}},p.startTrackPage=function(P){try{if(typeof P!="string"){var oe=ir();P=oe&&oe.title||""}i.start(P)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.StartTrackFailed,"startTrackPage failed, page view may not be collected: "+_t(se),{exception:it(se)})}},p.stopTrackPage=function(P,oe,se,xe){try{if(typeof P!="string"){var Ge=ir();P=Ge&&Ge.title||""}if(typeof oe!="string"){var lt=$r();oe=lt&&lt.href||""}i.stop(P,oe,se,xe),p.config.autoTrackPageVisitTime&&p._pageVisitTimeManager.trackPreviousPageVisit(P,oe)}catch(ft){p.diagLog().throwInternal(Pe.CRITICAL,we.StopTrackFailed,"stopTrackPage failed, page view will not be collected: "+_t(ft),{exception:it(ft)})}},p.sendExceptionInternal=function(P,oe,se){var xe=P.exception||P.error||new Error(ar),Ge=new xr(p.diagLog(),xe,P.properties||oe,P.measurements,P.severityLevel,P.id).toInterface(),lt=mn.create(Ge,xr.dataType,xr.envelopeType,p.diagLog(),oe,se);p.core.track(lt)},p.trackException=function(P,oe){try{p.sendExceptionInternal(P,oe)}catch(se){p.diagLog().throwInternal(Pe.CRITICAL,we.TrackExceptionFailed,"trackException failed, exception will not be collected: "+_t(se),{exception:it(se)})}},p._onerror=function(P){var oe=P&&P.error,se=P&&P.evt;try{if(!se){var xe=Hn();xe&&(se=xe[ac])}var Ge=P&&P.url||(ir()||{}).URL,lt=P.errorSrc||"window.onerror@"+Ge+":"+(P.lineNumber||0)+":"+(P.columnNumber||0),ft={errorSrc:lt,url:Ge,lineNumber:P.lineNumber||0,columnNumber:P.columnNumber||0,message:P.message};Hl(P.message,P.url,P.lineNumber,P.columnNumber,P.error)?ce(xr.CreateAutoException("Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",Ge,P.lineNumber||0,P.columnNumber||0,oe,se,null,lt),ft):(P.errorSrc||(P.errorSrc=lt),p.trackException({exception:P,severityLevel:Na.Error},ft))}catch(yt){var st=oe?oe.name+", "+oe.message:"null";p.diagLog().throwInternal(Pe.CRITICAL,we.ExceptionWhileLoggingError,"_onError threw exception while logging error, error will not be collected: "+_t(yt),{exception:it(yt),errorString:st})}},p.addTelemetryInitializer=function(P){p._telemetryInitializers.push(P)},p.initialize=function(P,oe,se,xe){if(!p.isInitialized()){if(ke(oe))throw Error("Error initializing");B.initialize(P,oe,se,xe),p.setInitialized(!1);var Ge=p._getTelCtx(),lt=p.identifier;p.config=Ge.getExtCfg(lt);var ft=e.getDefaultConfig(P);ft!==void 0&&Tt(ft,function(St,Dt){p.config[St]=Ge.getConfig(lt,St,Dt),p.config[St]===void 0&&(p.config[St]=Dt)}),p.config.isStorageUseDisabled&&zl();var st={instrumentationKey:function(){return P.instrumentationKey},accountId:function(){return p.config.accountId||P.accountId},sessionRenewalMs:function(){return p.config.sessionRenewalMs||P.sessionRenewalMs},sessionExpirationMs:function(){return p.config.sessionExpirationMs||P.sessionExpirationMs},sampleRate:function(){return p.config.samplingPercentage||P.samplingPercentage},sdkExtension:function(){return p.config.sdkExtension||P.sdkExtension},isBrowserLinkTrackingEnabled:function(){return p.config.isBrowserLinkTrackingEnabled||P.isBrowserLinkTrackingEnabled},appId:function(){return p.config.appId||P.appId}};p._pageViewPerformanceManager=new Zu(p.core),p._pageViewManager=new Yu(r,p.config.overridePageViewDuration,p.core,p._pageViewPerformanceManager),p._pageVisitTimeManager=new $u(p.diagLog(),function(St,Dt,Nt){return ee(St,Dt,Nt)}),p._telemetryInitializers=p._telemetryInitializers||[],te(st),n=new Ju(p.diagLog(),"trackEvent"),n.action=function(St,Dt,Nt,It){It||(It={}),It[Qu]=Nt.toString(),p.trackEvent({name:St,properties:It})},i=new Ju(p.diagLog(),"trackPageView"),i.action=function(St,Dt,Nt,It,Qe){ke(It)&&(It={}),It[Qu]=Nt.toString();var T={name:St,uri:Dt,properties:It,measurements:Qe};p.sendPageViewInternal(T,It)};var yt=Hn(),Xt=cl(),tr=$r(!0),sr=r;if(p.config.disableExceptionTracking===!1&&!p.config.autoExceptionInstrumented&&yt){var an="onerror",Tr=yt[an];yt.onerror=function(St,Dt,Nt,It,Qe){var T=yt[ac],le=Tr&&Tr(St,Dt,Nt,It,Qe);return le!==!0&&sr._onerror(xr.CreateAutoException(St,Dt,Nt,It,Qe,T)),le},p.config.autoExceptionInstrumented=!0}if(p.config.disableExceptionTracking===!1&&p.config.enableUnhandledPromiseRejectionTracking===!0&&!p.config.autoUnhandledPromiseInstrumented&&yt){var hr="onunhandledrejection",gr=yt[hr];yt[hr]=function(St){var Dt=yt[ac],Nt=gr&&gr.call(yt,St);return Nt!==!0&&sr._onerror(xr.CreateAutoException(gm(St),tr?tr.href:"",0,0,St,Dt)),Nt},p.config.autoUnhandledPromiseInstrumented=!0}if(p.config.enableAutoRouteTracking===!0&&Xt&&at(Xt.pushState)&&at(Xt.replaceState)&&yt&&typeof Event<"u"){var $t=r;tt(se,function(St){St.identifier===_i&&(a=St)}),Xt.pushState=function(St){return function(){var Nt=St.apply(this,arguments);return Co(yt,Vi($t.config.namePrefix+"pushState")),Co(yt,Vi($t.config.namePrefix+"locationchange")),Nt}}(Xt.pushState),Xt.replaceState=function(St){return function(){var Nt=St.apply(this,arguments);return Co(yt,Vi($t.config.namePrefix+"replaceState")),Co(yt,Vi($t.config.namePrefix+"locationchange")),Nt}}(Xt.replaceState),yt.addEventListener&&(yt.addEventListener($t.config.namePrefix+"popstate",function(){Co(yt,Vi($t.config.namePrefix+"locationchange"))}),yt.addEventListener($t.config.namePrefix+"locationchange",function(){if(a&&a.context&&a.context.telemetryTrace){a.context.telemetryTrace.traceID=zr();var St="_unknown_";tr&&tr.pathname&&(St=tr.pathname+(tr.hash||"")),a.context.telemetryTrace.name=Mt($t.diagLog(),St)}d&&(v=d),d=tr&&tr.href||"",setTimeout(function(Dt){$t.trackPageView({refUri:Dt,properties:{duration:0}})}.bind(r,v),$t.autoRoutePVDelay)}))}p.setInitialized(!0)}};function ee(P,oe,se){var xe={PageName:P,PageUrl:oe};p.trackMetric({name:"PageVisitTime",average:se,max:se,min:se,sampleCount:1},xe)}function te(P){if(!P.isBrowserLinkTrackingEnabled()){var oe=["/browserLinkSignalR/","/__browserLink/"],se=function(xe){if(xe.baseType===tn.dataType){var Ge=xe.baseData;if(Ge){for(var lt=0;lt<oe.length;lt++)if(Ge.target&&Ge.target.indexOf(oe[lt])>=0)return!1}}return!0};k(se)}}function k(P){p._telemetryInitializers.push(P)}function ce(P,oe){var se=mn.create(P,xr.dataType,xr.envelopeType,p.diagLog(),oe);p.core.track(se)}}),r}return e.getDefaultConfig=function(r){return r||(r={}),r.sessionRenewalMs=30*60*1e3,r.sessionExpirationMs=24*60*60*1e3,r.disableExceptionTracking=fn(r.disableExceptionTracking),r.autoTrackPageVisitTime=fn(r.autoTrackPageVisitTime),r.overridePageViewDuration=fn(r.overridePageViewDuration),r.enableUnhandledPromiseRejectionTracking=fn(r.enableUnhandledPromiseRejectionTracking),(isNaN(r.samplingPercentage)||r.samplingPercentage<=0||r.samplingPercentage>=100)&&(r.samplingPercentage=100),r.isStorageUseDisabled=fn(r.isStorageUseDisabled),r.isBrowserLinkTrackingEnabled=fn(r.isBrowserLinkTrackingEnabled),r.enableAutoRouteTracking=fn(r.enableAutoRouteTracking),r.namePrefix=r.namePrefix||"",r.enableDebug=fn(r.enableDebug),r.disableFlushOnBeforeUnload=fn(r.disableFlushOnBeforeUnload),r.disableFlushOnUnload=fn(r.disableFlushOnUnload,r.disableFlushOnBeforeUnload),r},e.Version="2.7.4",e}(In);var Ju=function(){function t(e,r){var n=this,i={};n.start=function(a){typeof i[a]<"u"&&e.throwInternal(Pe.WARNING,we.StartCalledMoreThanOnce,"start was called more than once for this event without calling stop.",{name:a,key:a},!0),i[a]=+new Date},n.stop=function(a,s,v,d){var p=i[a];if(isNaN(p))e.throwInternal(Pe.WARNING,we.StopCalledWithoutStart,"stop was called without a corresponding start.",{name:a,key:a},!0);else{var B=+new Date,z=mr(p,B);n.action(a,s,z,v,d)}delete i[a],i[a]=void 0}}return t}();var ef=function(){function t(e,r){var n=[],i=!1;this._get=function(){return n},this._set=function(a){return n=a,n},gt(t,this,function(a){a.enqueue=function(s){if(a.count()>=r.eventsLimitInMem()){i||(e.throwInternal(Pe.WARNING,we.InMemoryStorageBufferFull,"Maximum in-memory buffer size reached: "+a.count(),!0),i=!0);return}n.push(s)},a.count=function(){return n.length},a.size=function(){for(var s=n.length,v=0;v<n.length;v++)s+=n[v].length;return r.emitLineDelimitedJson()||(s+=2),s},a.clear=function(){n=[],i=!1},a.getItems=function(){return n.slice(0)},a.batchPayloads=function(s){if(s&&s.length>0){var v=r.emitLineDelimitedJson()?s.join(`
20
+ `):"["+s.join(",")+"]";return v}return null}})}return t}(),tf=function(t){ut(e,t);function e(r,n){var i=t.call(this,r,n)||this;return gt(e,i,function(a,s){a.markAsSent=function(v){s.clear()},a.clearSent=function(v){}}),i}return e}(ef);var rf=function(t){ut(e,t);function e(r,n){var i=t.call(this,r,n)||this,a=!1;return gt(e,i,function(s,v){var d=ee(e.BUFFER_KEY),p=ee(e.SENT_BUFFER_KEY),B=s._set(d.concat(p));B.length>e.MAX_BUFFER_SIZE&&(B.length=e.MAX_BUFFER_SIZE),te(e.SENT_BUFFER_KEY,[]),te(e.BUFFER_KEY,B),s.enqueue=function(k){if(s.count()>=e.MAX_BUFFER_SIZE){a||(r.throwInternal(Pe.WARNING,we.SessionStorageBufferFull,"Maximum buffer size reached: "+s.count(),!0),a=!0);return}v.enqueue(k),te(e.BUFFER_KEY,s._get())},s.clear=function(){v.clear(),te(e.BUFFER_KEY,s._get()),te(e.SENT_BUFFER_KEY,[]),a=!1},s.markAsSent=function(k){te(e.BUFFER_KEY,s._set(z(k,s._get())));var ce=ee(e.SENT_BUFFER_KEY);ce instanceof Array&&k instanceof Array&&(ce=ce.concat(k),ce.length>e.MAX_BUFFER_SIZE&&(r.throwInternal(Pe.CRITICAL,we.SessionStorageBufferFull,"Sent buffer reached its maximum size: "+ce.length,!0),ce.length=e.MAX_BUFFER_SIZE),te(e.SENT_BUFFER_KEY,ce))},s.clearSent=function(k){var ce=ee(e.SENT_BUFFER_KEY);ce=z(k,ce),te(e.SENT_BUFFER_KEY,ce)};function z(k,ce){var P=[];return tt(ce,function(oe){!at(oe)&&Un(k,oe)===-1&&P.push(oe)}),P}function ee(k){var ce=k;try{ce=n.namePrefix&&n.namePrefix()?n.namePrefix()+"_"+ce:ce;var P=Ia(r,ce);if(P){var oe=vr().parse(P);if(et(oe)&&(oe=vr().parse(oe)),oe&&ur(oe))return oe}}catch(se){r.throwInternal(Pe.CRITICAL,we.FailedToRestoreStorageBuffer," storage key: "+ce+", "+_t(se),{exception:it(se)})}return[]}function te(k,ce){var P=k;try{P=n.namePrefix&&n.namePrefix()?n.namePrefix()+"_"+P:P;var oe=JSON.stringify(ce);Ca(r,P,oe)}catch(se){Ca(r,P,JSON.stringify([])),r.throwInternal(Pe.WARNING,we.FailedToSetStorageBuffer," storage key: "+P+", "+_t(se)+". Buffer cleared",{exception:it(se)})}}}),i}return e.BUFFER_KEY="AI_buffer",e.SENT_BUFFER_KEY="AI_sentBuffer",e.MAX_BUFFER_SIZE=2e3,e}(ef);var sc="baseType",zt="baseData",Sr="properties",nf="true";function or(t,e,r){return ht(t,e,r,ga)}function bm(t,e,r){var n=r.tags=r.tags||{},i=e.ext=e.ext||{},a=e.tags=e.tags||[],s=i.user;s&&(or(n,Pt.userAuthUserId,s.authId),or(n,Pt.userId,s.id||s.localId));var v=i.app;v&&or(n,Pt.sessionId,v.sesId);var d=i.device;d&&(or(n,Pt.deviceId,d.id||d.localId),or(n,Pt.deviceType,d.deviceClass),or(n,Pt.deviceIp,d.ip),or(n,Pt.deviceModel,d.model),or(n,Pt.deviceType,d.deviceType));var p=e.ext.web;if(p){or(n,Pt.deviceLanguage,p.browserLang),or(n,Pt.deviceBrowserVersion,p.browserVer),or(n,Pt.deviceBrowser,p.browser);var B=r.data=r.data||{},z=B[zt]=B[zt]||{},ee=z[Sr]=z[Sr]||{};or(ee,"domain",p.domain),or(ee,"isManual",p.isManual?nf:null),or(ee,"screenRes",p.screenRes),or(ee,"userConsent",p.userConsent?nf:null)}var te=i.os;te&&or(n,Pt.deviceOS,te.name);var k=i.trace;k&&(or(n,Pt.operationParentId,k.parentID),or(n,Pt.operationName,Mt(t,k.name)),or(n,Pt.operationId,k.traceID));for(var ce={},P=a.length-1;P>=0;P--){var oe=a[P];Tt(oe,function(xe,Ge){ce[xe]=Ge}),a.splice(P,1)}Tt(a,function(xe,Ge){ce[xe]=Ge});var se=Qt(Qt({},n),ce);se[Pt.internalSdkVersion]||(se[Pt.internalSdkVersion]="javascript:".concat(xm.Version)),r.tags=Ss(se)}function Si(t,e,r){ke(t)||Tt(t,function(n,i){Sa(i)?r[n]=i:et(i)?e[n]=i:An()&&(e[n]=vr().stringify(i))})}function Ki(t,e){ke(t)||Tt(t,function(r,n){t[r]=n||e})}function Wi(t,e,r,n){var i=new Ls(t,n,e);or(i,"sampleRate",r[Ta]),(r[zt]||{}).startTime&&(i.time=Pr(r[zt].startTime)),i.iKey=r.iKey;var a=r.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),bm(t,r,i),r.tags=r.tags||[],Ss(i)}function Yi(t,e){ke(e[zt])&&t.throwInternal(Pe.CRITICAL,we.TelemetryEnvelopeInvalid,"telemetryItem.baseData cannot be null.")}var xm={Version:"2.7.4"};function af(t,e,r){Yi(t,e);var n=e[zt].measurements||{},i=e[zt][Sr]||{};Si(e.data,i,n),ke(r)||Ki(i,r);var a=e[zt];if(ke(a))return t.warnToConsole("Invalid input for dependency data"),null;var s=a[Sr]&&a[Sr][Eo]?a[Sr][Eo]:"GET",v=new tn(t,a.id,a.target,a.name,a.duration,a.success,a.responseCode,s,a.type,a.correlationContext,i,n),d=new qn(tn.dataType,v);return Wi(t,tn.envelopeType,e,d)}function lc(t,e,r){Yi(t,e);var n={},i={};e[sc]!==Jr.dataType&&(n.baseTypeSource=e[sc]),e[sc]===Jr.dataType?(n=e[zt][Sr]||{},i=e[zt].measurements||{}):e[zt]&&Si(e[zt],n,i),Si(e.data,n,i),ke(r)||Ki(n,r);var a=e[zt].name,s=new Jr(t,a,n,i),v=new qn(Jr.dataType,s);return Wi(t,Jr.envelopeType,e,v)}function of(t,e,r){Yi(t,e);var n=e[zt].measurements||{},i=e[zt][Sr]||{};Si(e.data,i,n),ke(r)||Ki(i,r);var a=e[zt],s=xr.CreateFromInterface(t,a,i,n),v=new qn(xr.dataType,s);return Wi(t,xr.envelopeType,e,v)}function sf(t,e,r){Yi(t,e);var n=e[zt],i=n[Sr]||{},a=n.measurements||{};Si(e.data,i,a),ke(r)||Ki(i,r);var s=new en(t,n.name,n.average,n.sampleCount,n.min,n.max,n.stdDev,i,a),v=new qn(en.dataType,s);return Wi(t,en.envelopeType,e,v)}function lf(t,e,r){Yi(t,e);var n="duration",i,a=e[zt];!ke(a)&&!ke(a[Sr])&&!ke(a[Sr][n])?(i=a[Sr][n],delete a[Sr][n]):!ke(e.data)&&!ke(e.data[n])&&(i=e.data[n],delete e.data[n]);var s=e[zt],v;((e.ext||{}).trace||{}).traceID&&(v=e.ext.trace.traceID);var d=s.id||v,p=s.name,B=s.uri,z=s[Sr]||{},ee=s.measurements||{};if(ke(s.refUri)||(z.refUri=s.refUri),ke(s.pageType)||(z.pageType=s.pageType),ke(s.isLoggedIn)||(z.isLoggedIn=s.isLoggedIn.toString()),!ke(s[Sr])){var te=s[Sr];Tt(te,function(P,oe){z[P]=oe})}Si(e.data,z,ee),ke(r)||Ki(z,r);var k=new kr(t,p,B,i,z,ee,d),ce=new qn(kr.dataType,k);return Wi(t,kr.envelopeType,e,ce)}function cf(t,e,r){Yi(t,e);var n=e[zt],i=n.name,a=n.uri||n.url,s=n[Sr]||{},v=n.measurements||{};Si(e.data,s,v),ke(r)||Ki(s,r);var d=new Bn(t,i,a,void 0,s,v,n),p=new qn(Bn.dataType,d);return Wi(t,Bn.envelopeType,e,p)}function uf(t,e,r){Yi(t,e);var n=e[zt].message,i=e[zt].severityLevel,a=e[zt][Sr]||{},s=e[zt].measurements||{};Si(e.data,a,s),ke(r)||Ki(a,r);var v=new Pn(t,n,i,a,s),d=new qn(Pn.dataType,v);return Wi(t,Pn.envelopeType,e,d)}var ff=function(){function t(e){gt(t,this,function(r){r.serialize=function(s){var v=n(s,"root");try{return vr().stringify(v)}catch(d){e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,d&&at(d.toString)?d.toString():"Error serializing object",null,!0)}};function n(s,v){var d="__aiCircularRefCheck",p={};if(!s)return e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,"cannot serialize object because it is null or undefined",{name:v},!0),p;if(s[d])return e.throwInternal(Pe.WARNING,we.CircularReferenceDetected,"Circular reference detected while serializing object",{name:v},!0),p;if(!s.aiDataContract){if(v==="measurements")p=a(s,"number",v);else if(v==="properties")p=a(s,"string",v);else if(v==="tags")p=a(s,"string",v);else if(ur(s))p=i(s,v);else{e.throwInternal(Pe.WARNING,we.CannotSerializeObjectNonSerializable,"Attempting to serialize an object which does not implement ISerializable",{name:v},!0);try{vr().stringify(s),p=s}catch(B){e.throwInternal(Pe.CRITICAL,we.CannotSerializeObject,B&&at(B.toString)?B.toString():"Error serializing object",null,!0)}}return p}return s[d]=!0,Tt(s.aiDataContract,function(B,z){var ee=at(z)?z()&1:z&1,te=at(z)?z()&4:z&4,k=z&2,ce=s[B]!==void 0,P=Rn(s[B])&&s[B]!==null;if(ee&&!ce&&!k)e.throwInternal(Pe.CRITICAL,we.MissingRequiredFieldSpecification,"Missing required field specification. The field is required but not present on source",{field:B,name:v});else if(!te){var oe=void 0;P?k?oe=i(s[B],B):oe=n(s[B],B):oe=s[B],oe!==void 0&&(p[B]=oe)}}),delete s[d],p}function i(s,v){var d;if(s)if(!ur(s))e.throwInternal(Pe.CRITICAL,we.ItemNotInArray,`This field was specified as an array in the contract but the item is not an array.\r
21
+ `,{name:v},!0);else{d=[];for(var p=0;p<s.length;p++){var B=s[p],z=n(B,v+"["+p+"]");d.push(z)}}return d}function a(s,v,d){var p;return s&&(p={},Tt(s,function(B,z){if(v==="string")z===void 0?p[B]="undefined":z===null?p[B]="null":z.toString?p[B]=z.toString():p[B]="invalid field: toString() is not defined.";else if(v==="number")if(z===void 0)p[B]="undefined";else if(z===null)p[B]="null";else{var ee=parseFloat(z);isNaN(ee)?p[B]="NaN":p[B]=ee}else p[B]="invalid field: "+d+" is of unknown type.",e.throwInternal(Pe.CRITICAL,p[B],null,!0)})),p}})}return t}();var ym=function(){function t(){var e=Hn(),r=ir(),n=!1,i=!0;gt(t,this,function(a){try{if(e&&Tn(e,"online",d)&&(Tn(e,"offline",p),n=!0),r){var s=r.body||r;Wt(s.ononline)||(s.ononline=d,s.onoffline=p,n=!0)}if(n){var v=Rr();v&&!ke(v.onLine)&&(i=v.onLine)}}catch{n=!1}a.isListening=n,a.isOnline=function(){var B=!0,z=Rr();return n?B=i:z&&!ke(z.onLine)&&(B=z.onLine),B},a.isOffline=function(){return!a.isOnline()};function d(){i=!0}function p(){i=!1}})}return t.Offline=new t,t}();var cc=ym.Offline;var Em=8,df=function(){function t(){}return t.prototype.getHashCodeScore=function(e){var r=this.getHashCode(e)/t.INT_MAX_VALUE;return r*100},t.prototype.getHashCode=function(e){if(e==="")return 0;for(;e.length<Em;)e=e.concat(e);for(var r=5381,n=0;n<e.length;++n)r=(r<<5)+r+e.charCodeAt(n),r=r&r;return Math.abs(r)},t.INT_MAX_VALUE=2147483647,t}();var vf=function(){function t(){var e=this,r=new df,n=new Da;e.getSamplingScore=function(i){var a=0;return i.tags&&i.tags[n.userId]?a=r.getHashCodeScore(i.tags[n.userId]):i.ext&&i.ext.user&&i.ext.user.id?a=r.getHashCodeScore(i.ext.user.id):i.tags&&i.tags[n.operationId]?a=r.getHashCodeScore(i.tags[n.operationId]):i.ext&&i.ext.telemetryTrace&&i.ext.telemetryTrace.traceID?a=r.getHashCodeScore(i.ext.telemetryTrace.traceID):a=Math.random()*100,a}}return t}();var mf=function(){function t(e,r){this.INT_MAX_VALUE=2147483647;var n=r||$n(null);(e>100||e<0)&&(n.throwInternal(Pe.WARNING,we.SampleRateOutOfRange,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this.sampleRate=e,this.samplingScoreGenerator=new vf}return t.prototype.isSampledIn=function(e){var r=this.sampleRate,n=!1;return r==null||r>=100||e.baseType===en.dataType?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)<r,n)},t}();var ei,wm=65e3;function qs(t){try{return t.responseText}catch{}return null}function pf(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},disableXhr:function(){return!1},onunloadDisableFetch:function(){return!1},onunloadDisableBeacon:function(){return!1},instrumentationKey:function(){},namePrefix:function(){},samplingPercentage:function(){return 100},customHeaders:function(){},convertUndefined:function(){},eventsLimitInMem:function(){return 1e4}}}var Rm=(ei={},ei[Jr.dataType]=lc,ei[Pn.dataType]=uf,ei[kr.dataType]=lf,ei[Bn.dataType]=cf,ei[xr.dataType]=of,ei[en.dataType]=sf,ei[tn.dataType]=af,ei),uc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=Io;var n,i,a,s=!1,v,d,p,B={},z=0,ee,te;return r._senderConfig=pf(),gt(e,r,function(k,ce){function P(){wr("Method not implemented.")}k.pause=function(){gr(),s=!0},k.resume=function(){s&&(s=!1,i=null,k._buffer.size()>k._senderConfig.maxBatchSizeInBytes()&&k.triggerSend(!0,null,10),hr())},k.flush=function(){if(!s){gr();try{k.triggerSend(!0,null,1)}catch(le){k.diagLog().throwInternal(Pe.CRITICAL,we.FlushFailed,"flush failed, telemetry will not be collected: "+_t(le),{exception:it(le)})}}},k.onunloadFlush=function(){if(!s)if((k._senderConfig.onunloadDisableBeacon()===!1||k._senderConfig.isBeaconApiDisabled()===!1)&&Oi())try{k.triggerSend(!0,Ge,2)}catch(le){k.diagLog().throwInternal(Pe.CRITICAL,we.FailedToSendQueuedTelemetry,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+_t(le),{exception:it(le)})}else k.flush()},k.teardown=P,k.addHeader=function(le,Le){B[le]=Le},k.initialize=function(le,Le,$e,ae){ce.initialize(le,Le,$e,ae);var be=k._getTelCtx(),Ie=k.identifier;d=new ff(Le.logger),n=0,i=null,a=0,k._sender=null,p=0;var Ce=k.diagLog(),Be=pf();Tt(Be,function(ot,mt){k._senderConfig[ot]=function(){return be.getConfig(Ie,ot,mt())}}),k._buffer=k._senderConfig.enableSessionStorageBuffer()&&ji()?new rf(Ce,k._senderConfig):new tf(Ce,k._senderConfig),k._sample=new mf(k._senderConfig.samplingPercentage(),Ce),T(le)||Ce.throwInternal(Pe.CRITICAL,we.InvalidInstrumentationKey,"Invalid Instrumentation key "+le.instrumentationKey),!Gi(k._senderConfig.endpointUrl())&&k._senderConfig.customHeaders()&&k._senderConfig.customHeaders().length>0&&tt(k._senderConfig.customHeaders(),function(ot){r.addHeader(ot.header,ot.value)});var Ye=k._senderConfig,Fe=null;!Ye.disableXhr()&&xs()?Fe=Dt:!Ye.disableXhr()&&Li()&&(Fe=st),!Fe&&bs()&&(Fe=Xt),ee=Fe||st,!Ye.isBeaconApiDisabled()&&Oi()&&(Fe=ft),k._sender=Fe||st,!Ye.onunloadDisableFetch()&&bs(!0)?te=yt:Oi()?te=ft:!Ye.disableXhr()&&xs()?te=Dt:!Ye.disableXhr()&&Li()?te=st:te=ee},k.processTelemetry=function(le,Le){Le=k._getTelCtx(Le);try{if(k._senderConfig.disableTelemetry())return;if(!le){Le.diagLog().throwInternal(Pe.CRITICAL,we.CannotSendEmptyTelemetry,"Cannot send empty telemetry");return}if(le.baseData&&!le.baseType){Le.diagLog().throwInternal(Pe.CRITICAL,we.InvalidEvent,"Cannot send telemetry without baseData and baseType");return}if(le.baseType||(le.baseType="EventData"),!k._sender){Le.diagLog().throwInternal(Pe.CRITICAL,we.SenderNotInitialized,"Sender was not initialized");return}if(oe(le))le[Ta]=k._sample.sampleRate;else{Le.diagLog().throwInternal(Pe.WARNING,we.TelemetrySampledAndNotSent,"Telemetry item was sampled out and not sent",{SampleRate:k._sample.sampleRate});return}var $e=k._senderConfig.convertUndefined()||void 0,ae=le.iKey||k._senderConfig.instrumentationKey(),be=e.constructEnvelope(le,ae,Le.diagLog(),$e);if(!be){Le.diagLog().throwInternal(Pe.CRITICAL,we.CreateEnvelopeError,"Unable to create an AppInsights envelope");return}var Ie=!1;if(le.tags&&le.tags[Aa]&&(tt(le.tags[Aa],function(Fe){try{Fe&&Fe(be)===!1&&(Ie=!0,Le.diagLog().warnToConsole("Telemetry processor check returns false"))}catch(ot){Le.diagLog().throwInternal(Pe.CRITICAL,we.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+_t(ot),{exception:it(ot)},!0)}}),delete le.tags[Aa]),Ie)return;var Ce=d.serialize(be),Be=k._buffer,Ye=Be.size();Ye+Ce.length>k._senderConfig.maxBatchSizeInBytes()&&k.triggerSend(!0,null,10),Be.enqueue(Ce),hr()}catch(Fe){Le.diagLog().throwInternal(Pe.WARNING,we.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+_t(Fe),{exception:it(Fe)})}k.processNext(le,Le)},k._xhrReadyStateChange=function(le,Le,$e){le.readyState===4&&se(le.status,Le,le.responseURL,$e,St(le),qs(le)||le.response)},k.triggerSend=function(le,Le,$e){if(le===void 0&&(le=!0),!s)try{var ae=k._buffer;if(k._senderConfig.disableTelemetry())ae.clear();else{if(ae.count()>0){var be=ae.getItems();Qe($e||0,le),Le?Le.call(r,be,le):k._sender(be,le)}a=+new Date}gr()}catch(Ce){var Ie=xa();(!Ie||Ie>9)&&k.diagLog().throwInternal(Pe.CRITICAL,we.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+_t(Ce),{exception:it(Ce)})}},k._onError=function(le,Le,$e){k.diagLog().throwInternal(Pe.WARNING,we.OnError,"Failed to send telemetry.",{message:Le}),k._buffer.clearSent(le)},k._onPartialSuccess=function(le,Le){for(var $e=[],ae=[],be=Le.errors.reverse(),Ie=0,Ce=be;Ie<Ce.length;Ie++){var Be=Ce[Ie],Ye=le.splice(Be.index,1)[0];$t(Be.statusCode)?ae.push(Ye):$e.push(Ye)}le.length>0&&k._onSuccess(le,Le.itemsAccepted),$e.length>0&&k._onError($e,St(null,["partial success",Le.itemsAccepted,"of",Le.itemsReceived].join(" "))),ae.length>0&&(an(ae),k.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,"Partial success. Delivered: "+le.length+", Failed: "+$e.length+". Will retry to send "+ae.length+" our of "+Le.itemsReceived+" items"))},k._onSuccess=function(le,Le){k._buffer.clearSent(le)},k._xdrOnLoad=function(le,Le){var $e=qs(le);if(le&&($e+""=="200"||$e===""))n=0,k._onSuccess(Le,0);else{var ae=sr($e);ae&&ae.itemsReceived&&ae.itemsReceived>ae.itemsAccepted&&!k._senderConfig.isRetryDisabled()?k._onPartialSuccess(Le,ae):k._onError(Le,Nt(le))}};function oe(le){return k._sample.isSampledIn(le)}function se(le,Le,$e,ae,be,Ie){var Ce=null;if(k._appId||(Ce=sr(Ie),Ce&&Ce.appId&&(k._appId=Ce.appId)),(le<200||le>=300)&&le!==0){if((le===301||le===307||le===308)&&!xe($e)){k._onError(Le,be);return}!k._senderConfig.isRetryDisabled()&&$t(le)?(an(Le),k.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Response code "+le+". Will retry to send "+Le.length+" items.")):k._onError(Le,be)}else if(cc.isOffline()){if(!k._senderConfig.isRetryDisabled()){var Be=10;an(Le,Be),k.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Offline - Response Code: ".concat(le,". Offline status: ").concat(cc.isOffline(),". Will retry to send ").concat(Le.length," items."))}}else xe($e),le===206?(Ce||(Ce=sr(Ie)),Ce&&!k._senderConfig.isRetryDisabled()?k._onPartialSuccess(Le,Ce):k._onError(Le,be)):(n=0,k._onSuccess(Le,ae))}function xe(le){return p>=10?!1:!ke(le)&&le!==""&&le!==k._senderConfig.endpointUrl()?(k._senderConfig.endpointUrl=function(){return le},++p,!0):!1}function Ge(le,Le){te?te(le,!1):ft(le,Le)}function lt(le){var Le=Rr(),$e=k._buffer,ae=k._senderConfig.endpointUrl(),be=k._buffer.batchPayloads(le),Ie=new Blob([be],{type:"text/plain;charset=UTF-8"}),Ce=Le.sendBeacon(ae,Ie);return Ce&&($e.markAsSent(le),k._onSuccess(le,le.length)),Ce}function ft(le,Le){if(ur(le)&&le.length>0&&!lt(le)){for(var $e=[],ae=0;ae<le.length;ae++){var be=le[ae];lt([be])||$e.push(be)}$e.length>0&&(ee($e,!0),k.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with normal sender."))}}function st(le,Le){var $e=new XMLHttpRequest,ae=k._senderConfig.endpointUrl();try{$e[Mn]=!0}catch{}$e.open("POST",ae,Le),$e.setRequestHeader("Content-type","application/json"),Gi(ae)&&$e.setRequestHeader(Ct.sdkContextHeader,Ct.sdkContextHeaderAppIdRequest),tt(un(B),function(Ie){$e.setRequestHeader(Ie,B[Ie])}),$e.onreadystatechange=function(){return k._xhrReadyStateChange($e,le,le.length)},$e.onerror=function(Ie){return k._onError(le,St($e),Ie)};var be=k._buffer.batchPayloads(le);$e.send(be),k._buffer.markAsSent(le)}function yt(le,Le){if(ur(le)){for(var $e=le.length,ae=0;ae<le.length;ae++)$e+=le[ae].length;z+$e<=wm?tr(le,!1):Oi()?ft(le,Le):(ee&&ee(le,!0),k.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Failed to send telemetry with Beacon API, retried with xhrSender."))}}function Xt(le,Le){tr(le,!0)}function tr(le,Le){var $e,ae=k._senderConfig.endpointUrl(),be=k._buffer.batchPayloads(le),Ie=new Blob([be],{type:"application/json"}),Ce=new Headers,Be=be.length,Ye=!1,Fe=!1;Gi(ae)&&Ce.append(Ct.sdkContextHeader,Ct.sdkContextHeaderAppIdRequest),tt(un(B),function(Ee){Ce.append(Ee,B[Ee])});var ot=($e={method:"POST",headers:Ce,body:Ie},$e[Mn]=!0,$e);Le||(ot.keepalive=!0,Ye=!0,z+=Be);var mt=new Request(ae,ot);try{mt[Mn]=!0}catch{}k._buffer.markAsSent(le);try{fetch(mt).then(function(Ee){Le||(z-=Be,Be=0),Fe||(Fe=!0,Ee.ok?Ee.text().then(function(br){se(Ee.status,le,Ee.url,le.length,Ee.statusText,br)}):k._onError(le,Ee.statusText))}).catch(function(Ee){Le||(z-=Be,Be=0),Fe||(Fe=!0,k._onError(le,Ee.message))})}catch(Ee){Fe||k._onError(le,it(Ee))}Ye&&!Fe&&(Fe=!0,k._onSuccess(le,le.length))}function sr(le){try{if(le&&le!==""){var Le=vr().parse(le);if(Le&&Le.itemsReceived&&Le.itemsReceived>=Le.itemsAccepted&&Le.itemsReceived-Le.itemsAccepted===Le.errors.length)return Le}}catch($e){k.diagLog().throwInternal(Pe.CRITICAL,we.InvalidBackendResponse,"Cannot parse the response. "+_t($e),{response:le})}return null}function an(le,Le){if(Le===void 0&&(Le=1),!(!le||le.length===0)){var $e=k._buffer;$e.clearSent(le),n++;for(var ae=0,be=le;ae<be.length;ae++){var Ie=be[ae];$e.enqueue(Ie)}Tr(Le),hr()}}function Tr(le){var Le=10,$e;if(n<=1)$e=Le;else{var ae=(Math.pow(2,n)-1)/2,be=Math.floor(Math.random()*ae*Le)+1;be=le*be,$e=Math.max(Math.min(be,3600),Le)}var Ie=fr()+$e*1e3;i=Ie}function hr(){if(!v&&!s){var le=i?Math.max(0,i-fr()):0,Le=Math.max(k._senderConfig.maxBatchInterval(),le);v=setTimeout(function(){v=null,k.triggerSend(!0,null,1)},Le)}}function gr(){clearTimeout(v),v=null,i=null}function $t(le){return le===408||le===429||le===500||le===503}function St(le,Le){return le?"XMLHttpRequest,Status:"+le.status+",Response:"+qs(le)||le.response||"":Le}function Dt(le,Le){var $e=k._buffer,ae=Hn(),be=new XDomainRequest;be.onload=function(){return k._xdrOnLoad(be,le)},be.onerror=function(Ye){return k._onError(le,Nt(be),Ye)};var Ie=ae&&ae.location&&ae.location.protocol||"";if(k._senderConfig.endpointUrl().lastIndexOf(Ie,0)!==0){k.diagLog().throwInternal(Pe.WARNING,we.TransmissionFailed,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),$e.clear();return}var Ce=k._senderConfig.endpointUrl().replace(/^(https?:)/,"");be.open("POST",Ce);var Be=$e.batchPayloads(le);be.send(Be),$e.markAsSent(le)}function Nt(le,Le){return le?"XDomainRequest,Response:"+qs(le)||"":Le}function It(){var le="getNotifyMgr";return k.core[le]?k.core[le]():k.core._notificationManager}function Qe(le,Le){var $e=It();if($e&&$e.eventsSendRequest)try{$e.eventsSendRequest(le,Le)}catch(ae){k.diagLog().throwInternal(Pe.CRITICAL,we.NotificationException,"send request notification failed: "+_t(ae),{exception:it(ae)})}}function T(le){var Le=ke(le.disableInstrumentationKeyValidation)?!1:le.disableInstrumentationKeyValidation;if(Le)return!0;var $e="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",ae=new RegExp($e);return ae.test(le.instrumentationKey)}}),r}return e.constructEnvelope=function(r,n,i,a){var s;n!==r.iKey&&!ke(n)?s=Qt(Qt({},r),{iKey:n}):s=r;var v=Rm[s.baseType]||lc;return v(i,s,a)},e}(In);var Tm="ai_session",fc=function(){function t(){}return t}();var hf=function(){function t(e,r){var n=this,i,a,s=$n(r),v=Ui(r);gt(t,n,function(d){e||(e={}),at(e.sessionExpirationMs)||(e.sessionExpirationMs=function(){return t.acquisitionSpan}),at(e.sessionRenewalMs)||(e.sessionRenewalMs=function(){return t.renewalSpan}),d.config=e;var p=d.config.sessionCookiePostfix&&d.config.sessionCookiePostfix()?d.config.sessionCookiePostfix():d.config.namePrefix&&d.config.namePrefix()?d.config.namePrefix():"";i=function(){return Tm+p},d.automaticSession=new fc,d.update=function(){var ce=fr(),P=!1,oe=d.automaticSession;oe.id||(P=!B(oe,ce));var se=d.config.sessionExpirationMs();if(!P&&se>0){var xe=d.config.sessionRenewalMs(),Ge=ce-oe.acquisitionDate,lt=ce-oe.renewalDate;P=Ge<0||lt<0,P=P||Ge>se,P=P||lt>xe}P?ee(ce):(!a||ce-a>t.cookieUpdateInterval)&&te(oe,ce)},d.backup=function(){var ce=d.automaticSession;k(ce.id,ce.acquisitionDate,ce.renewalDate)};function B(ce,P){var oe=!1,se=v.get(i());if(se&&at(se.split))oe=z(ce,se);else{var xe=jl(s,i());xe&&(oe=z(ce,xe))}return oe||!!ce.id}function z(ce,P){var oe=!1,se=", session will be reset",xe=P.split("|");if(xe.length>=2)try{var Ge=+xe[1]||0,lt=+xe[2]||0;isNaN(Ge)||Ge<=0?s.throwInternal(Pe.WARNING,we.SessionRenewalDateIsZero,"AI session acquisition date is 0"+se):isNaN(lt)||lt<=0?s.throwInternal(Pe.WARNING,we.SessionRenewalDateIsZero,"AI session renewal date is 0"+se):xe[0]&&(ce.id=xe[0],ce.acquisitionDate=Ge,ce.renewalDate=lt,oe=!0)}catch(ft){s.throwInternal(Pe.CRITICAL,we.ErrorParsingAISessionCookie,"Error parsing ai_session value ["+(P||"")+"]"+se+" - "+_t(ft),{exception:it(ft)})}return oe}function ee(ce){var P=d.config||{},oe=(P.getNewId?P.getNewId():null)||Ra;d.automaticSession.id=oe(P.idLength?P.idLength():22),d.automaticSession.acquisitionDate=ce,te(d.automaticSession,ce),Ns()||s.throwInternal(Pe.WARNING,we.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")}function te(ce,P){var oe=ce.acquisitionDate;ce.renewalDate=P;var se=d.config,xe=se.sessionRenewalMs(),Ge=oe+se.sessionExpirationMs()-P,lt=[ce.id,oe,P],ft=0;Ge<xe?ft=Ge/1e3:ft=xe/1e3;var st=se.cookieDomain?se.cookieDomain():null;v.set(i(),lt.join("|"),se.sessionExpirationMs()>0?ft:null,st),a=P}function k(ce,P,oe){Gl(s,i(),[ce,P,oe].join("|"))}})}return t.acquisitionSpan=864e5,t.renewalSpan=18e5,t.cookieUpdateInterval=6e4,t}();var _f=function(){function t(){}return t}();var Sf=function(){function t(){this.id="browser",this.deviceClass="Browser"}return t}();var Am="2.7.4",gf=function(){function t(e){this.sdkVersion=(e.sdkExtension&&e.sdkExtension()?e.sdkExtension()+"_":"")+"javascript:"+Am}return t}();function bf(t){return!(typeof t!="string"||!t||t.match(/,|;|=| |\|/))}var xf=function(){function t(e,r){this.isNewUser=!1,this.isUserCookieSet=!1;var n=$n(r),i=Ui(r),a;gt(t,this,function(s){s.config=e;var v=s.config.userCookiePostfix&&s.config.userCookiePostfix()?s.config.userCookiePostfix():"";a=function(){return t.userCookieName+v};var d=i.get(a());if(d){s.isNewUser=!1;var p=d.split(t.cookieSeparator);p.length>0&&(s.id=p[0],s.isUserCookieSet=!!s.id)}function B(){var oe=e||{},se=(oe.getNewId?oe.getNewId():null)||Ra,xe=se(oe.idLength?e.idLength():22);return xe}function z(oe){var se=Pr(new Date);s.accountAcquisitionDate=se,s.isNewUser=!0;var xe=[oe,se];return xe}function ee(oe){var se=31536e3;s.isUserCookieSet=i.set(a(),oe,se)}if(!s.id){s.id=B();var te=z(s.id);ee(te.join(t.cookieSeparator));var k=e.namePrefix&&e.namePrefix()?e.namePrefix()+"ai_session":"ai_session";Xl(n,k)}s.accountId=e.accountId?e.accountId():void 0;var ce=i.get(t.authUserCookieName);if(ce){ce=decodeURI(ce);var P=ce.split(t.cookieSeparator);P[0]&&(s.authenticatedId=P[0]),P.length>1&&P[1]&&(s.accountId=P[1])}s.setAuthenticatedUserContext=function(oe,se,xe){xe===void 0&&(xe=!1);var Ge=!bf(oe)||se&&!bf(se);if(Ge){n.throwInternal(Pe.WARNING,we.SetAuthContextFailedAccountName,"Setting auth user context failed. User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",!0);return}s.authenticatedId=oe;var lt=s.authenticatedId;se&&(s.accountId=se,lt=[s.authenticatedId,s.accountId].join(t.cookieSeparator)),xe&&i.set(t.authUserCookieName,encodeURI(lt))},s.clearAuthenticatedUserContext=function(){s.authenticatedId=null,s.accountId=null,i.del(t.authUserCookieName)},s.update=function(oe){if(s.id!==oe||!s.isUserCookieSet){var se=oe||B(),xe=z(se);ee(xe.join(t.cookieSeparator))}}})}return t.cookieSeparator="|",t.userCookieName="ai_user",t.authUserCookieName="ai_authUser",t}();var yf=function(){function t(){}return t}();var Ef=function(){function t(e,r,n,i){var a=this;a.traceID=e||zr(),a.parentID=r,a.name=n;var s=$r();!n&&s&&s.pathname&&(a.name=s.pathname),a.name=Mt(i,a.name)}return t}();var zs="ext",js="tags";function Oa(t,e){t&&t[e]&&un(t[e]).length===0&&delete t[e]}var wf=function(){function t(e,r){var n=this,i=e.logger;this.appId=function(){return null},this.getSessionId=function(){return null},gt(t,this,function(a){a.application=new _f,a.internal=new gf(r),ki()&&(a.sessionManager=new hf(r,e),a.device=new Sf,a.location=new yf,a.user=new xf(r,e),a.telemetryTrace=new Ef(void 0,void 0,void 0,i),a.session=new fc),a.getSessionId=function(){var s=a.session,v=null;if(s&&et(s.id))v=s.id;else{var d=(a.sessionManager||{}).automaticSession;v=d&&et(d.id)?d.id:null}return v},a.applySessionContext=function(s,v){ht(dr(s.ext,Dr.AppExt),"sesId",a.getSessionId(),et)},a.applyOperatingSystemContxt=function(s,v){ht(s.ext,Dr.OSExt,a.os)},a.applyApplicationContext=function(s,v){var d=a.application;if(d){var p=dr(s,js);ht(p,Pt.applicationVersion,d.ver,et),ht(p,Pt.applicationBuild,d.build,et)}},a.applyDeviceContext=function(s,v){var d=a.device;if(d){var p=dr(dr(s,zs),Dr.DeviceExt);ht(p,"localId",d.id,et),ht(p,"ip",d.ip,et),ht(p,"model",d.model,et),ht(p,"deviceClass",d.deviceClass,et)}},a.applyInternalContext=function(s,v){var d=a.internal;if(d){var p=dr(s,js);ht(p,Pt.internalAgentVersion,d.agentVersion,et),ht(p,Pt.internalSdkVersion,d.sdkVersion,et),(s.baseType===Yn.dataType||s.baseType===kr.dataType)&&(ht(p,Pt.internalSnippet,d.snippetVer,et),ht(p,Pt.internalSdkSrc,d.sdkSrc,et))}},a.applyLocationContext=function(s,v){var d=n.location;d&&ht(dr(s,js,[]),Pt.locationIp,d.ip,et)},a.applyOperationContext=function(s,v){var d=a.telemetryTrace;if(d){var p=dr(dr(s,zs),Dr.TraceExt,{traceID:void 0,parentID:void 0});ht(p,"traceID",d.traceID,et),ht(p,"name",d.name,et),ht(p,"parentID",d.parentID,et)}},a.applyWebContext=function(s,v){var d=n.web;d&&ht(dr(s,zs),Dr.WebExt,d)},a.applyUserContext=function(s,v){var d=a.user;if(d){var p=dr(s,js,[]);ht(p,Pt.userAccountId,d.accountId,et);var B=dr(dr(s,zs),Dr.UserExt);ht(B,"id",d.id,et),ht(B,"authId",d.authenticatedId,et)}},a.cleanUp=function(s,v){var d=s.ext;d&&(Oa(d,Dr.DeviceExt),Oa(d,Dr.UserExt),Oa(d,Dr.WebExt),Oa(d,Dr.OSExt),Oa(d,Dr.AppExt),Oa(d,Dr.TraceExt))}})}return t}();var Im=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.priority=110,r.identifier=_i;var n,i;return gt(e,r,function(a,s){a.initialize=function(d,p,B,z){s.initialize(d,p,B,z);var ee=a._getTelCtx(),te=a.identifier,k=e.getDefaultConfig();i=i||{},Tt(k,function(ce,P){i[ce]=function(){return ee.getConfig(te,ce,P())}}),a.context=new wf(p,i),n=Ul(B,Io),a.context.appId=function(){return n?n._appId:null},a._extConfig=i},a.processTelemetry=function(d,p){if(!ke(d)){p=a._getTelCtx(p),d.name===kr.envelopeType&&p.diagLog().resetInternalMessageCount();var B=a.context||{};B.session&&typeof a.context.session.id!="string"&&B.sessionManager&&B.sessionManager.update();var z=B.user;if(z&&!z.isUserCookieSet&&z.update(B.user.id),v(d,p),z&&z.isNewUser){z.isNewUser=!1;var ee=new Yn(we.SendBrowserInfoOnUserInit,(Rr()||{}).userAgent||"");p.diagLog().logInternalMessage(Pe.CRITICAL,ee)}a.processNext(d,p)}};function v(d,p){dr(d,"tags",[]),dr(d,"ext",{});var B=a.context;B.applySessionContext(d,p),B.applyApplicationContext(d,p),B.applyDeviceContext(d,p),B.applyOperationContext(d,p),B.applyUserContext(d,p),B.applyOperatingSystemContxt(d,p),B.applyWebContext(d,p),B.applyLocationContext(d,p),B.applyInternalContext(d,p),B.cleanUp(d,p)}}),r}return e.getDefaultConfig=function(){var r={instrumentationKey:function(){},accountId:function(){return null},sessionRenewalMs:function(){return 18e5},samplingPercentage:function(){return 100},sessionExpirationMs:function(){return 864e5},cookieDomain:function(){return null},sdkExtension:function(){return null},isBrowserLinkTrackingEnabled:function(){return!1},appId:function(){return null},getSessionId:function(){return null},namePrefix:function(){},sessionCookiePostfix:function(){},userCookiePostfix:function(){},idLength:function(){return 22},getNewId:function(){return null}};return r},e}(In),dc=Im;var rn="properties";function Rf(t,e,r){var n=0,i=t[e],a=t[r];return i&&a&&(n=mr(i,a)),n}function $i(t,e,r,n,i){var a=0,s=Rf(r,n,i);return s&&(a=gi(t,e,Qr(s))),a}function gi(t,e,r){var n="ajaxPerf",i=0;if(t&&e&&r){var a=t[n]=t[n]||{};a[e]=r,i=1}return i}function Cm(t,e){var r=t.perfTiming,n=e[rn]||{},i=0,a="name",s="Start",v="End",d="domainLookup",p="connect",B="redirect",z="request",ee="response",te="duration",k="startTime",ce=d+s,P=d+v,oe=p+s,se=p+v,xe=z+s,Ge=z+v,lt=ee+s,ft=ee+v,st=B+s,yt=B=v,Xt="transferSize",tr="encodedBodySize",sr="decodedBodySize",an="serverTiming";if(r){i|=$i(n,B,r,st,yt),i|=$i(n,d,r,ce,P),i|=$i(n,p,r,oe,se),i|=$i(n,z,r,xe,Ge),i|=$i(n,ee,r,lt,ft),i|=$i(n,"networkConnect",r,k,se),i|=$i(n,"sentRequest",r,xe,ft);var Tr=r[te];Tr||(Tr=Rf(r,k,ft)||0),i|=gi(n,te,Tr),i|=gi(n,"perfTotal",Tr);var hr=r[an];if(hr){var gr={};tt(hr,function($t,St){var Dt=J0($t[a]||""+St),Nt=gr[Dt]||{};Tt($t,function(It,Qe){(It!==a&&et(Qe)||Sa(Qe))&&(Nt[It]&&(Qe=Nt[It]+";"+Qe),(Qe||!et(Qe))&&(Nt[It]=Qe))}),gr[Dt]=Nt}),i|=gi(n,an,gr)}i|=gi(n,Xt,r[Xt]),i|=gi(n,tr,r[tr]),i|=gi(n,sr,r[sr])}else t.perfMark&&(i|=gi(n,"missing",t.perfAttempts));i&&(e[rn]=n)}var Mm=function(){function t(){var e=this;e.openDone=!1,e.setRequestHeaderDone=!1,e.sendDone=!1,e.abortDone=!1,e.stateChangeAttached=!1}return t}();var vc=function(){function t(e,r,n){var i=this,a=n,s="responseText";i.perfMark=null,i.completed=!1,i.requestHeadersSize=null,i.requestHeaders=null,i.responseReceivingDuration=null,i.callbackDuration=null,i.ajaxTotalDuration=null,i.aborted=0,i.pageUrl=null,i.requestUrl=null,i.requestSize=0,i.method=null,i.status=null,i.requestSentTime=null,i.responseStartedTime=null,i.responseFinishedTime=null,i.callbackFinishedTime=null,i.endTime=null,i.xhrMonitoringState=new Mm,i.clientFailure=0,i.traceID=e,i.spanID=r,gt(t,i,function(v){v.getAbsoluteUrl=function(){return v.requestUrl?ks(v.requestUrl):null},v.getPathName=function(){return v.requestUrl?Qn(a,Ds(v.method,v.requestUrl)):null},v.CreateTrackItem=function(d,p,B){var z;if(v.ajaxTotalDuration=Math.round(mr(v.requestSentTime,v.responseFinishedTime)*1e3)/1e3,v.ajaxTotalDuration<0)return null;var ee=(z={id:"|"+v.traceID+"."+v.spanID,target:v.getAbsoluteUrl(),name:v.getPathName(),type:d,startTime:null,duration:v.ajaxTotalDuration,success:+v.status>=200&&+v.status<400,responseCode:+v.status,method:v.method},z[rn]={HttpMethod:v.method},z);if(v.requestSentTime&&(ee.startTime=new Date,ee.startTime.setTime(v.requestSentTime)),Cm(v,ee),p&&un(v.requestHeaders).length>0&&(ee[rn]=ee[rn]||{},ee[rn].requestHeaders=v.requestHeaders),B){var te=B();if(te){var k=te.correlationContext;if(k&&(ee.correlationContext=k),te.headerMap&&un(te.headerMap).length>0&&(ee[rn]=ee[rn]||{},ee[rn].responseHeaders=te.headerMap),v.errorStatusText&&v.status>=400){var ce=te.type;ee[rn]=ee[rn]||{},(ce===""||ce==="text")&&(ee[rn][s]=te[s]?te.statusText+" - "+te[s]:te.statusText),ce==="json"&&(ee[rn][s]=te.response?te.statusText+" - "+JSON.stringify(te.response):te.statusText)}}}return ee}})}return t}();var mc=function(){function t(e,r){var n=this;n.traceFlag=t.DEFAULT_TRACE_FLAG,n.version=t.DEFAULT_VERSION,e&&t.isValidTraceId(e)?n.traceId=e:n.traceId=zr(),r&&t.isValidSpanId(r)?n.spanId=r:n.spanId=zr().substr(0,16)}return t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.prototype.toString=function(){var e=this;return"".concat(e.version,"-").concat(e.traceId,"-").concat(e.spanId,"-").concat(e.traceFlag)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t}();var Tf="ai.ajxmn.",Po="diagLog",nn="ajaxData",If="throwInternal",Bo="fetch",Af=0;function Pm(){var t=cn();return!t||ke(t.Request)||ke(t.Request[Gt])||ke(t[Bo])?null:t[Bo]}function Bm(t){var e=!1;if(Li()){var r=XMLHttpRequest[Gt];e=!ke(r)&&!ke(r.open)&&!ke(r.send)&&!ke(r.abort)}var n=xa();if(n&&n<9&&(e=!1),e)try{var i=new XMLHttpRequest;i[nn]={};var a=XMLHttpRequest[Gt].open;XMLHttpRequest[Gt].open=a}catch(s){e=!1,No(t,we.FailedMonitorAjaxOpen,"Failed to enable XMLHttpRequest monitoring, extension is not supported",{exception:it(s)})}return e}function Gs(t){var e="";try{!ke(t)&&!ke(t[nn])&&!ke(t[nn].requestUrl)&&(e+="(url: '"+t[nn].requestUrl+"')")}catch{}return e}function No(t,e,r,n,i){t[Po]()[If](Pe.CRITICAL,e,r,n,i)}function La(t,e,r,n,i){t[Po]()[If](Pe.WARNING,e,r,n,i)}function Mo(t,e,r){return function(n){No(t,e,r,{ajaxDiagnosticsMessage:Gs(n.inst),exception:it(n.err)})}}function Fa(t,e){return t&&e?t.indexOf(e):-1}var pc=function(t){ut(e,t);function e(){var r=t.call(this)||this;r.identifier=e.identifier,r.priority=120;var n="trackDependencyDataInternal",i=$r(),a=!1,s=!1,v=i&&i.host&&i.host.toLowerCase(),d=e.getEmptyConfig(),p=!1,B=!1,z=0,ee,te,k,ce,P=!1,oe=0,se=!1,xe=[],Ge={},lt,ft;return gt(e,r,function(st,yt){st.initialize=function(ae,be,Ie,Ce){if(!st.isInitialized()){yt.initialize(ae,be,Ie,Ce);var Be=st._getTelCtx(),Ye=e.getDefaultConfig();Tt(Ye,function(br,Ar){d[br]=Be.getConfig(e.identifier,br,Ar)});var Fe=d.distributedTracingMode;if(p=d.enableRequestHeaderTracking,B=d.enableAjaxErrorStatusText,P=d.enableAjaxPerfTracking,oe=d.maxAjaxCallsPerView,se=d.enableResponseHeaderTracking,lt=d.excludeRequestFromAutoTrackingPatterns,ft=d.addRequestContext,k=Fe===dn.AI||Fe===dn.AI_AND_W3C,te=Fe===dn.AI_AND_W3C||Fe===dn.W3C,P){var ot=ae.instrumentationKey||"unkwn";ot.length>5?ce=Tf+ot.substring(ot.length-5)+".":ce=Tf+ot+"."}if(d.disableAjaxTracking===!1&&an(),tr(),Ie.length>0&&Ie){for(var mt=void 0,Ee=0;!mt&&Ee<Ie.length;)Ie[Ee]&&Ie[Ee].identifier===_i&&(mt=Ie[Ee]),Ee++;mt&&(ee=mt.context)}}},st.teardown=function(){tt(xe,function(ae){ae.rm()}),xe=[],a=!1,s=!1,st.setInitialized(!1)},st.trackDependencyData=function(ae,be){st[n](ae,be)},st.includeCorrelationHeaders=function(ae,be,Ie,Ce){var Be=st._currentWindowHost||v;if(be){if(Jn.canIncludeCorrelationHeader(d,ae.getAbsoluteUrl(),Be)){if(Ie||(Ie={}),Ie.headers=new Headers(Ie.headers||(be instanceof Request?be.headers||{}:{})),k){var Ye="|"+ae.traceID+"."+ae.spanID;Ie.headers.set(Ct.requestIdHeader,Ye),p&&(ae.requestHeaders[Ct.requestIdHeader]=Ye)}var Fe=d.appId||ee&&ee.appId();if(Fe&&(Ie.headers.set(Ct.requestContextHeader,Ct.requestContextAppIdFormat+Fe),p&&(ae.requestHeaders[Ct.requestContextHeader]=Ct.requestContextAppIdFormat+Fe)),te){var ot=new mc(ae.traceID,ae.spanID);Ie.headers.set(Ct.traceParentHeader,ot.toString()),p&&(ae.requestHeaders[Ct.traceParentHeader]=ot.toString())}}return Ie}else if(Ce){if(Jn.canIncludeCorrelationHeader(d,ae.getAbsoluteUrl(),Be)){if(k){var Ye="|"+ae.traceID+"."+ae.spanID;Ce.setRequestHeader(Ct.requestIdHeader,Ye),p&&(ae.requestHeaders[Ct.requestIdHeader]=Ye)}var Fe=d.appId||ee&&ee.appId();if(Fe&&(Ce.setRequestHeader(Ct.requestContextHeader,Ct.requestContextAppIdFormat+Fe),p&&(ae.requestHeaders[Ct.requestContextHeader]=Ct.requestContextAppIdFormat+Fe)),te){var ot=new mc(ae.traceID,ae.spanID);Ce.setRequestHeader(Ct.traceParentHeader,ot.toString()),p&&(ae.requestHeaders[Ct.traceParentHeader]=ot.toString())}}return Ce}},st[n]=function(ae,be,Ie){if(oe===-1||z<oe){(d.distributedTracingMode===dn.W3C||d.distributedTracingMode===dn.AI_AND_W3C)&&typeof ae.id=="string"&&ae.id[ae.id.length-1]!=="."&&(ae.id+="."),ke(ae.startTime)&&(ae.startTime=new Date);var Ce=mn.create(ae,tn.dataType,tn.envelopeType,st[Po](),be,Ie);st.core.track(Ce)}else z===oe&&No(st,we.MaxAjaxPerPVExceeded,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++z};function Xt(ae){var be=!0;return(ae||d.ignoreHeaders)&&tt(d.ignoreHeaders,function(Ie){if(Ie.toLowerCase()===ae.toLowerCase())return be=!1,-1}),be}function tr(){var ae=Pm();if(!!ae){var be=cn(),Ie=ae.polyfill;d.disableFetchTracking===!1?(xe.push(xo(be,Bo,{req:function(Ce,Be,Ye){var Fe;if(a&&!Tr(null,Be,Ye)&&!(Ie&&s)){var ot=Ce.ctx();Fe=T(Be,Ye);var mt=st.includeCorrelationHeaders(Fe,Be,Ye);mt!==Ye&&Ce.set(1,mt),ot.data=Fe}},rsp:function(Ce,Be){var Ye=Ce.ctx().data;Ye&&(Ce.rslt=Ce.rslt.then(function(Fe){return Le(Ce,(Fe||{}).status,Be,Fe,Ye,function(){var ot={statusText:Fe.statusText,headerMap:null,correlationContext:$e(Fe)};if(se){var mt={};Fe.headers.forEach(function(Ee,br){Xt(br)&&(mt[br]=Ee)}),ot.headerMap=mt}return ot}),Fe}).catch(function(Fe){throw Le(Ce,0,Be,null,Ye,null,{error:Fe.message}),Fe}))},hkErr:Mo(st,we.FailedMonitorAjaxOpen,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")})),a=!0):Ie&&xe.push(xo(be,Bo,{req:function(Ce,Be,Ye){Tr(null,Be,Ye)}})),Ie&&(be[Bo].polyfill=Ie)}}function sr(ae,be,Ie){xe.push(kl(ae,be,Ie))}function an(){Bm(st)&&!s&&(sr(XMLHttpRequest,"open",{req:function(ae,be,Ie,Ce){var Be=ae.inst,Ye=Be[nn];!Tr(Be,Ie)&&hr(Be,!0)&&((!Ye||!Ye.xhrMonitoringState.openDone)&&gr(Be,be,Ie,Ce),$t(Be))},hkErr:Mo(st,we.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")}),sr(XMLHttpRequest,"send",{req:function(ae,be){var Ie=ae.inst,Ce=Ie[nn];hr(Ie)&&!Ce.xhrMonitoringState.sendDone&&(It("xhr",Ce),Ce.requestSentTime=Ma(),st.includeCorrelationHeaders(Ce,void 0,void 0,Ie),Ce.xhrMonitoringState.sendDone=!0)},hkErr:Mo(st,we.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")}),sr(XMLHttpRequest,"abort",{req:function(ae){var be=ae.inst,Ie=be[nn];hr(be)&&!Ie.xhrMonitoringState.abortDone&&(Ie.aborted=1,Ie.xhrMonitoringState.abortDone=!0)},hkErr:Mo(st,we.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")}),p&&sr(XMLHttpRequest,"setRequestHeader",{req:function(ae,be,Ie){var Ce=ae.inst;hr(Ce)&&Xt(be)&&(Ce[nn].requestHeaders[be]=Ie)},hkErr:Mo(st,we.FailedMonitorAjaxSetRequestHeader,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")}),s=!0)}function Tr(ae,be,Ie){var Ce=!1,Be=((et(be)?be:(be||{}).url||"")||"").toLowerCase();if(tt(lt,function(ot){var mt=ot;et(ot)&&(mt=new RegExp(ot)),Ce||(Ce=mt.test(Be))}),Ce)return Ce;var Ye=Fa(Be,"?"),Fe=Fa(Be,"#");return(Ye===-1||Fe!==-1&&Fe<Ye)&&(Ye=Fe),Ye!==-1&&(Be=Be.substring(0,Ye)),ke(ae)?ke(be)||(Ce=(typeof be=="object"?be[Mn]===!0:!1)||(Ie?Ie[Mn]===!0:!1)):Ce=ae[Mn]===!0||Be[Mn]===!0,!Ce&&Be&&Gi(Be)&&(Ce=!0),Ce?Ge[Be]||(Ge[Be]=1):Ge[Be]&&(Ce=!0),Ce}function hr(ae,be){var Ie=!0,Ce=s;return ke(ae)||(Ie=be===!0||!ke(ae[nn])),Ce&&Ie}function gr(ae,be,Ie,Ce){var Be=ee&&ee.telemetryTrace&&ee.telemetryTrace.traceID||zr(),Ye=zr().substr(0,16),Fe=new vc(Be,Ye,st[Po]());Fe.method=be,Fe.requestUrl=Ie,Fe.xhrMonitoringState.openDone=!0,Fe.requestHeaders={},Fe.async=Ce,Fe.errorStatusText=B,ae[nn]=Fe}function $t(ae){ae[nn].xhrMonitoringState.stateChangeAttached=Tn(ae,"readystatechange",function(){try{ae&&ae.readyState===4&&hr(ae)&&Dt(ae)}catch(Ie){var be=it(Ie);(!be||Fa(be.toLowerCase(),"c00c023f")===-1)&&No(st,we.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:Gs(ae),exception:be})}})}function St(ae){try{var be=ae.responseType;if(be===""||be==="text")return ae.responseText}catch{}return null}function Dt(ae){var be=ae[nn];be.responseFinishedTime=Ma(),be.status=ae.status;function Ie(Ce,Be){var Ye=Be||{};Ye.ajaxDiagnosticsMessage=Gs(ae),Ce&&(Ye.exception=it(Ce)),La(st,we.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",Ye)}Qe("xmlhttprequest",be,function(){try{var Ce=be.CreateTrackItem("Ajax",p,function(){var Ye={statusText:ae.statusText,headerMap:null,correlationContext:Nt(ae),type:ae.responseType,responseText:St(ae),response:ae.response};if(se){var Fe=ae.getAllResponseHeaders();if(Fe){var ot=Jt(Fe).split(/[\r\n]+/),mt={};tt(ot,function(Ee){var br=Ee.split(": "),Ar=br.shift(),yr=br.join(": ");Xt(Ar)&&(mt[Ar]=yr)}),Ye.headerMap=mt}}return Ye}),Be=void 0;try{ft&&(Be=ft({status:ae.status,xhr:ae}))}catch{La(st,we.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}Ce?(Be!==void 0&&(Ce.properties=Qt(Qt({},Ce.properties),Be)),st[n](Ce)):Ie(null,{requestSentTime:be.requestSentTime,responseFinishedTime:be.responseFinishedTime})}finally{try{ae[nn]=null}catch{}}},function(Ce){Ie(Ce,null)})}function Nt(ae){try{var be=ae.getAllResponseHeaders();if(be!==null){var Ie=Fa(be.toLowerCase(),Ct.requestContextHeaderLowerCase);if(Ie!==-1){var Ce=ae.getResponseHeader(Ct.requestContextHeader);return Jn.getCorrelationContext(Ce)}}}catch(Be){La(st,we.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:Gs(ae),exception:it(Be)})}}function It(ae,be){if(be.requestUrl&&ce&&P){var Ie=Zr();if(Ie&&at(Ie.mark)){Af++;var Ce=ce+ae+"#"+Af;Ie.mark(Ce);var Be=Ie.getEntriesByName(Ce);Be&&Be.length===1&&(be.perfMark=Be[0])}}}function Qe(ae,be,Ie,Ce){var Be=be.perfMark,Ye=Zr(),Fe=d.maxAjaxPerfLookupAttempts,ot=d.ajaxPerfLookupDelay,mt=be.requestUrl,Ee=0;(function br(){try{if(Ye&&Be){Ee++;for(var Ar=null,yr=Ye.getEntries(),ea=yr.length-1;ea>=0;ea--){var pn=yr[ea];if(pn){if(pn.entryType==="resource")pn.initiatorType===ae&&(Fa(pn.name,mt)!==-1||Fa(mt,pn.name)!==-1)&&(Ar=pn);else if(pn.entryType==="mark"&&pn.name===Be.name){be.perfTiming=Ar;break}if(pn.startTime<Be.startTime-1e3)break}}}!Be||be.perfTiming||Ee>=Fe||be.async===!1?(Be&&at(Ye.clearMarks)&&Ye.clearMarks(Be.name),be.perfAttempts=Ee,Ie()):setTimeout(br,ot)}catch(a0){Ce(a0)}})()}function T(ae,be){var Ie=ee&&ee.telemetryTrace&&ee.telemetryTrace.traceID||zr(),Ce=zr().substr(0,16),Be=new vc(Ie,Ce,st[Po]());Be.requestSentTime=Ma(),Be.errorStatusText=B,ae instanceof Request?Be.requestUrl=ae?ae.url:"":Be.requestUrl=ae;var Ye="GET";be&&be.method?Ye=be.method:ae&&ae instanceof Request&&(Ye=ae.method),Be.method=Ye;var Fe={};if(p){var ot=new Headers((be?be.headers:0)||(ae instanceof Request?ae.headers||{}:{}));ot.forEach(function(mt,Ee){Xt(Ee)&&(Fe[Ee]=mt)})}return Be.requestHeaders=Fe,It("fetch",Be),Be}function le(ae){var be="";try{ke(ae)||(typeof ae=="string"?be+="(url: '".concat(ae,"')"):be+="(url: '".concat(ae.url,"')"))}catch(Ie){No(st,we.FailedMonitorAjaxOpen,"Failed to grab failed fetch diagnostics message",{exception:it(Ie)})}return be}function Le(ae,be,Ie,Ce,Be,Ye,Fe){if(!Be)return;function ot(mt,Ee,br){var Ar=br||{};Ar.fetchDiagnosticsMessage=le(Ie),Ee&&(Ar.exception=it(Ee)),La(st,mt,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",Ar)}Be.responseFinishedTime=Ma(),Be.status=be,Qe("fetch",Be,function(){var mt=Be.CreateTrackItem("Fetch",p,Ye),Ee;try{ft&&(Ee=ft({status:be,request:Ie,response:Ce}))}catch{La(st,we.FailedAddingCustomDefinedRequestContext,"Failed to add custom defined request context as configured call back may missing a null check.")}mt?(Ee!==void 0&&(mt.properties=Qt(Qt({},mt.properties),Ee)),st[n](mt)):ot(we.FailedMonitorAjaxDur,null,{requestSentTime:Be.requestSentTime,responseFinishedTime:Be.responseFinishedTime})},function(mt){ot(we.FailedMonitorAjaxGetCorrelationHeader,mt,null)})}function $e(ae){if(ae&&ae.headers)try{var be=ae.headers.get(Ct.requestContextHeader);return Jn.getCorrelationContext(be)}catch(Ie){La(st,we.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:le(ae),exception:it(Ie)})}}}),r}return e.getDefaultConfig=function(){var r={maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,excludeRequestFromAutoTrackingPatterns:void 0,disableCorrelationHeaders:!1,distributedTracingMode:dn.AI_AND_W3C,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:void 0,correlationHeaderExcludePatterns:void 0,appId:void 0,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1,enableAjaxErrorStatusText:!1,enableAjaxPerfTracking:!1,maxAjaxPerfLookupAttempts:3,ajaxPerfLookupDelay:25,ignoreHeaders:["Authorization","X-API-Key","WWW-Authenticate"],addRequestContext:void 0};return r},e.getEmptyConfig=function(){var r=this.getDefaultConfig();return Tt(r,function(n){r[n]=void 0}),r},e.prototype.processTelemetry=function(r,n){this.processNext(r,n)},e.identifier="AjaxDependencyPlugin",e}(In);var hc,Cf=["snippet","dependencies","properties","_snippetVersion","appInsightsNew","getSKUDefaults"];var _c=function(){function t(e){var r=this;r._snippetVersion=""+(e.sv||e.version||""),e.queue=e.queue||[],e.version=e.version||2;var n=e.config||{};if(n.connectionString){var i=Yl(n.connectionString),a=i.ingestionendpoint;n.endpointUrl=a?"".concat(a,"/v2/track"):n.endpointUrl,n.instrumentationKey=i.instrumentationkey||n.instrumentationKey}r.appInsights=new oc,r.properties=new dc,r.dependencies=new pc,r.core=new Cl,r._sender=new uc,r.snippet=e,r.config=n,r.getSKUDefaults()}return t.prototype.getCookieMgr=function(){return this.appInsights.getCookieMgr()},t.prototype.trackEvent=function(e,r){this.appInsights.trackEvent(e,r)},t.prototype.trackPageView=function(e){var r=e||{};this.appInsights.trackPageView(r)},t.prototype.trackPageViewPerformance=function(e){var r=e||{};this.appInsights.trackPageViewPerformance(r)},t.prototype.trackException=function(e,r){e&&!e.exception&&e.error&&(e.exception=e.error),this.appInsights.trackException(e,r)},t.prototype._onerror=function(e){this.appInsights._onerror(e)},t.prototype.trackTrace=function(e,r){this.appInsights.trackTrace(e,r)},t.prototype.trackMetric=function(e,r){this.appInsights.trackMetric(e,r)},t.prototype.startTrackPage=function(e){this.appInsights.startTrackPage(e)},t.prototype.stopTrackPage=function(e,r,n,i){this.appInsights.stopTrackPage(e,r,n,i)},t.prototype.startTrackEvent=function(e){this.appInsights.startTrackEvent(e)},t.prototype.stopTrackEvent=function(e,r,n){this.appInsights.stopTrackEvent(e,r,n)},t.prototype.addTelemetryInitializer=function(e){return this.appInsights.addTelemetryInitializer(e)},t.prototype.setAuthenticatedUserContext=function(e,r,n){n===void 0&&(n=!1),this.properties.context.user.setAuthenticatedUserContext(e,r,n)},t.prototype.clearAuthenticatedUserContext=function(){this.properties.context.user.clearAuthenticatedUserContext()},t.prototype.trackDependencyData=function(e){this.dependencies.trackDependencyData(e)},t.prototype.flush=function(e){var r=this;e===void 0&&(e=!0),Vn(this.core,function(){return"AISKU.flush"},function(){tt(r.core.getTransmissionControls(),function(n){tt(n,function(i){i.flush(e)})})},null,e)},t.prototype.onunloadFlush=function(e){e===void 0&&(e=!0),tt(this.core.getTransmissionControls(),function(r){tt(r,function(n){n.onunloadFlush?n.onunloadFlush():n.flush(e)})})},t.prototype.loadAppInsights=function(e,r,n){var i=this;e===void 0&&(e=!1);var a=this;function s(v){if(v){var d="";ke(a._snippetVersion)||(d+=a._snippetVersion),e&&(d+=".lg"),a.context&&a.context.internal&&(a.context.internal.snippetVer=d||"-"),Tt(a,function(p,B){et(p)&&!at(B)&&p&&p[0]!=="_"&&Cf.indexOf(p)===-1&&(v[p]=B)})}}return e&&a.config.extensions&&a.config.extensions.length>0&&wr("Extensions not allowed in legacy mode"),Vn(a.core,function(){return"AISKU.loadAppInsights"},function(){var v=[];v.push(a._sender),v.push(a.properties),v.push(a.dependencies),v.push(a.appInsights),a.core.initialize(a.config,v,r,n),a.context=a.properties.context,hc&&a.context&&(a.context.internal.sdkSrc=hc),s(a.snippet),a.emptyQueue(),a.pollInternalLogs(),a.addHousekeepingBeforeUnload(i)}),a},t.prototype.updateSnippetDefinitions=function(e){tl(e,this,function(r){return r&&Cf.indexOf(r)===-1})},t.prototype.emptyQueue=function(){var e=this;try{if(ur(e.snippet.queue)){for(var r=e.snippet.queue.length,n=0;n<r;n++){var i=e.snippet.queue[n];i()}e.snippet.queue=void 0,delete e.snippet.queue}}catch(s){var a={};s&&at(s.toString)&&(a.exception=s.toString())}},t.prototype.pollInternalLogs=function(){this.core.pollInternalLogs()},t.prototype.stopPollingInternalLogs=function(){this.core.stopPollingInternalLogs()},t.prototype.addHousekeepingBeforeUnload=function(e){if(ki()||gs()){var r=function(){e.onunloadFlush(!1),tt(e.appInsights.core._extensions,function(a){if(a.identifier===_i)return a&&a.context&&a.context._sessionManager&&a.context._sessionManager.backup(),-1})},n=!1,i=e.appInsights.config.disablePageUnloadEvents;e.appInsights.config.disableFlushOnBeforeUnload||(n=Pl(r,i),n=bo(r,i)||n,!n&&!vl()&&e.appInsights.core.logger.throwInternal(Pe.CRITICAL,we.FailedToAddHandlerForOnBeforeUnload,"Could not add handler for beforeunload and pagehide")),!n&&!e.appInsights.config.disableFlushOnUnload&&bo(r,i)}},t.prototype.getSender=function(){return this._sender},t.prototype.getSKUDefaults=function(){var e=this;e.config.diagnosticLogInterval=e.config.diagnosticLogInterval&&e.config.diagnosticLogInterval>0?e.config.diagnosticLogInterval:1e4},t}();(function(){var t=null,e=!1,r=["://js.monitor.azure.com/","://az416426.vo.msecnd.net/"];try{var n=(document||{}).currentScript;n&&(t=n.src)}catch{}if(t)try{var i=t.toLowerCase();if(i){for(var a="",s=0;s<r.length;s++)if(i.indexOf(r[s])!==-1){a="cdn"+(s+1),i.indexOf("/scripts/")===-1&&(i.indexOf("/next/")!==-1?a+="-next":i.indexOf("/beta/")!==-1&&(a+="-beta")),hc=a+(e?".mod":"");break}}}catch{}})();var Ua,Mf=t=>(Ua=new _c({config:{instrumentationKey:t}}),Ua.loadAppInsights(),Ua),Zi={START:"start",FINISH:"finish",ERROR:"error",UPLOAD_VIDEO:"upload_video"},Nm=t=>Ua.trackException({exception:t}),Qi=(t,e)=>Ua.trackEvent({name:t,properties:e}),km=(t,e,r)=>Ua.trackPageView({name:t,uri:e,properties:r}),Yt={trackPage:km,trackError:Nm,registerStart:(t,e,r)=>Qi(Zi.START,{proctoringId:t,success:e,description:r}),registerFinish:(t,e,r)=>Qi(Zi.FINISH,{proctoringId:t,success:e,description:r}),registerError:(t,e)=>Qi(Zi.ERROR,{proctoringId:t,description:e}),registerUpload:(t,e,r,n,i)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,success:e,description:r,serviceType:n,uploadTime:i}),registerUploadFile:(t,e,r)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,description:e,fileType:r}),registerChangeDevice:(t,e,r)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,inOrOut:e,devicesChanged:r}),registerStopSharingScreen:(t,e)=>Qi(Zi.UPLOAD_VIDEO,{proctoringId:t,description:e})};var Ji=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=d=>{let p=d.loadedBytes/n.size*100;i&&i(Math.round(p))},s=await this.backend.getAzureSignedUrl(r,n,this.proctoringId),v=await ua.request({url:s,method:"PUT",headers:{"x-ms-blob-type":"BlockBlob"},data:n,onUploadProgress:d=>{a({loadedBytes:d.loaded})}}).then(()=>!0).catch(()=>!1);return{storage:"AzureBlob",url:s,uploaded:v}}catch{throw Yt.registerError(this.proctoringId,`Failed to upload to Azure
22
22
  File name: ${n.name}
23
23
  File type: ${n.type}
24
24
  File size: ${n.size}`),new Error("Failed to upload to azure")}}};var zn=class{constructor(e,r,n,i,a){this.blobs=[];this.options={cameraId:void 0,microphoneId:void 0};this.videoOptions={width:640,height:480};this.imageCount=0;this.options=e,this.videoOptions=r,this.backend=n,this.backendToken=i,this.proctoringId=a,this.proctoringId&&this.backend&&(this.azureUpload=new Ji(this.proctoringId,this.backend))}async startRecording(){let{cameraId:e,microphoneId:r}=this.options,n={audio:{deviceId:r},video:{deviceId:e,width:this.videoOptions.width,height:this.videoOptions.height,frameRate:15}};this.cameraStream=await navigator.mediaDevices.getUserMedia(n);let{startRecording:i,stopRecording:a,pauseRecording:s,resumeRecording:v}=Qa(this.cameraStream,this.blobs);this.recordingStart=i,this.recordingStop=a,this.recordingPause=s,this.recordingResume=v,this.recordingStart(),this.photoShotsCycle()}async stopRecording(){await this.recordingStop(),clearInterval(this.imageInterval)}async pauseRecording(){await this.recordingPause()}async resumeRecording(){await this.recordingResume()}photoShotsCycle(){let e=this.cameraStream.getVideoTracks()[0];this.imageCapture=new ImageCapture(e),this.imageInterval=setInterval(()=>{this.imageCapture.takePhoto().then(r=>createImageBitmap(r)).then(async r=>{let n=document.createElement("canvas");n.width=1280,n.height=720,n.getContext("bitmaprenderer").transferFromImageBitmap(r);let a=await new Promise(s=>n.toBlob(s));a instanceof Blob&&this.azureUpload&&this.backendToken&&(this.azureUpload.upload({file:new File([a],`EP_${this.proctoringId}_image_${this.imageCount}.jpg`,{type:"image/jpeg"})},this.backendToken),this.imageCount++)}).catch(r=>console.log(r))},15e3)}async saveOnSession(e){let r=this.cameraStream.getVideoTracks()[0].getSettings(),n=this.cameraStream.getAudioTracks()[0].getSettings();e.addRecording({device:`Audio
25
25
  Sample Rate: ${n.sampleRate}
26
- Sample Size: ${n.sampleSize}`,file:new File(this.blobs,`EP_${e.id}_camera_0.webm`,{type:"video/webm"}),origin:"Camera"})}};var Xs=class{constructor(){}async takePicture(e,r){return console.log("take picture"),await this.takePictureInterface(e,r)}async startCapture(e="default"){let r=document.querySelector("#cameraStream"),n={audio:!1,video:{facingMode:"user",aspectRatio:1.777777778,width:{min:640,ideal:640,max:1920},height:{min:400,ideal:480},deviceId:e}};this.cameraRecorder=new zn({cameraId:e},{width:640,height:480}),await this.cameraRecorder.startRecording(),r.srcObject=this.cameraRecorder.cameraStream,r.play()}shot(){console.log("shot");let e=document.querySelector("#cameraStream"),r=document.querySelector("#canvas"),n=document.querySelector("#image");r.width=e.videoWidth,r.height=e.videoHeight,r.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),n.src=r.toDataURL("image/jpg"),this.base64=r.toDataURL("image/jpg")}takePictureInterface(e,r){return new Promise(n=>{let i=document.createElement("div");i.setAttribute("id","authPhoto"),i.style.backgroundColor="rgba(0,0,0,0.4)",i.style.zIndex="1000",i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.height="100vh",i.style.width="100%",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center";let a=document.createElement("div");a.style.backgroundColor="#fff",a.style.zIndex="1001",a.style.width="800px",a.style.maxHeight="95vh",a.style.borderRadius="10px",a.style.display="flex",a.style.flexDirection="column",a.style.alignItems="center",a.style.boxSizing="border-box";let s=document.createElement("h3");s.innerText=e||"Biometria Facial",s.style.color="rgba(0, 0, 0, .7)",s.style.fontWeight="bold",s.style.fontSize="20px",s.style.marginBottom="15px",s.style.padding="20px 0px 0px",s.style.width="100%",s.style.textAlign="center",a.appendChild(s);let v=document.createElement("p");v.innerText=r||"Encaixe seu rosto no formato e clique no bot\xE3o abaixo",v.style.color="rgba(0, 0, 0, .7)",v.style.fontWeight="normal",v.style.fontSize="16px",v.style.marginBottom="15px",v.style.padding="0px 0px 20px",v.style.borderBottom="2px solid rgba(0, 0, 0, .1)",v.style.width="100%",v.style.textAlign="center",a.appendChild(v);let d=document.createElement("div"),p=document.createElement("h3"),B=document.createElement("select");B.setAttribute("id","cameraSelect"),d.style.padding="0 20px",d.style.width="100%",d.style.display="flex",d.style.justifyContent="space-between",d.style.marginBottom="15px",p.innerText="C\xE2mera",p.style.color="rgba(0, 0, 0, .75)",p.style.fontWeight="bold",p.style.fontSize="16px",d.appendChild(p),d.appendChild(B),a.appendChild(d);let z=document.createElement("div"),ee=document.createElement("video");ee.setAttribute("id","cameraStream"),ee.muted=!0,z.style.width="100%",z.style.height="50vh",z.style.display="flex",z.style.justifyContent="center",z.style.position="relative",ee.style.backgroundColor="#000",ee.style.borderRadius="10px",ee.style.width="auto",ee.style.height="auto",ee.style.minHeight="100%",z.appendChild(ee);let te=document.createElement("canvas");te.setAttribute("id","canvas"),te.style.display="none",te.style.width="100%",te.style.height="100%";let D=document.createElement("img");D.setAttribute("id","image"),D.style.objectFit="contain",D.style.display="none",D.style.borderRadius="8px",z.appendChild(te),z.appendChild(D);let ce=document.createElement("div");ce.setAttribute("class","facial-biometry__mask"),ce.style.width="100%",ce.style.height="100%",ce.style.position="absolute",ce.style.top="0px",ce.style.left="0px",ce.style.backgroundColor="#fff",ce.style.opacity="0.6";let P=document.createElement("div");P.setAttribute("class","biometry__frame"),P.style.width="100%",P.style.height="100%",P.style.position="absolute",P.style.top="0px",P.style.left="0px",P.style.zIndex="10",z.appendChild(ce),z.appendChild(P),a.appendChild(z),this.addStyleMask();let oe=document.createElement("button"),se=document.createElement("div");oe.setAttribute("id","confirmBtn"),se.style.width="100%",se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",oe.style.background="url('https://iarisprod.blob.core.windows.net/imagens/camera.svg') no-repeat center",oe.style.width="70px",oe.style.height="70px",oe.style.borderRadius="70px",oe.style.border="none",oe.style.backgroundColor="#16a34a",oe.style.margin="20px 0",se.appendChild(oe),a.appendChild(se);let xe=document.createElement("button");xe.style.background="url('https://iarisprod.blob.core.windows.net/imagens/close.svg') no-repeat center",xe.style.width="70px",xe.style.height="70px",xe.style.borderRadius="70px",xe.style.border="none",xe.style.backgroundColor="#e74141",xe.style.margin="20px 20px";let Ge=document.createElement("button");Ge.style.background="url('https://iarisprod.blob.core.windows.net/imagens/check.svg') no-repeat center",Ge.style.width="70px",Ge.style.height="70px",Ge.style.borderRadius="70px",Ge.style.border="none",Ge.style.backgroundColor="#16a34a",Ge.style.margin="20px 20px",i.appendChild(a),document.body.appendChild(i),this.setSelectOption(),this.startCapture(),oe.addEventListener("click",()=>{se.removeChild(oe),se.appendChild(xe),se.appendChild(Ge),this.shot(),ee.style.display="none",D.style.display="block"}),xe.addEventListener("click",()=>{se.appendChild(oe),se.removeChild(xe),se.removeChild(Ge),ee.style.display="block",D.style.display="none"}),Ge.addEventListener("click",()=>{this.closeInterface(),n({base64:this.base64})})})}async setSelectOption(){let e=document.querySelector("#cameraSelect"),r=await xn();e&&(e.value="default");let n=(i,a)=>{let s=document.createElement("option");return s.setAttribute("value",a),s.innerHTML=i,s};r.cameras.forEach(i=>{let a=n(i.label,i.id);e?.appendChild(a)}),this.onSelectOptionChange()}async onSelectOptionChange(){let e=document.querySelector("#cameraSelect");e?.addEventListener("change",async()=>{this.startCapture(e?.value)})}async closeInterface(){await this.cameraRecorder.stopRecording(),document.querySelector("#authPhoto")?.remove()}async addStyleMask(){let e=`
26
+ Sample Size: ${n.sampleSize}`,file:new File(this.blobs,`EP_${e.id}_camera_0.webm`,{type:"video/webm"}),origin:"Camera"})}};var Xs=class{constructor(){}async takePicture(e,r){return console.log("take picture"),await this.takePictureInterface(e,r)}async startCapture(e="default"){let r=document.querySelector("#cameraStream"),n={audio:!1,video:{facingMode:"user",aspectRatio:1.777777778,width:{min:640,ideal:640,max:1920},height:{min:400,ideal:480},deviceId:e}};this.cameraRecorder=new zn({cameraId:e},{width:640,height:480}),await this.cameraRecorder.startRecording(),r.srcObject=this.cameraRecorder.cameraStream,r.play()}shot(){console.log("shot");let e=document.querySelector("#cameraStream"),r=document.querySelector("#canvas"),n=document.querySelector("#image");r.width=e.videoWidth,r.height=e.videoHeight,r.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),n.src=r.toDataURL("image/jpg"),this.base64=r.toDataURL("image/jpg")}takePictureInterface(e,r){return new Promise(n=>{let i=document.createElement("div");i.setAttribute("id","authPhoto"),i.style.backgroundColor="rgba(0,0,0,0.4)",i.style.zIndex="1000",i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.height="100vh",i.style.width="100%",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center";let a=document.createElement("div");a.style.backgroundColor="#fff",a.style.zIndex="1001",a.style.width="800px",a.style.maxHeight="95vh",a.style.borderRadius="10px",a.style.display="flex",a.style.flexDirection="column",a.style.alignItems="center",a.style.boxSizing="border-box";let s=document.createElement("h3");s.innerText=e||"Biometria Facial",s.style.color="rgba(0, 0, 0, .7)",s.style.fontWeight="bold",s.style.fontSize="20px",s.style.marginBottom="15px",s.style.padding="20px 0px 0px",s.style.width="100%",s.style.textAlign="center",a.appendChild(s);let v=document.createElement("p");v.innerText=r||"Encaixe seu rosto no formato e clique no bot\xE3o abaixo",v.style.color="rgba(0, 0, 0, .7)",v.style.fontWeight="normal",v.style.fontSize="16px",v.style.marginBottom="15px",v.style.padding="0px 0px 20px",v.style.borderBottom="2px solid rgba(0, 0, 0, .1)",v.style.width="100%",v.style.textAlign="center",a.appendChild(v);let d=document.createElement("div"),p=document.createElement("h3"),B=document.createElement("select");B.setAttribute("id","cameraSelect"),d.style.padding="0 20px",d.style.width="100%",d.style.display="flex",d.style.justifyContent="space-between",d.style.marginBottom="15px",p.innerText="C\xE2mera",p.style.color="rgba(0, 0, 0, .75)",p.style.fontWeight="bold",p.style.fontSize="16px",d.appendChild(p),d.appendChild(B),a.appendChild(d);let z=document.createElement("div"),ee=document.createElement("video");ee.setAttribute("id","cameraStream"),ee.muted=!0,z.style.width="100%",z.style.height="50vh",z.style.display="flex",z.style.justifyContent="center",z.style.position="relative",ee.style.backgroundColor="#000",ee.style.borderRadius="10px",ee.style.width="auto",ee.style.height="auto",ee.style.minHeight="100%",z.appendChild(ee);let te=document.createElement("canvas");te.setAttribute("id","canvas"),te.style.display="none",te.style.width="100%",te.style.height="100%";let k=document.createElement("img");k.setAttribute("id","image"),k.style.objectFit="contain",k.style.display="none",k.style.borderRadius="8px",z.appendChild(te),z.appendChild(k);let ce=document.createElement("div");ce.setAttribute("class","facial-biometry__mask"),ce.style.width="100%",ce.style.height="100%",ce.style.position="absolute",ce.style.top="0px",ce.style.left="0px",ce.style.backgroundColor="#fff",ce.style.opacity="0.6";let P=document.createElement("div");P.setAttribute("class","biometry__frame"),P.style.width="100%",P.style.height="100%",P.style.position="absolute",P.style.top="0px",P.style.left="0px",P.style.zIndex="10",z.appendChild(ce),z.appendChild(P),a.appendChild(z),this.addStyleMask();let oe=document.createElement("button"),se=document.createElement("div");oe.setAttribute("id","confirmBtn"),se.style.width="100%",se.style.display="flex",se.style.alignItems="center",se.style.justifyContent="center",oe.style.background="url('https://iarisprod.blob.core.windows.net/imagens/camera.svg') no-repeat center",oe.style.width="70px",oe.style.height="70px",oe.style.borderRadius="70px",oe.style.border="none",oe.style.backgroundColor="#16a34a",oe.style.margin="20px 0",se.appendChild(oe),a.appendChild(se);let xe=document.createElement("button");xe.style.background="url('https://iarisprod.blob.core.windows.net/imagens/close.svg') no-repeat center",xe.style.width="70px",xe.style.height="70px",xe.style.borderRadius="70px",xe.style.border="none",xe.style.backgroundColor="#e74141",xe.style.margin="20px 20px";let Ge=document.createElement("button");Ge.style.background="url('https://iarisprod.blob.core.windows.net/imagens/check.svg') no-repeat center",Ge.style.width="70px",Ge.style.height="70px",Ge.style.borderRadius="70px",Ge.style.border="none",Ge.style.backgroundColor="#16a34a",Ge.style.margin="20px 20px",i.appendChild(a),document.body.appendChild(i),this.setSelectOption(),this.startCapture(),oe.addEventListener("click",()=>{se.removeChild(oe),se.appendChild(xe),se.appendChild(Ge),this.shot(),ee.style.display="none",k.style.display="block"}),xe.addEventListener("click",()=>{se.appendChild(oe),se.removeChild(xe),se.removeChild(Ge),ee.style.display="block",k.style.display="none"}),Ge.addEventListener("click",()=>{this.closeInterface(),n({base64:this.base64})})})}async setSelectOption(){let e=document.querySelector("#cameraSelect"),r=await xn();e&&(e.value="default");let n=(i,a)=>{let s=document.createElement("option");return s.setAttribute("value",a),s.innerHTML=i,s};r.cameras.forEach(i=>{let a=n(i.label,i.id);e?.appendChild(a)}),this.onSelectOptionChange()}async onSelectOptionChange(){let e=document.querySelector("#cameraSelect");e?.addEventListener("change",async()=>{this.startCapture(e?.value)})}async closeInterface(){await this.cameraRecorder.stopRecording(),document.querySelector("#authPhoto")?.remove()}async addStyleMask(){let e=`
27
27
  .facial-biometry__mask {
28
28
  mask-image: url('https://iarisprod.blob.core.windows.net/imagens/square.svg'), url('https://iarisprod.blob.core.windows.net/imagens/face-mask.svg');
29
- mask-size: cover, auto 60%;
29
+ mask-size: cover, auto 100%;
30
30
  mask-repeat: no-repeat;
31
31
  mask-position: center, center;
32
32
  mask-composite: subtract;
33
33
 
34
34
  -webkit-mask-image: url('https://iarisprod.blob.core.windows.net/imagens/square.svg'), url('https://iarisprod.blob.core.windows.net/imagens/face-mask.svg');
35
- -webkit-mask-size: cover, auto 60%;
35
+ -webkit-mask-size: cover, auto 100%;
36
36
  -webkit-mask-repeat: no-repeat;
37
37
  -webkit-mask-position: center, center;
38
38
  -webkit-mask-composite: source-out;
@@ -40,23 +40,33 @@ bitsperframe: %d
40
40
 
41
41
  .biometry__frame {
42
42
  background: url("https://iarisprod.blob.core.windows.net/imagens/face-frame.svg") no-repeat center;
43
- background-size: 78% 62%;
43
+ background-size: auto 100%;
44
+
45
+ // mask-image: url("https://iarisprod.blob.core.windows.net/imagens/face-frame.svg");
46
+ // mask-size: auto 100%;
47
+ // mask-position: center;
48
+ // mask-repeat: no-repeat;
49
+
50
+ // -webkit-mask-image: url("https://iarisprod.blob.core.windows.net/imagens/face-frame.svg");
51
+ // -webkit-mask-size: auto 100%;
52
+ // -webkit-mask-position: center;
53
+ // -webkit-mask-repeat: no-repeat;
44
54
  }
45
- `,r=document.createElement("style");r.innerHTML=e,document.head.appendChild(r)}};var Ha=class{constructor(e){this.stream=e}start(e={}){return new Promise((r,n)=>{try{let i=new AudioContext,a=i.createAnalyser(),s=i.createMediaStreamSource(this.stream);this.scriptProcessor=i.createScriptProcessor(2048,1,1),a.smoothingTimeConstant=.8,a.fftSize=1024,s.connect(a),a.connect(this.scriptProcessor),this.scriptProcessor.connect(i.destination);let v=this;this.scriptProcessor.onaudioprocess=function(){let d=new Uint8Array(a.frequencyBinCount);a.getByteFrequencyData(d);let B=d.reduce((z,ee)=>z+ee,0)/d.length;v.setVolume(B),e.setVolume&&e.setVolume(B)},r(!0)}catch(i){this.stop(),n(`Error: ${i}`)}})}stop(){this.scriptProcessor&&this.scriptProcessor.disconnect()}getVolume(){return this.volume}setVolume(e){this.volume=e}};var bi={cameraId:void 0,microphoneId:void 0,allowMultipleMonitors:!1,allowOnlyFirstMonitor:!0,captureScreen:!0,noiseLimit:40,proctoringType:"IMAGE",insights:""};function Ks(t){return!!t.width&&!!t.height?{width:t.width,height:t.height}:{width:640,height:480}}var Ws=class{constructor(){this.volumeMedia=0;this.volumeSum=0;this.volumeCounter=0}async checkDevices(e=bi,r={width:1080,height:720}){this.options={...bi,...e,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions=r;let{cameraId:n,microphoneId:i}=await this.checkDevicesInterface();return new Promise(a=>{a({cameraId:n,microphoneId:i,volumeRange:this.volumeMedia})})}checkDevicesInterface(){return new Promise(e=>{let r=document.createElement("div");r.setAttribute("id","checkDevices"),r.style.backgroundColor="rgba(0,0,0,0.4)",r.style.zIndex="1000",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.height="100vh",r.style.width="100%",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center";let n=document.createElement("div");n.style.backgroundColor="#fff",n.style.zIndex="1001",n.style.width="600px",n.style.borderRadius="10px",n.style.display="flex",n.style.flexDirection="column",n.style.alignItems="center";let i=document.createElement("h3");i.innerText="Para iniciar configure a c\xE2mera e o microfone",i.style.color="rgba(0, 0, 0, .7)",i.style.fontWeight="bold",i.style.fontSize="20px",i.style.marginBottom="15px",i.style.padding="20px 0px",i.style.borderBottom="2px solid rgba(0, 0, 0, .1)",i.style.width="100%",i.style.textAlign="center",n.appendChild(i);let a=document.createElement("div"),s=document.createElement("h3"),v=document.createElement("select");v.setAttribute("id","cameraSelect"),a.style.padding="0 20px",a.style.width="100%",a.style.display="flex",a.style.justifyContent="space-between",a.style.marginBottom="15px",s.innerText="C\xE2mera",s.style.color="rgba(0, 0, 0, .75)",s.style.fontWeight="bold",s.style.fontSize="16px",v.style.maxWidth="400px",a.appendChild(s),a.appendChild(v),n.appendChild(a);let d=document.createElement("div"),p=document.createElement("video");p.setAttribute("id","cameraStream"),p.muted=!0,d.style.width="calc(100% - 40px)",d.style.display="flex",d.style.justifyContent="space-between",d.style.borderBottom="2px solid rgba(0, 0, 0, .1)",d.style.paddingBottom="15px",p.style.width="20rem",p.style.backgroundColor="#000",p.style.borderRadius="10px",p.style.marginBottom="15px",d.appendChild(p),n.appendChild(d);let B=document.createElement("div"),z=document.createElement("h3"),ee=document.createElement("select");ee.setAttribute("id","micSelect"),B.style.padding="0 20px",B.style.width="100%",B.style.display="flex",B.style.justifyContent="space-between",B.style.margin="15px 0",z.innerText="C\xE2mera",z.style.color="rgba(0, 0, 0, .7)",z.style.fontWeight="bold",z.style.fontSize="16px",ee.style.maxWidth="400px",B.appendChild(z),B.appendChild(ee),n.appendChild(B);let te=document.createElement("div");te.style.width="calc(100% - 40px)",te.style.display="flex",te.style.flexDirection="column",te.style.justifyContent="space-between",te.style.paddingBottom="15px";let D=document.createElement("div");D.setAttribute("id","audioStream"),D.style.display="flex",D.style.marginBottom="15px";for(let lt=0;lt<25;lt++){let ft=document.createElement("div");ft.style.height="16px",ft.style.width="5px",ft.style.marginRight="5px",ft.style.borderRadius="10px",ft.style.backgroundColor="rgba(0, 0, 0, .3)",D.appendChild(ft)}let ce=document.createElement("div"),P=document.createElement("p"),oe=document.createElement("p"),se=document.createElement("p");ce.style.width="250px",ce.style.display="flex",ce.style.justifyContent="space-between",P.innerText="0",oe.innerText="50",se.innerText="100",ce.appendChild(P),ce.appendChild(oe),ce.appendChild(se),te.appendChild(D),te.appendChild(ce),n.appendChild(te);let xe=document.createElement("button"),Ge=document.createElement("div");xe.setAttribute("id","confirmBtn"),Ge.style.width="100%",Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.justifyContent="center",Ge.style.borderTop="2px solid rgba(0, 0, 0, .1)",xe.innerText="Continuar",xe.style.width="100%",xe.style.height="70px",xe.style.backgroundColor="#FFF",xe.style.border="none",xe.style.color="rgba(0, 0, 0, .7)",xe.style.fontWeight="bold",xe.style.borderRadius="10px",xe.style.paddingTop="5px",xe.style.paddingBottom="5px",xe.addEventListener("click",()=>{this.closeCheckDevices(),e({cameraId:v?.value,microphoneId:ee?.value})}),Ge.appendChild(xe),n.appendChild(Ge),r.appendChild(n),document.body.appendChild(r),this.startCheckDevices(this.options,this.videoOptions)})}videoDeviceInterface(e){let r=document.querySelector("#cameraStream");r&&(r.srcObject=e,r.play())}audioDeviceInterface(e){let n=document.querySelector("#audioStream")?.querySelectorAll("div"),i=document.querySelector("#audioText");this.volumeMeter=new Ha(this.cameraRecorder.cameraStream),this.volumeMeter.start({setVolume:a=>{this.volumeCounter++,this.volumeSum+=a;let s=a/4;n?.forEach((v,d)=>{d<Math.ceil(s)?v.style.backgroundColor="rgb(22, 163, 74)":v.style.backgroundColor="rgba(0, 0, 0, .3)"}),i&&(i.innerText=a.toFixed(0).toString())}}).catch(a=>{console.log(a),this.volumeMeter=void 0})}async setSelectOption(e){let r=document.querySelector("#cameraSelect"),n=document.querySelector("#micSelect"),i=await xn();r&&(r.value=e.cameraId||"default"),n&&(n.value=e.microphoneId||"default");let a=(s,v)=>{let d=document.createElement("option");return d.setAttribute("value",v),d.innerHTML=s,d};i.cameras.forEach(s=>{let v=a(s.label,s.id);r?.appendChild(v)}),i.microphones.forEach(s=>{let v=a(s.label,s.id);n?.appendChild(v)}),this.onSelectOptionChange()}async onSelectOptionChange(){let e=document.querySelector("#cameraSelect"),r=document.querySelector("#micSelect");e?.addEventListener("change",async()=>{await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new zn({cameraId:e?.value,microphoneId:r?.value},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)}),r?.addEventListener("change",async()=>{await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new zn({cameraId:e?.value,microphoneId:r?.value},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)})}async startCheckDevices(e=bi,r){return this.setSelectOption(e),this.videoOptions=Ks(r),await Ko(),this.cameraRecorder=new zn({cameraId:e.cameraId,microphoneId:e.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),{cameraStream:this.cameraRecorder.cameraStream}}async closeCheckDevices(){document.querySelector("#checkDevices")?.remove(),this.volumeMeter?.stop(),this.volumeMedia=Math.ceil(this.volumeSum/this.volumeCounter),await this.cameraRecorder.stopRecording()}};var Bf="not_shared_first_screen",Ys="multiple_monitors_detected",Nf="proctoring_already_started",$s="proctoring_not_started";var Zs=class{constructor(){this.hasExtension=!1;this.tryes=0;this.responseStart=!1}start(){let e;return new Promise((r,n)=>{window.postMessage({type:"easyproctor",func:"startExtensionEasyproctor"},"*"),e=setInterval(()=>{this.tryes>10&&(clearInterval(e),n(new Error("N\xE3o foi poss\xEDvel se conectar com a extens\xE3o"))),this.responseStart&&(clearInterval(e),r(this.responseStart)),this.tryes++},1e3)})}sendVerifyMsg(e,r){window.postMessage({type:"easyproctor",func:"verifyExtensionEasyproctor",url:e,token:r},"*")}verify(e){return e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="progress"&&this.options.onProgress&&this.options.onProgress(100),e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="start"&&(this.responseStart=!0),new Promise((r,n)=>{e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="version"&&(this.hasExtension=!0,r(this.hasExtension))})}addEventListener(){window.addEventListener("message",e=>this.verify(e))}};var Qs=class{constructor(e,r){this.repositoryDevices=e,this.proctoringId=r}startRecording(e){navigator.mediaDevices.ondevicechange=()=>{this.onChangeDevices(e)}}async onChangeDevices(e){let r=await xn(),n=(z,ee)=>z.label===ee.label&&z.id===ee.id,i=(z,ee,te)=>z.filter(D=>!ee.some(ce=>te(D,ce))),a=await this.repositoryDevices.getDevices("devices"),s={label:"",id:""},v={cameras:a?.cameras||[s],microphones:a?.microphones||[s]},d,p;r.cameras.length!=v?.cameras.length&&(d=r.cameras.length>v?.cameras.length?i(r.cameras,v?.cameras,n):i(v?.cameras,r.cameras,n),d=d.filter(z=>z.id!="default")),r.microphones.length!=v?.microphones.length&&(p=r.microphones.length>v?.microphones.length?i(r.microphones,v?.microphones,n):i(v?.microphones,r.microphones,n),p=p.filter(z=>z.id!="default"&&z.id!="communications"));let B={cameras:d||[],microphones:p||[],status:r.cameras.length>v?.cameras.length||r.microphones.length>v?.microphones.length?"in":"out"};await this.repositoryDevices.save({...r,id:"devices",status:r.cameras.length>v?.cameras.length||r.microphones.length>v?.microphones.length?"in":"out"}),e.status&&(B.cameras.length!=0||B.microphones.length!=0)&&(Yt.registerChangeDevice(this.proctoringId,B.status,B),e.status(B))}};var km="https://proctoring-api-dev.easyproctor.tech/api",Om="https://proctoring-api-hml.easyproctor.tech/api",Df="https://proctoring-api.easyproctor.tech/api",Js=class{constructor(e){this.options=e;this.baseUrl=this.selectBaseUrl(e.type)}selectBaseUrl(e){return e==="dev"?km:e==="homol"?Om:Df}async confirmStart(e,r){return await this.makeRequest({path:`/proctoring/start/${e.examId}`,method:"POST",body:{clientId:e.clientId,proctoringType:r},jwt:e.token})}async getInsights(e){return(await this.makeRequestAxios({path:"/AzureKey/getInsights",method:"GET",jwt:e.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getAzureBlobUrl(e){return(await this.makeRequestAxios({path:"/AzureKey/get-blob-url",method:"GET",jwt:e.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getAzureSignedUrl(e,r,n){return(await this.makeRequestAxios({path:"/AzureKey/signed-url",method:"POST",jwt:e,body:{objectName:r.type==="image/jpeg"&&n?`${n}/${r.name}`:r.name,contentType:r.type}})).data}async getAzureSignedUrlImage(e,r){return(await this.makeRequestAxios({path:"/AzureKey/signed-url",method:"POST",jwt:e,body:{objectName:r.name,contentType:r.type}})).data}async getAwsSignedUrl(e,r){return(await this.makeRequestAxios({path:"/AwsKey/signed-url",method:"POST",jwt:e,body:{objectName:r.name,contentType:r.type}})).data}async sendAwsToAzure(e,r){await this.makeRequest({path:"/Proctoring/aws-to-azure",method:"POST",jwt:e,body:{objectName:`${r.name}`}})}async saveScreenAlerts(e,r){await this.makeRequest({path:"/proctoring/save-screen",method:"POST",jwt:e.token,body:{proctoringId:r.id,alerts:r.alerts}})}async finishAndSendUrls(e,r){let n=new Date().toISOString(),i=r.recordings.find(z=>z.origin==="Camera")?.upload,a=r.recordings.find(z=>z.origin==="Mic")?.upload,s=r.recordings.find(z=>z.origin==="Screen")?.upload,v=z=>z?z.substring(0,z.indexOf("?")):void 0,d=v(i?.azureUrl),p=v(a?.azureUrl),B=v(s?.azureUrl);if(!d||!p||!B){let z=await this.getAzureBlobUrl(e);!d&&(d=`${z}/${r.recordings.find(ee=>ee.origin==="Camera")?.file.name}`),!p&&(p=`${z}/${r.recordings.find(ee=>ee.origin==="Mic")?.file.name}`),!B&&r.recordings.find(ee=>ee.origin==="Screen")&&(B=`${z}/${r.recordings.find(ee=>ee.origin==="Screen")?.file.name}`)}await this.makeRequest({path:`/proctoring/finish/${e.examId}`,method:"POST",body:{endDate:n,videoCameraUrl:d,audioCameraUrl:p,videoScreenUrl:B},jwt:e.token})}async getServerHour(e){return await this.makeRequest({path:"/Proctoring/server-hour",method:"GET",jwt:e})}async makeRequest(e){let{path:r,method:n,body:i,jwt:a}=e,s=await fetch(this.baseUrl+r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let v=s.headers.get("content-type");return(v?v.includes("application/json"):!1)?await s.json():null}async makeRequestAxios(e){let{path:r,method:n,body:i,jwt:a}=e,s=await ua.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${a}`,"Access-Control-Allow-Origin":"*"},data:i});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";return s}async makeRequestPUT(e){let{url:r,method:n,body:i,jwt:a}=e,s=await fetch(r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Accept:"*/*","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive","aeg-event-type":"Notification","Content-Type":"application/json","Cache-Control":"no-cache","x-ms-blob-type":"BlockBlob"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let v=s.headers.get("content-type");return(v?v.includes("application/json"):!1)?await s.json():null}};var Va=class{constructor(e){this.loadingBoolean=!0;this.proctoringId=e}async upload(e,r){try{let{file:n,onProgress:i}=e,a=URL.createObjectURL(n),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=a,s.download=n.name,s.click(),window.URL.revokeObjectURL(a),this.loadingBoolean=!1,clearInterval(this.loadingInterval),i&&i(Math.round(100))}catch{throw new Error("Error on machine download")}}};var e0=class{constructor(e,r){this.session=e;this.recorders=r}async startAll(){this.session.start();let e=this.recorders.map(r=>r.startRecording());await Promise.all(e)}async pauseAll(){this.session.pause();let e=this.recorders.map(r=>r.pauseRecording());await Promise.all(e)}async resumeAll(){this.session.resume();let e=this.recorders.map(r=>r.resumeRecording());await Promise.all(e)}async stopAll(){let e=this.recorders.map(r=>r.stopRecording());await Promise.all(e),this.session.stop()}async saveAllOnSession(){let e=this.recorders.map(r=>{r.saveOnSession(this.session)});await Promise.all(e)}};var qa=class{constructor(e,r,n){this.session=e;this.proctoringId=r;this.uploadServices=n}async upload(e,r){await this.uploadRecordings(e,r)}async uploadRecordings(e,r){await this.uploadAllFiles(e,r),this.session.hasSomethingToUpload||this.session.setUploaded()}async uploadAllFiles(e,r){for(let n=0;n<this.session.recordings.length;n++){let i=this.session.recordings[n];if(i.upload)continue;let a=v=>{let d=(n*100+v)/this.session.recordings.length;r&&r(d)},s=await this.uploadFile(i,e,a).catch(()=>{});s&&(i.upload||(i.upload={storage:"AzureBlob",awsUrl:"",azureUrl:""}),s.uploaded&&(i.upload.storage=s.storage),s.storage==="AzureBlob"?i.upload.azureUrl=s.url:i.upload.awsUrl=s.url)}r&&r(100)}async uploadFile(e,r,n){for await(let i of this.uploadServices){let a=await i.upload({file:e.file,onProgress:s=>{n&&n(s)}},r);if(a){let s="";return e.file.name.search("camera")!==-1?s="Camera":e.file.name.search("screen")!==-1?s="Screen":e.file.name.search("audio")!==-1&&(s="Audio"),Yt.registerUploadFile(this.proctoringId,`Upload File
55
+ `,r=document.createElement("style");r.innerHTML=e,document.head.appendChild(r)}};var Ha=class{constructor(e){this.stream=e}start(e={}){return new Promise((r,n)=>{try{let i=new AudioContext,a=i.createAnalyser(),s=i.createMediaStreamSource(this.stream);this.scriptProcessor=i.createScriptProcessor(2048,1,1),a.smoothingTimeConstant=.8,a.fftSize=1024,s.connect(a),a.connect(this.scriptProcessor),this.scriptProcessor.connect(i.destination);let v=this;this.scriptProcessor.onaudioprocess=function(){let d=new Uint8Array(a.frequencyBinCount);a.getByteFrequencyData(d);let B=d.reduce((z,ee)=>z+ee,0)/d.length;v.setVolume(B),e.setVolume&&e.setVolume(B)},r(!0)}catch(i){this.stop(),n(`Error: ${i}`)}})}stop(){this.scriptProcessor&&this.scriptProcessor.disconnect()}getVolume(){return this.volume}setVolume(e){this.volume=e}};var bi={cameraId:void 0,microphoneId:void 0,allowMultipleMonitors:!1,allowOnlyFirstMonitor:!0,captureScreen:!0,noiseLimit:40,proctoringType:"IMAGE",insights:""};function Ks(t){return!!t.width&&!!t.height?{width:t.width,height:t.height}:{width:640,height:480}}var Ws=class{constructor(){this.volumeMedia=0;this.volumeSum=0;this.volumeCounter=0}async checkDevices(e=bi,r={width:1080,height:720}){this.options={...bi,...e,captureScreen:!1,allowMultipleMonitors:!0,allowOnlyFirstMonitor:!1},this.videoOptions=r;let{cameraId:n,microphoneId:i}=await this.checkDevicesInterface();return new Promise(a=>{a({cameraId:n,microphoneId:i,volumeRange:this.volumeMedia})})}checkDevicesInterface(){return new Promise(e=>{let r=document.createElement("div");r.setAttribute("id","checkDevices"),r.style.backgroundColor="rgba(0,0,0,0.4)",r.style.zIndex="1000",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.height="100vh",r.style.width="100%",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center";let n=document.createElement("div");n.style.backgroundColor="#fff",n.style.zIndex="1001",n.style.width="600px",n.style.borderRadius="10px",n.style.display="flex",n.style.flexDirection="column",n.style.alignItems="center";let i=document.createElement("h3");i.innerText="Para iniciar configure a c\xE2mera e o microfone",i.style.color="rgba(0, 0, 0, .7)",i.style.fontWeight="bold",i.style.fontSize="20px",i.style.marginBottom="15px",i.style.padding="20px 0px",i.style.borderBottom="2px solid rgba(0, 0, 0, .1)",i.style.width="100%",i.style.textAlign="center",n.appendChild(i);let a=document.createElement("div"),s=document.createElement("h3"),v=document.createElement("select");v.setAttribute("id","cameraSelect"),a.style.padding="0 20px",a.style.width="100%",a.style.display="flex",a.style.justifyContent="space-between",a.style.marginBottom="15px",s.innerText="C\xE2mera",s.style.color="rgba(0, 0, 0, .75)",s.style.fontWeight="bold",s.style.fontSize="16px",v.style.maxWidth="400px",a.appendChild(s),a.appendChild(v),n.appendChild(a);let d=document.createElement("div"),p=document.createElement("video");p.setAttribute("id","cameraStream"),p.muted=!0,d.style.width="calc(100% - 40px)",d.style.display="flex",d.style.justifyContent="space-between",d.style.borderBottom="2px solid rgba(0, 0, 0, .1)",d.style.paddingBottom="15px",p.style.width="20rem",p.style.backgroundColor="#000",p.style.borderRadius="10px",p.style.marginBottom="15px",d.appendChild(p),n.appendChild(d);let B=document.createElement("div"),z=document.createElement("h3"),ee=document.createElement("select");ee.setAttribute("id","micSelect"),B.style.padding="0 20px",B.style.width="100%",B.style.display="flex",B.style.justifyContent="space-between",B.style.margin="15px 0",z.innerText="C\xE2mera",z.style.color="rgba(0, 0, 0, .7)",z.style.fontWeight="bold",z.style.fontSize="16px",ee.style.maxWidth="400px",B.appendChild(z),B.appendChild(ee),n.appendChild(B);let te=document.createElement("div");te.style.width="calc(100% - 40px)",te.style.display="flex",te.style.flexDirection="column",te.style.justifyContent="space-between",te.style.paddingBottom="15px";let k=document.createElement("div");k.setAttribute("id","audioStream"),k.style.display="flex",k.style.marginBottom="15px";for(let lt=0;lt<25;lt++){let ft=document.createElement("div");ft.style.height="16px",ft.style.width="5px",ft.style.marginRight="5px",ft.style.borderRadius="10px",ft.style.backgroundColor="rgba(0, 0, 0, .3)",k.appendChild(ft)}let ce=document.createElement("div"),P=document.createElement("p"),oe=document.createElement("p"),se=document.createElement("p");ce.style.width="250px",ce.style.display="flex",ce.style.justifyContent="space-between",P.innerText="0",oe.innerText="50",se.innerText="100",ce.appendChild(P),ce.appendChild(oe),ce.appendChild(se),te.appendChild(k),te.appendChild(ce),n.appendChild(te);let xe=document.createElement("button"),Ge=document.createElement("div");xe.setAttribute("id","confirmBtn"),Ge.style.width="100%",Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.justifyContent="center",Ge.style.borderTop="2px solid rgba(0, 0, 0, .1)",xe.innerText="Continuar",xe.style.width="100%",xe.style.height="70px",xe.style.backgroundColor="#FFF",xe.style.border="none",xe.style.color="rgba(0, 0, 0, .7)",xe.style.fontWeight="bold",xe.style.borderRadius="10px",xe.style.paddingTop="5px",xe.style.paddingBottom="5px",xe.addEventListener("click",()=>{this.closeCheckDevices(),e({cameraId:v?.value,microphoneId:ee?.value})}),Ge.appendChild(xe),n.appendChild(Ge),r.appendChild(n),document.body.appendChild(r),this.startCheckDevices(this.options,this.videoOptions)})}videoDeviceInterface(e){let r=document.querySelector("#cameraStream");r&&(r.srcObject=e,r.play())}audioDeviceInterface(e){let n=document.querySelector("#audioStream")?.querySelectorAll("div"),i=document.querySelector("#audioText");this.volumeMeter=new Ha(this.cameraRecorder.cameraStream),this.volumeMeter.start({setVolume:a=>{this.volumeCounter++,this.volumeSum+=a;let s=a/4;n?.forEach((v,d)=>{d<Math.ceil(s)?v.style.backgroundColor="rgb(22, 163, 74)":v.style.backgroundColor="rgba(0, 0, 0, .3)"}),i&&(i.innerText=a.toFixed(0).toString())}}).catch(a=>{console.log(a),this.volumeMeter=void 0})}async setSelectOption(e){let r=document.querySelector("#cameraSelect"),n=document.querySelector("#micSelect"),i=await xn();r&&(r.value=e.cameraId||"default"),n&&(n.value=e.microphoneId||"default");let a=(s,v)=>{let d=document.createElement("option");return d.setAttribute("value",v),d.innerHTML=s,d};i.cameras.forEach(s=>{let v=a(s.label,s.id);r?.appendChild(v)}),i.microphones.forEach(s=>{let v=a(s.label,s.id);n?.appendChild(v)}),this.onSelectOptionChange()}async onSelectOptionChange(){let e=document.querySelector("#cameraSelect"),r=document.querySelector("#micSelect");e?.addEventListener("change",async()=>{await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new zn({cameraId:e?.value,microphoneId:r?.value},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)}),r?.addEventListener("change",async()=>{await this.cameraRecorder.stopRecording(),this.volumeMeter?.stop(),this.cameraRecorder=new zn({cameraId:e?.value,microphoneId:r?.value},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream)})}async startCheckDevices(e=bi,r){return this.setSelectOption(e),this.videoOptions=Ks(r),await Ko(),this.cameraRecorder=new zn({cameraId:e.cameraId,microphoneId:e.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height}),await this.cameraRecorder.startRecording(),this.videoDeviceInterface(this.cameraRecorder.cameraStream),this.audioDeviceInterface(this.cameraRecorder.cameraStream),{cameraStream:this.cameraRecorder.cameraStream}}async closeCheckDevices(){document.querySelector("#checkDevices")?.remove(),this.volumeMeter?.stop(),this.volumeMedia=Math.ceil(this.volumeSum/this.volumeCounter),await this.cameraRecorder.stopRecording()}};var Bf="not_shared_first_screen",Ys="multiple_monitors_detected",Nf="proctoring_already_started",$s="proctoring_not_started";var Zs=class{constructor(){this.hasExtension=!1;this.tryes=0;this.responseStart=!1}start(){let e;return new Promise((r,n)=>{window.postMessage({type:"easyproctor",func:"startExtensionEasyproctor"},"*"),e=setInterval(()=>{this.tryes>10&&(clearInterval(e),n(new Error("N\xE3o foi poss\xEDvel se conectar com a extens\xE3o"))),this.responseStart&&(clearInterval(e),r(this.responseStart)),this.tryes++},1e3)})}sendVerifyMsg(e,r){window.postMessage({type:"easyproctor",func:"verifyExtensionEasyproctor",url:e,token:r},"*")}verify(e){return e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="progress"&&this.options.onProgress&&this.options.onProgress(100),e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="start"&&(this.responseStart=!0),new Promise((r,n)=>{e.source==window&&e.data.sender&&e.data.sender==="easyproctor-extension"&&e.data.message_name&&e.data.message_name==="version"&&(this.hasExtension=!0,r(this.hasExtension))})}addEventListener(){window.addEventListener("message",e=>this.verify(e))}};var Qs=class{constructor(e,r){this.repositoryDevices=e,this.proctoringId=r}startRecording(e){navigator.mediaDevices.ondevicechange=()=>{this.onChangeDevices(e)}}async onChangeDevices(e){let r=await xn(),n=(z,ee)=>z.label===ee.label&&z.id===ee.id,i=(z,ee,te)=>z.filter(k=>!ee.some(ce=>te(k,ce))),a=await this.repositoryDevices.getDevices("devices"),s={label:"",id:""},v={cameras:a?.cameras||[s],microphones:a?.microphones||[s]},d,p;r.cameras.length!=v?.cameras.length&&(d=r.cameras.length>v?.cameras.length?i(r.cameras,v?.cameras,n):i(v?.cameras,r.cameras,n),d=d.filter(z=>z.id!="default")),r.microphones.length!=v?.microphones.length&&(p=r.microphones.length>v?.microphones.length?i(r.microphones,v?.microphones,n):i(v?.microphones,r.microphones,n),p=p.filter(z=>z.id!="default"&&z.id!="communications"));let B={cameras:d||[],microphones:p||[],status:r.cameras.length>v?.cameras.length||r.microphones.length>v?.microphones.length?"in":"out"};await this.repositoryDevices.save({...r,id:"devices",status:r.cameras.length>v?.cameras.length||r.microphones.length>v?.microphones.length?"in":"out"}),e.status&&(B.cameras.length!=0||B.microphones.length!=0)&&(Yt.registerChangeDevice(this.proctoringId,B.status,B),e.status(B))}};var Dm="https://proctoring-api-dev.easyproctor.tech/api",Om="https://proctoring-api-hml.easyproctor.tech/api",kf="https://proctoring-api.easyproctor.tech/api",Js=class{constructor(e){this.options=e;this.baseUrl=this.selectBaseUrl(e.type)}selectBaseUrl(e){return e==="dev"?Dm:e==="homol"?Om:kf}async confirmStart(e,r){return await this.makeRequest({path:`/proctoring/start/${e.examId}`,method:"POST",body:{clientId:e.clientId,proctoringType:r},jwt:e.token})}async getInsights(e){return(await this.makeRequestAxios({path:"/AzureKey/getInsights",method:"GET",jwt:e.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getAzureBlobUrl(e){return(await this.makeRequestAxios({path:"/AzureKey/get-blob-url",method:"GET",jwt:e.token}).catch(n=>{throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde"})).data}async getAzureSignedUrl(e,r,n){return(await this.makeRequestAxios({path:"/AzureKey/signed-url",method:"POST",jwt:e,body:{objectName:r.type==="image/jpeg"&&n?`${n}/${r.name}`:r.name,contentType:r.type}})).data}async getAzureSignedUrlImage(e,r){return(await this.makeRequestAxios({path:"/AzureKey/signed-url",method:"POST",jwt:e,body:{objectName:r.name,contentType:r.type}})).data}async getAwsSignedUrl(e,r){return(await this.makeRequestAxios({path:"/AwsKey/signed-url",method:"POST",jwt:e,body:{objectName:r.name,contentType:r.type}})).data}async sendAwsToAzure(e,r){await this.makeRequest({path:"/Proctoring/aws-to-azure",method:"POST",jwt:e,body:{objectName:`${r.name}`}})}async saveScreenAlerts(e,r){await this.makeRequest({path:"/proctoring/save-screen",method:"POST",jwt:e.token,body:{proctoringId:r.id,alerts:r.alerts}})}async finishAndSendUrls(e,r){let n=new Date().toISOString(),i=r.recordings.find(z=>z.origin==="Camera")?.upload,a=r.recordings.find(z=>z.origin==="Mic")?.upload,s=r.recordings.find(z=>z.origin==="Screen")?.upload,v=z=>z?z.substring(0,z.indexOf("?")):void 0,d=v(i?.azureUrl),p=v(a?.azureUrl),B=v(s?.azureUrl);if(!d||!p||!B){let z=await this.getAzureBlobUrl(e);!d&&(d=`${z}/${r.recordings.find(ee=>ee.origin==="Camera")?.file.name}`),!p&&(p=`${z}/${r.recordings.find(ee=>ee.origin==="Mic")?.file.name}`),!B&&r.recordings.find(ee=>ee.origin==="Screen")&&(B=`${z}/${r.recordings.find(ee=>ee.origin==="Screen")?.file.name}`)}await this.makeRequest({path:`/proctoring/finish/${e.examId}`,method:"POST",body:{endDate:n,videoCameraUrl:d,audioCameraUrl:p,videoScreenUrl:B},jwt:e.token})}async getServerHour(e){return await this.makeRequest({path:"/Proctoring/server-hour",method:"GET",jwt:e})}async makeRequest(e){let{path:r,method:n,body:i,jwt:a}=e,s=await fetch(this.baseUrl+r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let v=s.headers.get("content-type");return(v?v.includes("application/json"):!1)?await s.json():null}async makeRequestAxios(e){let{path:r,method:n,body:i,jwt:a}=e,s=await ua.request({url:this.baseUrl+r,method:n,headers:{Authorization:`Bearer ${a}`,"Access-Control-Allow-Origin":"*"},data:i});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";return s}async makeRequestPUT(e){let{url:r,method:n,body:i,jwt:a}=e,s=await fetch(r,{method:n,body:i!=null?JSON.stringify(i):void 0,headers:{Accept:"*/*","Accept-Encoding":"gzip, deflate, br",Connection:"keep-alive","aeg-event-type":"Notification","Content-Type":"application/json","Cache-Control":"no-cache","x-ms-blob-type":"BlockBlob"}});if(s.status>=400)throw"N\xE3o foi poss\xEDvel realizar a requisi\xE7\xE3o, tente novamente mais tarde";let v=s.headers.get("content-type");return(v?v.includes("application/json"):!1)?await s.json():null}};var Va=class{constructor(e){this.loadingBoolean=!0;this.proctoringId=e}async upload(e,r){try{let{file:n,onProgress:i}=e,a=URL.createObjectURL(n),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=a,s.download=n.name,s.click(),window.URL.revokeObjectURL(a),this.loadingBoolean=!1,clearInterval(this.loadingInterval),i&&i(Math.round(100))}catch{throw new Error("Error on machine download")}}};var e0=class{constructor(e,r){this.session=e;this.recorders=r}async startAll(){this.session.start();let e=this.recorders.map(r=>r.startRecording());await Promise.all(e)}async pauseAll(){this.session.pause();let e=this.recorders.map(r=>r.pauseRecording());await Promise.all(e)}async resumeAll(){this.session.resume();let e=this.recorders.map(r=>r.resumeRecording());await Promise.all(e)}async stopAll(){let e=this.recorders.map(r=>r.stopRecording());await Promise.all(e),this.session.stop()}async saveAllOnSession(){let e=this.recorders.map(r=>{r.saveOnSession(this.session)});await Promise.all(e)}};var qa=class{constructor(e,r,n){this.session=e;this.proctoringId=r;this.uploadServices=n}async upload(e,r){await this.uploadRecordings(e,r)}async uploadRecordings(e,r){await this.uploadAllFiles(e,r),this.session.hasSomethingToUpload||this.session.setUploaded()}async uploadAllFiles(e,r){for(let n=0;n<this.session.recordings.length;n++){let i=this.session.recordings[n];if(i.upload)continue;let a=v=>{let d=(n*100+v)/this.session.recordings.length;r&&r(d)},s=await this.uploadFile(i,e,a).catch(()=>{});s&&(i.upload||(i.upload={storage:"AzureBlob",awsUrl:"",azureUrl:""}),s.uploaded&&(i.upload.storage=s.storage),s.storage==="AzureBlob"?i.upload.azureUrl=s.url:i.upload.awsUrl=s.url)}r&&r(100)}async uploadFile(e,r,n){for await(let i of this.uploadServices){let a=await i.upload({file:e.file,onProgress:s=>{n&&n(s)}},r);if(a){let s="";return e.file.name.search("camera")!==-1?s="Camera":e.file.name.search("screen")!==-1?s="Screen":e.file.name.search("audio")!==-1&&(s="Audio"),Yt.registerUploadFile(this.proctoringId,`Upload File
46
56
  Name: ${e.file.name}
47
57
  Type: ${e.file.type}
48
- Size: ${e.file.size}`,s),a}}throw new Error("Could not upload")}};var t0=class{constructor(e,r,n){this.alerts=[];this.onLostFocusCallback=e.onLostFocusCallback,this.onFocusCallback=e.onFocusCallback,this.onNoiseDetectedCallback=e.onNoiseDetectedCallback,this.optionsProctoring=r,this.cameraRecorder=n}async startRecording(){this.startTime=new Date(Date.now()),this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetected(),500),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()))}async pauseRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus()),window.removeEventListener("focus",()=>this.onNoiseDetected()),this.volumeMeter.stop(),clearInterval(this.intervalNoiseDetection)}async resumeRecording(){this.volumeMeter=void 0,this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetected(),500),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()),window.addEventListener("focus",()=>this.onNoiseDetected()))}async stopRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus()),window.removeEventListener("focus",()=>this.onNoiseDetected()),this.volumeMeter.stop(),clearInterval(this.intervalNoiseDetection)}async saveOnSession(e){this.alerts.forEach(r=>{e.addAlert(r)})}onLostFocus(){Date.now()-this.startTime?.getTime()>1e4&&(this.onLostFocusCallback(),this.alerts.push({begin:Date.now()-this.startTime.getTime(),end:0,alert:25}))}onReturnFocus(){let e=this.alerts[this.alerts.length-1];e&&(this.onFocusCallback(),e.end=Date.now()-this.startTime.getTime())}onNoiseDetected(){!this.volumeMeter&&this.cameraRecorder.cameraStream&&(this.volumeMeter=new Ha(this.cameraRecorder.cameraStream),this.volumeMeter.start().catch(e=>{console.log(e),this.volumeMeter=void 0})),this.volumeMeter?.getVolume()>=(this.optionsProctoring.noiseLimit||40)&&this.onNoiseDetectedCallback()}};var Lm=kf();function Of(t){return new Lm(t)}var r0=class{constructor(){this.blobs=[]}async startRecording(){this.recorder=Of({bitRate:128}),this.recorder.start().catch(e=>{throw new Error("Error on Audio to Start Recording")})}async pauseRecording(){}async resumeRecording(){}async stopRecording(){if(!this.recorder)return;let e=await this.recorder.stop().getMp3().then(async([r,n])=>({buffer:r,blob:n})).catch(r=>{alert("We could not retrieve your message")});e&&this.blobs.push(e.blob)}async saveOnSession(e){e.addRecording({device:"",file:new File(this.blobs,`EP_${e.id}_audio_0.mp3`,{type:"audio/mp3"}),origin:"Mic"})}};var n0=class{constructor(e){this.blobs=[];this.blobsFinal=[];this.options=e}async startRecording(){this.startTime=new Date(Date.now());let{allowOnlyFirstMonitor:e,onStopSharingScreenCallback:r}=this.options,n={video:{cursor:"always"},audio:!1};this.screenStream=await navigator.mediaDevices.getDisplayMedia(n);let i=this.screenStream.getVideoTracks();if(i[0].onended=r,navigator.userAgent.indexOf("Firefox")>-1&&!i.find(B=>B.label=="Primary Monitor")&&e)throw Ys;if(!(i.find(p=>["screen:0:0","Primary Monitor"].includes(p.label))!=null)&&e)throw i.forEach(p=>{p.stop()}),Bf;let{startRecording:v,stopRecording:d}=Qa(this.screenStream,this.blobs);this.recordingStart=v,this.recordingStop=d,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){await this.recordingStop()}async saveOnSession(e){e.addRecording({device:"",file:new File(this.blobs,`EP_${e.id}_screen_0.webm`,{type:"video/webm"}),origin:"Screen"})}};var Do=class{constructor(e,r){this.dbName="EasyProctorDb";this.dbVersion=2;this.storeName="exams2";this.dbName=e,this.storeName=r}async save(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.put(e),r).then(()=>{})}async delete(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.delete(e),r)}async get(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(e),r).catch(()=>{})}async getDevices(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(e),r).catch(()=>{})}async list(){let{transaction:e,store:r}=await this.connectToStore("readonly");return this.processRequest(r.getAll(),e)}async clear(){let{transaction:e,store:r}=await this.connectToStore("readwrite");return this.processRequest(r.clear(),e)}async processRequest(e,r){return new Promise((n,i)=>{e.onerror=a=>{i(e.error?.message)},e.onsuccess=a=>{r.commit(),n(e.result)}})}async hasSessions(){return(await this.list()).length>0}async connectToStore(e){let i=(await this.connect()).result.transaction(this.storeName,e),a=i.objectStore(this.storeName);return{transaction:i,store:a}}async connect(){return this.connection?this.connection:new Promise((e,r)=>{let n=window.indexedDB.open(this.dbName,this.dbVersion);n.onerror=i=>{r("Can't connect to IndexedDB")},n.onupgradeneeded=i=>{let a=n.result;a.onerror=s=>{},a.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=i=>{this.connection=n,e(n)}})}};var ko=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=d=>{let p=d.loadedBytes/n.size*100;i&&i(Math.round(p))},s=await this.backend.getAwsSignedUrl(r,n),v=await ua.request({url:s,method:"PUT",headers:{"Content-Type":n.type},data:n,onUploadProgress:d=>{a({loadedBytes:d.loaded})}}).then(()=>!0).catch(()=>!1);return await this.backend.sendAwsToAzure(r,n),{storage:"AwsS3",url:s,uploaded:v}}catch{throw Yt.registerError(this.proctoringId,`Failed to upload to AWS
58
+ Size: ${e.file.size}`,s),a}}throw new Error("Could not upload")}};var t0=class{constructor(e,r,n){this.alerts=[];this.onLostFocusCallback=e.onLostFocusCallback,this.onFocusCallback=e.onFocusCallback,this.onNoiseDetectedCallback=e.onNoiseDetectedCallback,this.optionsProctoring=r,this.cameraRecorder=n}async startRecording(){this.startTime=new Date(Date.now()),this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetected(),500),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()))}async pauseRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus()),window.removeEventListener("focus",()=>this.onNoiseDetected()),this.volumeMeter.stop(),clearInterval(this.intervalNoiseDetection)}async resumeRecording(){this.volumeMeter=void 0,this.intervalNoiseDetection=setInterval(()=>this.onNoiseDetected(),500),this.optionsProctoring.captureScreen&&(window.addEventListener("blur",()=>this.onLostFocus()),window.addEventListener("focus",()=>this.onReturnFocus()),window.addEventListener("focus",()=>this.onNoiseDetected()))}async stopRecording(){window.removeEventListener("blur",()=>this.onLostFocus()),window.removeEventListener("focus",()=>this.onReturnFocus()),window.removeEventListener("focus",()=>this.onNoiseDetected()),this.volumeMeter.stop(),clearInterval(this.intervalNoiseDetection)}async saveOnSession(e){this.alerts.forEach(r=>{e.addAlert(r)})}onLostFocus(){Date.now()-this.startTime?.getTime()>1e4&&(this.onLostFocusCallback(),this.alerts.push({begin:Date.now()-this.startTime.getTime(),end:0,alert:25}))}onReturnFocus(){let e=this.alerts[this.alerts.length-1];e&&(this.onFocusCallback(),e.end=Date.now()-this.startTime.getTime())}onNoiseDetected(){!this.volumeMeter&&this.cameraRecorder.cameraStream&&(this.volumeMeter=new Ha(this.cameraRecorder.cameraStream),this.volumeMeter.start().catch(e=>{console.log(e),this.volumeMeter=void 0})),this.volumeMeter?.getVolume()>=(this.optionsProctoring.noiseLimit||40)&&this.onNoiseDetectedCallback()}};var Lm=Df();function Of(t){return new Lm(t)}var r0=class{constructor(){this.blobs=[]}async startRecording(){this.recorder=Of({bitRate:128}),this.recorder.start().catch(e=>{throw new Error("Error on Audio to Start Recording")})}async pauseRecording(){}async resumeRecording(){}async stopRecording(){if(!this.recorder)return;let e=await this.recorder.stop().getMp3().then(async([r,n])=>({buffer:r,blob:n})).catch(r=>{alert("We could not retrieve your message")});e&&this.blobs.push(e.blob)}async saveOnSession(e){e.addRecording({device:"",file:new File(this.blobs,`EP_${e.id}_audio_0.mp3`,{type:"audio/mp3"}),origin:"Mic"})}};var n0=class{constructor(e){this.blobs=[];this.blobsFinal=[];this.options=e}async startRecording(){this.startTime=new Date(Date.now());let{allowOnlyFirstMonitor:e,onStopSharingScreenCallback:r}=this.options,n={video:{cursor:"always"},audio:!1};this.screenStream=await navigator.mediaDevices.getDisplayMedia(n);let i=this.screenStream.getVideoTracks();if(i[0].onended=r,navigator.userAgent.indexOf("Firefox")>-1&&!i.find(B=>B.label=="Primary Monitor")&&e)throw Ys;if(!(i.find(p=>["screen:0:0","Primary Monitor"].includes(p.label))!=null)&&e)throw i.forEach(p=>{p.stop()}),Bf;let{startRecording:v,stopRecording:d}=Qa(this.screenStream,this.blobs);this.recordingStart=v,this.recordingStop=d,this.recordingStart()}async pauseRecording(){}async resumeRecording(){}async stopRecording(){await this.recordingStop()}async saveOnSession(e){e.addRecording({device:"",file:new File(this.blobs,`EP_${e.id}_screen_0.webm`,{type:"video/webm"}),origin:"Screen"})}};var ko=class{constructor(e,r){this.dbName="EasyProctorDb";this.dbVersion=2;this.storeName="exams2";this.dbName=e,this.storeName=r}async save(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.put(e),r).then(()=>{})}async delete(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.delete(e),r)}async get(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(e),r).catch(()=>{})}async getDevices(e){let{transaction:r,store:n}=await this.connectToStore("readwrite");return this.processRequest(n.get(e),r).catch(()=>{})}async list(){let{transaction:e,store:r}=await this.connectToStore("readonly");return this.processRequest(r.getAll(),e)}async clear(){let{transaction:e,store:r}=await this.connectToStore("readwrite");return this.processRequest(r.clear(),e)}async processRequest(e,r){return new Promise((n,i)=>{e.onerror=a=>{i(e.error?.message)},e.onsuccess=a=>{r.commit(),n(e.result)}})}async hasSessions(){return(await this.list()).length>0}async connectToStore(e){let i=(await this.connect()).result.transaction(this.storeName,e),a=i.objectStore(this.storeName);return{transaction:i,store:a}}async connect(){return this.connection?this.connection:new Promise((e,r)=>{let n=window.indexedDB.open(this.dbName,this.dbVersion);n.onerror=i=>{r("Can't connect to IndexedDB")},n.onupgradeneeded=i=>{let a=n.result;a.onerror=s=>{},a.createObjectStore(this.storeName,{keyPath:"id"})},n.onsuccess=i=>{this.connection=n,e(n)}})}};var Do=class{constructor(e,r){this.backend=r;this.proctoringId=e}async upload(e,r){let{file:n,onProgress:i}=e;try{let a=d=>{let p=d.loadedBytes/n.size*100;i&&i(Math.round(p))},s=await this.backend.getAwsSignedUrl(r,n),v=await ua.request({url:s,method:"PUT",headers:{"Content-Type":n.type},data:n,onUploadProgress:d=>{a({loadedBytes:d.loaded})}}).then(()=>!0).catch(()=>!1);return await this.backend.sendAwsToAzure(r,n),{storage:"AwsS3",url:s,uploaded:v}}catch{throw Yt.registerError(this.proctoringId,`Failed to upload to AWS
49
59
  File name: ${n.name}
50
60
  File type: ${n.type}
51
- File size: ${n.size}`),new Error("Failed to upload to AWS")}}};function xc(){let t=window.navigator.userAgent.split("SEB/");return t.length>1?t[1]:"1.0.0.0"}var i0=class{constructor(e){this.context=e;this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{console.log("Stop sharing screen"),Yt.registerStopSharingScreen(this.proctoringId,"Stop sharing screen")};this.onLostFocusCallback=()=>{};this.onFocusCallback=()=>{};this.onNoiseDetectedCallback=()=>{};this.backend=new Js({type:e.type}),this.repository=new Do("EasyProctorDb","exams2"),this.repositoryDevices=new Do("EasyProctorDbDevices","devices")}setOnStopSharingScreenCallback(e){this.onStopSharingScreenCallback=()=>e()}setOnLostFocusCallback(e){this.onLostFocusCallback=()=>e()}setOnFocusCallback(e){this.onFocusCallback=()=>e()}setOnNoiseDetectedCallback(e){this.onNoiseDetectedCallback=()=>e()}async onChangeDevices(e={}){new Qs(this.repositoryDevices,this.proctoringId).startRecording(e)}createRecorders(e=bi){let r=new zn({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height},this.backend,this.context.token,this.proctoringId),n=new r0,i=this.sessionOptions.captureScreen?new n0({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback()}):void 0,a=new t0({onFocusCallback:()=>this.onFocusCallback(),onLostFocusCallback:()=>this.onLostFocusCallback(),onNoiseDetectedCallback:()=>this.onNoiseDetectedCallback()},e,r);this.onChangeDevices();let s=[r,n,i,a].filter(Boolean);return this.recorder=new e0(this.proctoringSession,s),{cameraRecorder:r,audioRecorder:n,screenRecorder:i,alertRecorder:a}}async start(e=bi,r={}){this.extension=new Zs,this.extension.addEventListener();let n=this.backend.selectBaseUrl(this.context.type),i=await xn();if(await this.repositoryDevices.save({...i,id:"devices"}),this.sessionOptions={...bi,...e},this.videoOptions=Ks(r),this.state!="Stop")throw Nf;this.state="Starting",await this.initConfig(),await this.verifyMultipleMonitors(this.sessionOptions),await this.repository.hasSessions()&&await this.repository.clear();try{let a=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions.proctoringType);return this.proctoringId=a.id,this.proctoringSession=new Yo(this.proctoringId),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),await this.repository.save(this.proctoringSession),Yt.registerStart(this.proctoringId,!0,""),a.cameraStream=this.allRecorders.cameraRecorder.cameraStream,this.allRecorders.screenRecorder&&(a.screenStream=this.allRecorders.screenRecorder.screenStream),this.state="Recording",a}catch(a){throw await this.cancel(),Yt.registerStart(this.proctoringId,!1,`Token: ${this.context.token}
52
- Error: `+a),this.state="Stop",a}}async cancel(){this.state==="Recording"&&await this.recorder.stopAll(),this.state="Stop"}async finish(e={}){if(this.extension.options=e,this.state!=="Recording")throw $s;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession);let r,n;xc()!=="1.0.0.0"?(r=new qa(this.proctoringSession,this.proctoringId,[new Va(this.proctoringId)]),n="Download",this.serviceType="Download"):(r=new qa(this.proctoringSession,this.proctoringId,[new Ji(this.proctoringId,this.backend),new ko(this.proctoringId,this.backend),new Va(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload");let i=!1;this.extension.hasExtension&&await this.extension.start().then(a=>{i=a}).catch(a=>{i=!1}),(!i||!this.extension.hasExtension)&&(await r.upload(this.context.token,e.onProgress).catch(async a=>{Yt.registerUpload(this.proctoringSession.id,!1,`upload error: ${a}
61
+ File size: ${n.size}`),new Error("Failed to upload to AWS")}}};function xc(){let t=window.navigator.userAgent.split("SEB/");return t.length>1?t[1]:"1.0.0.0"}var i0=class{constructor(e){this.context=e;this.proctoringId="";this.insights=void 0;this.state="Stop";this.serviceType="Upload";this.onStopSharingScreenCallback=()=>{console.log("Stop sharing screen"),Yt.registerStopSharingScreen(this.proctoringId,"Stop sharing screen")};this.onLostFocusCallback=()=>{};this.onFocusCallback=()=>{};this.onNoiseDetectedCallback=()=>{};this.backend=new Js({type:e.type}),this.repository=new ko("EasyProctorDb","exams2"),this.repositoryDevices=new ko("EasyProctorDbDevices","devices")}setOnStopSharingScreenCallback(e){this.onStopSharingScreenCallback=()=>e()}setOnLostFocusCallback(e){this.onLostFocusCallback=()=>e()}setOnFocusCallback(e){this.onFocusCallback=()=>e()}setOnNoiseDetectedCallback(e){this.onNoiseDetectedCallback=()=>e()}async onChangeDevices(e={}){new Qs(this.repositoryDevices,this.proctoringId).startRecording(e)}createRecorders(e=bi){let r=new zn({cameraId:this.sessionOptions.cameraId,microphoneId:this.sessionOptions.microphoneId},{width:this.videoOptions.width,height:this.videoOptions.height},this.backend,this.context.token,this.proctoringId),n=new r0,i=this.sessionOptions.captureScreen?new n0({allowOnlyFirstMonitor:this.sessionOptions.allowOnlyFirstMonitor??!0,onStopSharingScreenCallback:()=>this.onStopSharingScreenCallback()}):void 0,a=new t0({onFocusCallback:()=>this.onFocusCallback(),onLostFocusCallback:()=>this.onLostFocusCallback(),onNoiseDetectedCallback:()=>this.onNoiseDetectedCallback()},e,r);this.onChangeDevices();let s=[r,n,i,a].filter(Boolean);return this.recorder=new e0(this.proctoringSession,s),{cameraRecorder:r,audioRecorder:n,screenRecorder:i,alertRecorder:a}}async start(e=bi,r={}){this.extension=new Zs,this.extension.addEventListener();let n=this.backend.selectBaseUrl(this.context.type),i=await xn();if(await this.repositoryDevices.save({...i,id:"devices"}),this.sessionOptions={...bi,...e},this.videoOptions=Ks(r),this.state!="Stop")throw Nf;this.state="Starting",await this.initConfig(),await this.verifyMultipleMonitors(this.sessionOptions),await this.repository.hasSessions()&&await this.repository.clear();try{let a=await this.backend.confirmStart({clientId:this.context.clientId,examId:this.context.examId,token:this.context.token},this.sessionOptions.proctoringType);return this.proctoringId=a.id,this.proctoringSession=new Yo(this.proctoringId),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),await this.repository.save(this.proctoringSession),Yt.registerStart(this.proctoringId,!0,""),a.cameraStream=this.allRecorders.cameraRecorder.cameraStream,this.allRecorders.screenRecorder&&(a.screenStream=this.allRecorders.screenRecorder.screenStream),this.state="Recording",a}catch(a){throw await this.cancel(),Yt.registerStart(this.proctoringId,!1,`Token: ${this.context.token}
62
+ Error: `+a),this.state="Stop",a}}async cancel(){this.state==="Recording"&&await this.recorder.stopAll(),this.state="Stop"}async finish(e={}){if(this.extension.options=e,this.state!=="Recording")throw $s;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession);let r,n;xc()!=="1.0.0.0"?(r=new qa(this.proctoringSession,this.proctoringId,[new Va(this.proctoringId)]),n="Download",this.serviceType="Download"):(r=new qa(this.proctoringSession,this.proctoringId,[new Ji(this.proctoringId,this.backend),new Do(this.proctoringId,this.backend),new Va(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload");let i=!1;this.extension.hasExtension&&await this.extension.start().then(a=>{i=a}).catch(a=>{i=!1}),(!i||!this.extension.hasExtension)&&(await r.upload(this.context.token,e.onProgress).catch(async a=>{Yt.registerUpload(this.proctoringSession.id,!1,`upload error: ${a}
53
63
 
54
- Upload Services: ${n}`,this.serviceType),xc()!=="1.0.0.0"&&(r=new qa(this.proctoringSession,this.proctoringId,[new Ji(this.proctoringId,this.backend),new ko(this.proctoringId,this.backend),new Va(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload",await r.upload(this.context.token,e.onProgress).catch(s=>{Yt.registerUpload(this.proctoringSession.id,!1,`upload backup error: ${s}
64
+ Upload Services: ${n}`,this.serviceType),xc()!=="1.0.0.0"&&(r=new qa(this.proctoringSession,this.proctoringId,[new Ji(this.proctoringId,this.backend),new Do(this.proctoringId,this.backend),new Va(this.proctoringId)]),n="Azure, AWS, Download",this.serviceType="Upload",await r.upload(this.context.token,e.onProgress).catch(s=>{Yt.registerUpload(this.proctoringSession.id,!1,`upload backup error: ${s}
55
65
 
56
66
  Upload Services: ${n}
57
67
  Upload backup for Safe Browser`,this.serviceType)}))}),Yt.registerUpload(this.proctoringSession.id,!0,`upload success
58
68
 
59
- Upload Services: ${n}`,this.serviceType)),await this.backend.saveScreenAlerts(this.context,this.proctoringSession).catch(a=>{Yt.registerFinish(this.proctoringSession.id,!1,"save-screen error: "+a)}),await this.backend.finishAndSendUrls(this.context,this.proctoringSession).then(()=>{Yt.registerFinish(this.proctoringSession.id,!0,"")}).catch(a=>{Yt.registerFinish(this.proctoringSession.id,!1,"finish error: "+a)}),this.state="Stop"}async verifyMultipleMonitors(e){if(!e.allowMultipleMonitors&&await Wo())throw Yt.registerError(this.proctoringId,"Multiplas telas detectadas!"),Ys}async initConfig(){try{this.insights=await this.backend.getInsights(this.context),this.insights&&Mf(this.insights)}catch(e){throw Yt.registerError(this.proctoringId,"Erro no initConfig!"),await this.cancel(),e}}async getServerDate(){let e=await this.backend.getServerHour(this.context.token).catch(n=>{Yt.registerError(this.proctoringId,"N\xE3o foi poss\xEDvel requisitar a data do servidor!")});return e?new Date(e.toString()):new Date}async pause(){if(this.state!=="Recording")throw Yt.registerError(this.proctoringId,"Proctoring n\xE3o iniciado!"),$s;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession),this.state="Paused"}async resume(){if(this.state!="Paused")throw $s;return await this.verifyMultipleMonitors(this.sessionOptions),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),this.proctoringSession.recordings=[],await this.repository.save(this.proctoringSession),this.state="Recording",{cameraStream:this.allRecorders.cameraRecorder.cameraStream,_screenStream:this.allRecorders.screenRecorder?.screenStream}}};function yc(t,e="prod"){let r=new i0({type:e,clientId:t.clientId,examId:t.examId,token:t.token}),n=new Ws,i=new Xs,a=r.start.bind(r),s=r.finish.bind(r),v=r.pause.bind(r),d=r.resume.bind(r),p=r.setOnFocusCallback.bind(r),B=r.setOnLostFocusCallback.bind(r),z=r.setOnNoiseDetectedCallback.bind(r),ee=r.onChangeDevices.bind(r),te=r.setOnStopSharingScreenCallback.bind(r),D=n.checkDevices.bind(n),ce=i.takePicture.bind(i);return{start:a,finish:s,onFocus:p,onLostFocus:B,onNoiseDetected:z,onChangeDevices:ee,checkDevices:D,capturePhoto:ce,pause:v,resume:d,enumarateDevices:xn,checkPermissions:Ko,checkIfhasMultipleMonitors:Wo,onStopSharingScreen:te}}typeof window<"u"&&(window.useProctoring=yc);})();
69
+ Upload Services: ${n}`,this.serviceType)),await this.backend.saveScreenAlerts(this.context,this.proctoringSession).catch(a=>{Yt.registerFinish(this.proctoringSession.id,!1,"save-screen error: "+a)}),await this.backend.finishAndSendUrls(this.context,this.proctoringSession).then(()=>{Yt.registerFinish(this.proctoringSession.id,!0,"")}).catch(a=>{Yt.registerFinish(this.proctoringSession.id,!1,"finish error: "+a)}),this.state="Stop"}async verifyMultipleMonitors(e){if(!e.allowMultipleMonitors&&await Wo())throw Yt.registerError(this.proctoringId,"Multiplas telas detectadas!"),Ys}async initConfig(){try{this.insights=await this.backend.getInsights(this.context),this.insights&&Mf(this.insights)}catch(e){throw Yt.registerError(this.proctoringId,"Erro no initConfig!"),await this.cancel(),e}}async getServerDate(){let e=await this.backend.getServerHour(this.context.token).catch(n=>{Yt.registerError(this.proctoringId,"N\xE3o foi poss\xEDvel requisitar a data do servidor!")});return e?new Date(e.toString()):new Date}async pause(){if(this.state!=="Recording")throw Yt.registerError(this.proctoringId,"Proctoring n\xE3o iniciado!"),$s;await this.recorder.stopAll(),await this.recorder.saveAllOnSession(),await this.repository.save(this.proctoringSession),this.state="Paused"}async resume(){if(this.state!="Paused")throw $s;return await this.verifyMultipleMonitors(this.sessionOptions),this.allRecorders=this.createRecorders(this.sessionOptions),await this.recorder.startAll(),this.proctoringSession.recordings=[],await this.repository.save(this.proctoringSession),this.state="Recording",{cameraStream:this.allRecorders.cameraRecorder.cameraStream,_screenStream:this.allRecorders.screenRecorder?.screenStream}}};function yc(t,e="prod"){let r=new i0({type:e,clientId:t.clientId,examId:t.examId,token:t.token}),n=new Ws,i=new Xs,a=r.start.bind(r),s=r.finish.bind(r),v=r.pause.bind(r),d=r.resume.bind(r),p=r.setOnFocusCallback.bind(r),B=r.setOnLostFocusCallback.bind(r),z=r.setOnNoiseDetectedCallback.bind(r),ee=r.onChangeDevices.bind(r),te=r.setOnStopSharingScreenCallback.bind(r),k=n.checkDevices.bind(n),ce=i.takePicture.bind(i);return{start:a,finish:s,onFocus:p,onLostFocus:B,onNoiseDetected:z,onChangeDevices:ee,checkDevices:k,capturePhoto:ce,pause:v,resume:d,enumarateDevices:xn,checkPermissions:Ko,checkIfhasMultipleMonitors:Wo,onStopSharingScreen:te}}typeof window<"u"&&(window.useProctoring=yc);})();
60
70
  /*!
61
71
  * Microsoft Dynamic Proto Utility, 1.1.4
62
72
  * Copyright (c) Microsoft and contributors. All rights reserved.