varute=Object.create;varB6=Object.defineProperty;varcte=Object.getOwnPropertyDescriptor;varpte=Object.getOwnPropertyNames;varfte=Object.getPrototypeOf,dte=Object.prototype.hasOwnProperty;vark=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),SA=(t,e)=>{for(varnine)B6(t,n,{get:e[n],enumerable:!0})},TA=(t,e,n,r)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofpte(e))!dte.call(t,i)&&i!==n&&B6(t,i,{get:()=>e[i],enumerable:!(r=cte(e,i))||r.enumerable});returnt};varYr=(t,e,n)=>(n=t!=null?ute(fte(t)):{},TA(e||!t||!t.__esModule?B6(n,"default",{value:t,enumerable:!0}):n,t)),hte=t=>TA(B6({},"__esModule",{value:!0}),t);varAA=k((MOe,xA)=>{"use strict";functionmte(t){vare=newt,n=e;functionr(){varl=e;returnl.next?e=l.next:(e=newt,n=e),l.next=null,l}functioni(l){n.next=l,n=l}return{get:r,release:i}}xA.exports=mte});varId=k(($Oe,Rd)=>{"use strict";varyte=AA();functionOA(t,e,n){if(typeoft=="function"&&(n=e,e=t,t=null),!(n>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");varr=yte(gte),i=null,l=null,s=0,a=null,o={push:_,drain:Kl,saturated:Kl,pause:c,paused:!1,getconcurrency(){returnn},setconcurrency(x){if(!(x>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");if(n=x,!o.paused)for(;i&&s<n;)s++,w()},running:u,resume:d,idle:y,length:f,getQueue:m,unshift:S,empty:Kl,kill:E,killAndDrain:g,error:v};returno;functionu(){returns}functionc(){o.paused=!0}functionf(){for(varx=i,O=0;x;)x=x.next,O++;returnO}functionm(){for(varx=i,O=[];x;)O.push(x.value),x=x.next;returnO}functiond(){if(o.paused)for(o.paused=!1;i&&s<n;)s++,w()}functiony(){returns===0&&o.length()===0}function_(x,O){varN=r.get();N.context=t,N.release=w,N.value=x,N.callback=O||Kl,N.errorHandler=a,s>=n||o.paused?l?(l.next=N,l=N):(i=N,l=N,o.saturated()):(s++,e.call(t,N.value,N.worked))}functionS(x,O){varN=r.get();N.context=t,N.release=w,N.value=x,N.callback=O||Kl,N.errorHandler=a,s>=n||o.paused?i?(N.next=i,i=N):(i=N,l=N,o.saturated()):(s++,e.call(t,N.value,N.worked))}functionw(x){x&&r.release(x);varO=i;O&&s<=n?o.paused?s--:(l===i&&(l=null),i=O.next,O.next=null,e.call(t,O.value,O.worked),l===null&&o.empty()):--s===0&&o.drain()}functionE(){i=null,l=null,o.drain=Kl}functiong(){i=null,l=null,o.drain(),o.drain=Kl}functionv(x){a=x}}functionKl(){}functiongte(){this.value=null,this.callback=Kl,this.next=null,this.release=Kl,this.context=null,this.errorHandler=null;vart=this;this.worked=function(n,r){vari=t.callback,l=t.errorHandler,s=t.value;t.value=null,t.callback=Kl,t.errorHandler&&l(n,s),i.call(t.context,n,r),t.release(t)}}functionvte(t,e,n){typeoft=="function"&&(n=e,e=t,t=null);functionr(c,f){e.call(this,c).then(function(m){f(null,m)},f)}vari=OA(t,r,n),l=i.push,s=i.unshift;returni.push=a,i.unshift=o,i.drained=u,i;functiona(c){varf=newPromise(function(m,d){l(c,function(y,_){if(y){d(y);return}m(_)})});returnf.catch(Kl),f}functiono(c){varf=newPromise(function(m,d){s(c,function(y,_){if(y){d(y);return}m(_)})});returnf.catch(Kl),f}functionu(){if(i.idle())returnnewPromise(function(m){m()});varc=i.drain,f=newPromise(function(m){i.drain=function(){c(),m()}});returnf}}Rd.exports=OA;Rd.exports.promise=vte});varDd=k((BOe,NA)=>{"use strict";var{inherits:_te,format:kd}=require("util");functionm3(t,e,n=Error){if(!t)thrownewError("Avvio error code must not be empty");if(!e)thrownewError("Avvio base error message must not be empty");functionr(i,l,s){if(!new.target)returnnewr(i,l,s);Error.captureStackTrace(this,r),this.code=t,this.message=e,this.name="AvvioError",i&&l&&s?this.message=kd(e,i,l,s):i&&l?this.message=kd(e,i,l):i?this.message=kd(e,i):this.message=e}returnr.prototype[Symbol.toStringTag]="Error",r.prototype.toString=function(){return`${this.name} [${this.code}]: ${this.message}`},_te(r,n),r}NA.exports={createError:m3,AVV_ERR_EXPOSE_ALREADY_DEFINED:m3("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' () is already defined, specify an expose option"),AVV_ERR_CALLBACK_NOT_FN:m3("AVV_ERR_CALLBACK_NOT_FN","Callbackfor'%s'hookisnotafunction.Received:'%s
deps:${n}}`};var v1e={keyword:"dependencies",type:"object",schemaType:"object",error:Qs.error,code(t){let[e,n]=_1e(t);FI(t,e),jI(t,n)}};function _1e({schema:t}){let e={},n={};for(let r in t){if(r==="__proto__")continue;let i=Array.isArray(t[r])?e:n;i[r]=t[r]}return[e,n]}function FI(t,e=t.schema){let{gen:n,data:r,it:i}=t;if(Object.keys(e).length===0)return;let l=n.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let o=(0,M4.propertyInData)(n,r,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?n.if(o,()=>{for(let u of a)(0,M4.checkReportMissingProp)(t,u)}):(n.if((0,_y._)`${o}&&(${(0,M4.checkMissingProp)(t,a,l)})`),(0,M4.reportMissingProp)(t,l),n.else())}}Qs.validatePropertyDeps=FI;function jI(t,e=t.schema){let{gen:n,data:r,keyword:i,it:l}=t,s=n.name("valid");for(let a in e)(0,g1e.alwaysValidSchema)(l,e[a])||(n.if((0,M4.propertyInData)(n,r,a,l.opts.ownProperties),()=>{let o=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(o,s)},()=>n.var(s,!0)),t.ok(s))}Qs.validateSchemaDeps=jI;Qs.default=v1e});var $I=k(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});var MI=st(),E1e=Nt(),b1e={message:"property name must be valid",params:({params:t})=>(0,MI._)`{propertyName:${t.propertyName}}`},w1e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:b1e,code(t){let{gen:e,schema:n,data:r,it:i}=t;if((0,E1e.alwaysValidSchema)(i,n))return;let l=e.name("valid");e.forIn("key",r,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},l),e.if((0,MI.not)(l),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(l)}};Ey.default=w1e});var wy=k(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var G8=Ai(),ws=st(),S1e=Yl(),J8=Nt(),T1e={message:"must NOT have additional properties",params:({params:t})=>(0,ws._)`{additionalProperty:${t.additionalProperty}}`},x1e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:T1e,code(t){let{gen:e,schema:n,parentSchema:r,data:i,errsCount:l,it:s}=t;if(!l)throw new Error("ajv implementation error");let{allErrors:a,opts:o}=s;if(s.props=!0,o.removeAdditional!=="all"&&(0,J8.alwaysValidSchema)(s,n))return;let u=(0,G8.allSchemaProperties)(r.properties),c=(0,G8.allSchemaProperties)(r.patternProperties);f(),t.ok((0,ws._)`${l}===${S1e.default.errors}`);function f(){e.forIn("key",i,S=>{!u.length&&!c.length?y(S):e.if(m(S),()=>y(S))})}function m(S){let w;if(u.length>8){let E=(0,J8.schemaRefOrVal)(s,r.properties,"properties");w=(0,G8.isOwnProperty)(e,E,S)}else u.length?w=(0,ws.or)(...u.map(E=>(0,ws._)`${S}===${E}`)):w=ws.nil;return c.length&&(w=(0,ws.or)(w,...c.map(E=>(0,ws._)`${(0,G8.usePattern)(t,E)}.test(${S})`))),(0,ws.not)(w)}function d(S){e.code((0,ws._)`delete${i}[${S}]`)}function y(S){if(o.removeAdditional==="all"||o.removeAdditional&&n===!1){d(S);return}if(n===!1){t.setParams({additionalProperty:S}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,J8.alwaysValidSchema)(s,n)){let w=e.name("valid");o.removeAdditional==="failing"?(_(S,w,!1),e.if((0,ws.not)(w),()=>{t.reset(),d(S)})):(_(S,w),a||e.if((0,ws.not)(w),()=>e.break()))}}function _(S,w,E){let g={keyword:"additionalProperties",dataProp:S,dataPropType:J8.Type.Str};E===!1&&Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(g,w)}}};by.default=x1e});var VI=k(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});var A1e=s1(),BI=Ai(),Sy=Nt(),HI=wy(),O1e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:i,it:l}=t;l.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&HI.default.code(new A1e.KeywordCxt(l,HI.default,"additionalProperties"));let s=(0,BI.allSchemaProperties)(n);for(let f of s)l.definedProperties.add(f);l.opts.unevaluated&&s.length&&l.props!==!0&&(l.props=Sy.mergeEvaluated.props(e,(0,Sy.toHash)(s),l.props));let a=s.filter(f=>!(0,Sy.alwaysValidSchema)(l,n[f]));if(a.le
`;let a=new G9e(e),o=new J9e(e.ajv);for(let c of n.validatorSchemasIds){let f=n.refResolver.getSchema(c);o.addSchema(f,c);let m=n.refResolver.getSchemaDependencies(c);for(let[d,y]of Object.entries(m))o.addSchema(y,d)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:o,serializer:a,code:`validator
${s}`,ajv:o.ajv};let u=new Function("validator","serializer",s);return e.mode==="standalone"?Zy()(u,n,a,o):u(o,a)}var W9e=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],Y9e=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],Q9e=["maxLength","minLength","pattern"],Z9e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function pF(t){for(var e of W9e)if(e in t)return"object";for(var e of Y9e)if(e in t)return"array";for(var e of Q9e)if(e in t)return"string";for(var e of Z9e)if(e in t)return"number";return t.type}function e7e(t,e){let n=e.schema,r=Object.keys(n.properties||{}),i=`
`,i}function t7e(t,e){let n="",r=e.schema,i=r.required||[],l=e.getPropertyLocation("properties"),s=[],a=[];if(r.properties)for(let u of Object.keys(r.properties)){if(i.indexOf(u)===-1)continue;let c=l.getPropertyLocation(u);c.schema.$ref&&(c=S1(t,e,c.schema.$ref));let f=JSON.stringify(u);c.schema.default===void 0&&(n+=`if(obj[${f}]===undefined)thrownewError('${f} is required!')
`,a.push(u)),s.push(u)}for(let u of i)s.indexOf(u)===-1&&(n+=`if(obj['${u}']===undefined)thrownewError('"${u}" is required!')
`;let o=t.wrapObjects;if(t.wrapObjects=!0,r.properties)for(let u of Object.keys(r.properties)){let c=l.getPropertyLocation(u);c.schema.$ref&&(c=S1(t,e,c.schema.$ref));let f=JSON.stringify(u);if(a.indexOf(u)!==-1)n+=`
${e}`)}function Q9(t,e,n,r){if((t.isLeafNode||r.commonPrefix!==!1)&&(n=n||"(empty root node)",e=e[n]={},t.isLeafNode&&(e[hU]=ide(t,n,r)),n=""),t.staticChildren)for(let i of Object.values(t.staticChildren))Q9(i,e,n+i.prefix,r);if(t.parametricChildren)for(let i of Object.values(t.parametricChildren)){let l=Array.from(i.nodePaths).join("|");Q9(i,e,n+l,r)}t.wildcardChild&&Q9(t.wildcardChild,e,"*",r)}function lde(t,e){let n={};return Q9(t,n,t.prefix,e),mU(n)}gU.exports={prettyPrintTree:lde}});var EU=k((fke,_U)=>{"use strict";var sde=Y9(),Zv=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,n){let r=n.params,i=n.opts.constraints||{},l={params:r,constraints:i,handler:n.handler,store:n.store||null,_createParamsObject:this._compileCreateParamsObject(r)},s=Object.keys(i);s.length===0&&(this.unconstrainedHandler=l);for(let o of s)this.constraints.includes(o)||(o==="version"?this.constraints.unshift(o):this.constraints.push(o));let a=s.includes(sde.name);if(!a&&this.handlers.length>=32)throw new Error("find-my-way supports a maximum of 32 route handlers per node when there are constraints, limit reached");this.handlers.push(l),this.handlers.sort((o,u)=>Object.keys(o.constraints).length-Object.keys(u.constraints).length),a||this._compileGetHandlerMatchingConstraints(e,i)}_compileCreateParamsObject(e){let n=[];for(let r=0;r<e.length;r++)n.push(`'${e[r]}':paramsArray[${r}]`);return new Function("paramsArray",`return{${n.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,n){for(let r=0;r<this.handlers.length;r++){let l=this.handlers[r].constraints[n];if(l!==void 0){let s=e.get(l)||0;s|=1<<r,e.set(l,s)}}}_constrainedIndexBitmask(e){let n=0;for(let r=0;r<this.handlers.length;r++)this.handlers[r].constraints[e]!==void 0&&(n|=1<<r);return~n}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let r of this.constraints){let i=e.newStoreForConstraint(r);this.constrainedHandlerStores[r]=i,this._buildConstraintStore(i,r)}let n=[];n.push(`
`)}for(let r in e.strategies)e.strategies[r].mustMatchWhenDerived&&!this.constraints.includes(r)&&n.push(`if(derivedConstraints.${r}!==undefined)returnnull`);n.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",n.join(`
`))}};_U.exports=Zv});var wU=k((dke,bU)=>{"use strict";var ade=EU(),i7={STATIC:0,PARAMETRIC:1,WILDCARD:2},Z9=class{constructor(){this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}addRoute(e,n){this.routes===null&&(this.routes=[]),this.handlerStorage===null&&(this.handlerStorage=new ade),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(n,e)}},e7=class extends Z9{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,n){let r=this.staticChildren[e.charAt(n)];return r===void 0||!r.matchPrefix(e,n)?null:r}getStaticChild(e,n=0){if(e.length===n)return this;let r=this.findStaticMatchingChild(e,n);return r?r.getStaticChild(e,n+r.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let n=this.staticChildren[e.charAt(0)];if(n){let i=1;for(;i<n.prefix.length;i++)if(e.charCodeAt(i)!==n.prefix.charCodeAt(i)){n=n.split(this,i);break}return n.createStaticChild(e.slice(i))}let r=e.charAt(0);return this.staticChildren[r]=new t7(e),this.staticChildren[r]}},t7=class t extends e7{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=i7.STATIC,this._compilePrefixMatch()}getParametricChild(e){let n=e&&e.source,r=this.parametricChildren.find(i=>(i.regex&&i.regex.source)===n);return r||null}createParametricChild(e,n,r){let i=this.getParametricChild(e);return i?(i.nodePaths.add(r),i):(i=new n7(e,n,r),this.parametricChildren.push(i),this.parametricChildren.sort((l,s)=>l.isRegex?s.isRegex?l.staticSuffix===null?1:s.staticSuffix===null?-1:s.staticSuffix.endsWith(l.staticSuffix)?1:l.staticSuffix.endsWith(s.staticSuffix)?-1:0:-1:1),i)}getWildcardChild(){return this.wildcardChild?this.wildcardChild:null}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new r7,this.wildcardChild}split(e,n){let r=this.prefix.slice(0,n),i=this.prefix.slice(n);this.prefix=i,this._compilePrefixMatch();let l=new t(r);return l.staticChildren[i.charAt(0)]=this,e.staticChildren[r.charAt(0)]=l,l}getNextNode(e,n,r,i){let l=this.findStaticMatchingChild(e,n),s=0;if(l===null){if(this.parametricChildren.length===0)return this.wildcardChild;l=this.parametricChildren[0],s=1}this.wildcardChild!==null&&r.push({paramsCount:i,brotherPathIndex:n,brotherNode:this.wildcardChild});for(let a=this.parametricChildren.length-1;a>=s;a--)r.push({paramsCount:i,brotherPathIndex:n,brotherNode:this.parametricChildren[a]});return l}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let n=1;n<this.prefix.length;n++){let r=this.prefix.charCodeAt(n);e.push(`path.charCodeAt(i+${n})===${r}`)}this.matchPrefix=new Function("path","i",`return${e.join(" && ")}`)}},n7=class extends e7{constructor(e,n,r){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=n||null,this.kind=i7.PARAMETRIC,this.nodePaths=new Set([r])}getNextNode(e,n){return this.findStaticMatchingChild(e,n)}},r7=class extends Z9{constructor(){super(),this.kind=i7.WILDCARD}getNextNode(){return null}};bU.exports={StaticNode:t7,ParametricNode:n7,WildcardNode:r7,NODE_TYPES:i7}});var TU=k((hke,SU)=>{"use strict";var ode=require("assert");function bc(){if(!(this instanceof bc))return new bc;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}bc.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[n,r,i]=t.split(".");return n=Number(n)||0,r=Number(r)||0,i=Number(i)||0,n>=this.maxMajor&&(this.maxMajor=n,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),r>=(this.maxMinors[n]||0)&&(this.maxMinors[n]=r,this.store[`${n}.x`]=e,this.store[`${n}.x.x`]=e),i>=(this.store[`${n}.${r}`]||0)&&(this.maxPatches[`${n}.${r}`]=i,this.store[`${n}.${r}.x`]=e),this.store[`${n}.${r}.${i}`]=e,this};bc.prototype.get=function(t){return this.store[t]};SU.exports={name:"version",mustMatchWhenDerived:!0,storage:bc,validate(t){ode(typeof t=="string","Version should be a string")}}});var AU=k((mke,xU)=>{"use strict";var ude=require("assert");function cde(){let t={},e=[];return{get:n=>{let r=t[n];if(r)return r;for
`)).bind(this)}};OU.exports=t_});var RU=k((gke,CU)=>{"use strict";var dde=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];CU.exports=dde});var DU=k((vke,kU)=>{"use strict";function IU(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function hde(t,e){let n=!1,r=!1,i="";for(let s=1;s<t.length;s++){let a=t.charCodeAt(s);if(a===37){let o=t.charCodeAt(s+1),u=t.charCodeAt(s+2);IU(o,u)===null?n=!0:(r=!0,o===50&&u===53&&(n=!0,t=t.slice(0,s+1)+"25"+t.slice(s+1),s+=2),s+=2)}else if(a===63||a===35||a===59&&e){i=t.slice(s+1),t=t.slice(0,s);break}}return{path:n?decodeURI(t):t,querystring:i,shouldDecodeParam:r}}function mde(t){let e=t.indexOf("%");if(e===-1)return t;let n="",r=e;for(let i=e;i<t.length;i++)if(t.charCodeAt(i)===37){let l=t.charCodeAt(i+1),s=t.charCodeAt(i+2),a=IU(l,s);n+=t.slice(r,i)+a,r=i+3}return t.slice(0,e)+n+t.slice(r)}kU.exports={safeDecodeURI:hde,safeDecodeURIComponent:mde}});var a_=k((_ke,$U)=>{"use strict";var Ur=require("assert"),yde=eU(),l7=cU(),i_=i1(),{prettyPrintTree:gde}=vU(),{StaticNode:PU,NODE_TYPES:n_}=wU(),vde=NU(),F1=RU(),r_=Y9(),{safeDecodeURI:_de,safeDecodeURIComponent:LU}=DU(),FU=/^https?:\/\/.*?\//,H3=/(\/:[^/()]*?)\?(\/?)/;if(!l7(FU))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!l7(H3))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function Er(t){if(!(this instanceof Er))return new Er(t);t=t||{},this._opts=t,t.defaultRoute?(Ur(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(Ur(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(Ur(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=Ede,t.querystringParser?(Ur(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:yde.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.constrainer=new vde(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}Er.prototype.on=function(e,n,r,i,l){typeof r=="function"&&(i!==void 0&&(l=i),i=r,r={}),Ur(typeof n=="string","Path should be a string"),Ur(n.length>0,"The path could not be empty"),Ur(n[0]==="/"||n[0]==="*","The first character of a path should be `/` or `*`"),Ur(typeof i=="function","Handler should be a function");let s=n.match(H3);if(s){Ur(n.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let u=n.replace(H3,"$1$2"),c=n.replace(H3,"$2");this.on(e,u,r,i,l),this.on(e,c,r,i,l);return}let a=n;this.ignoreDuplicateSlashes&&(n=l_(n)),this.ignoreTrailingSlash&&(n=s_(n));let o=Array.isArray(e)?e:[e];for(let u of o)Ur(typeof u=="string","Method should be a string"),Ur(F1.includes(u),`Method'${u}'isnotanhttpmethod.`),this._on(u,n,r,i,l,a)};Er.prototype._on=function(e,n,r,i,l){let s={};r.constraints!==void 0&&(Ur(typeof r.constraints=="object"&&r.constraints!==null,"Constraints should be an object"),Object.keys(r.constraints).length!==0&&(s=r.constraints)),this.constrainer.validateConstraints(s),this.constrainer.noteUsage(s),this.trees[e]===void 0&&(this.trees[e]=new PU("/"));let a=n;if(a==="*"&&this.trees[e].prefix.length!==0){let m=this.trees[e]
`;ln.DEFAULT_CONTENT_TYPE="application/octet-stream";ln.prototype.append=function(t,e,n){n=n||{},typeof n=="string"&&(n={filename:n});var r=aw.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),rJ.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,n),l=this._multiPartFooter();r(i),r(e),r(l),this._trackLength(i,e,n)};ln.prototype._trackLength=function(t,e,n){var r=0;n.knownLength!=null?r+=+n.knownLength:Buffer.isBuffer(e)?r=e.length:typeof e=="string"&&(r=Buffer.byteLength(e)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(t)+ln.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof XSe))&&(n.knownLength||this._valuesToMeasure.push(e))};ln.prototype._lengthRetriever=function(t,e){t.hasOwnProperty("fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):KSe.stat(t.path,function(n,r){var i;if(n){e(n);return}i=r.size-(t.start?t.start:0),e(null,i)}):t.hasOwnProperty("httpVersion")?e(null,+t.headers["content-length"]):t.hasOwnProperty("httpModule")?(t.on("response",function(n){t.pause(),e(null,+n.headers["content-length"])}),t.resume()):e("Unknown stream")};ln.prototype._multiPartHeader=function(t,e,n){if(typeof n.header=="string")return n.header;var r=this._getContentDisposition(e,n),i=this._getContentType(e,n),l="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(r||[]),"Content-Type":[].concat(i||[])};typeof n.header=="object"&&sw(s,n.header);var a;for(var o in s)s.hasOwnProperty(o)&&(a=s[o],a!=null&&(Array.isArray(a)||(a=[a]),a.length&&(l+=o+": "+a.join("; ")+ln.LINE_BREAK)));return"--"+this.getBoundary()+ln.LINE_BREAK+l+ln.LINE_BREAK};ln.prototype._getContentDisposition=function(t,e){var n,r;return typeof e.filepath=="string"?n=iw.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t.name||t.path?n=iw.basename(e.filename||t.name||t.path):t.readable&&t.hasOwnProperty("httpVersion")&&(n=iw.basename(t.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r};ln.prototype._getContentType=function(t,e){var n=e.contentType;return!n&&t.name&&(n=lw.lookup(t.name)),!n&&t.path&&(n=lw.lookup(t.path)),!n&&t.readable&&t.hasOwnProperty("httpVersion")&&(n=t.headers["content-type"]),!n&&(e.filepath||e.filename)&&(n=lw.lookup(e.filepath||e.filename)),!n&&typeof t=="object"&&(n=ln.DEFAULT_CONTENT_TYPE),n};ln.prototype._multiPartFooter=function(){return function(t){var e=ln.LINE_BREAK,n=this._streams.length===0;n&&(e+=this._lastBoundary()),t(e)}.bind(this)};ln.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+ln.LINE_BREAK};ln.prototype.getHeaders=function(t){var e,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)t.hasOwnProperty(e)&&(n[e.toLowerCase()]=t[e]);return n};ln.prototype.setBoundary=function(t){this._boundary=t};ln.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};ln.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)typeof this._streams[n]!="function"&&(Buffer.isBuffer(this._streams[n])?t=Buffer.concat([t,this._streams[n]]):t=Buffer.concat([t,Buffer.from(this._streams[n])]),(typeof this._streams[n]!="string"||this._streams[n].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(ln.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};ln.prototype._generateBoundary=function(){for(var t="--------------------------",e=0;e<24;e++)t+=Math.floor(Math.random()*10).toString(16);this._boundary=t};ln.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};ln.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};ln.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure
`,f.message,f.stack);var m=new Error("tunneling socket could not be established, cause="+f.message);m.code="ECONNRESET",e.request.emit("error",m),r.removeSocket(i)}};a2.prototype.removeSocket=function(e){var n=this.sockets.indexOf(e);if(n!==-1){this.sockets.splice(n,1);var r=this.requests.shift();r&&this.createSocket(r,function(i){r.request.onSocket(i)})}};function oK(t,e){var n=this;a2.prototype.createSocket.call(n,t,function(r){var i=t.request.getHeader("host"),l=Hw({},n.options,{socket:r,servername:i?i.replace(/:.*$/,""):t.host}),s=KTe.connect(0,l);n.sockets[n.sockets.indexOf(r)]=s,e(s)})}function uK(t,e,n){return typeof t=="string"?{host:t,port:e,localAddress:n}:t}function Hw(t){for(var e=1,n=arguments.length;e<n;++e){var r=arguments[e];if(typeof r=="object")for(var i=Object.keys(r),l=0,s=i.length;l<s;++l){var a=i[l];r[a]!==void 0&&(t[a]=r[a])}}return t}var oo;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?oo=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:oo=function(){};F0.debug=oo});var fK=k((UUe,pK)=>{pK.exports=cK()});var mZ=k(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.removeTrailingChar=bu.merge=void 0;var EOe=(...t)=>{let e={};return t.forEach(function(n){var r;for(r in n)r in e&&e[r]===null?e[r]=n[r]:r in e&&Array.isArray(e[r])?e[r]=e[r].concat(n[r]):r in e&&typeof e[r]=="object"?e[r]=(0,bu.merge)(e[r],n[r]):e[r]=n[r]}),e};bu.merge=EOe;var bOe=(t,e)=>t.length>1&&t.endsWith(e)?t.substring(0,t.length-1):t;bu.removeTrailingChar=bOe});var U0=k(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.DataError=Qo.DatabaseError=Qo.NestedError=void 0;var X5=class extends Error{inner;id;constructor(e,n,r){super(e),this.inner=r,this.id=n,this.name=this.constructor.name}toString(){let e=this.name+": "+this.message;return this.inner?e+`:
`+this.inner:e}};Qo.NestedError=X5;var hT=class extends X5{};Qo.DatabaseError=hT;var mT=class extends X5{};Qo.DataError=mT});var ET=k(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.getArrayIndicies=al.validateArrayIndex=al.validateArrayIndicies=al.isInt=al.ArrayInfo=al.arrayRegex=void 0;var Sf=U0(),wOe=()=>/^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;al.arrayRegex=wOe;var yT={},gT=class t{property;index=0;append=!1;indicies=[];constructor(e,n){this.property=e;let r=n[0]??0;if(this.append=r===""||n[n.length-1]==="",this.indicies=n,vT(r))this.index=parseInt(r);else if(!this.append)throw new Sf.DataError("Only numerical values accepted for array index",200)}static processArray(e){if(typeof e>"u")return null;if(yT[e])return yT[e];let r=(0,al.arrayRegex)().exec(e.trim());if(r!=null){let i=r[1],l="["+r[2].toString()+"]",s=_T(l);return yZ(s),yT[e]=new t(i,s)}return null}getIndex(e,n){if(this.append)return-1;let r=this.index;if(r==-1){let i=n?e:e[this.property];return i.length===0?0:i.length-1}return r}getData(e){if(this.append)throw new Sf.DataError("Can't get data when appending",100);let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);return r[n]}setData(e,n){if(this.append){let r=e[this.property];this.indicies.forEach(i=>{i!==""&&(i=+i,i===-1&&(i=r.length-1),r=r[+i])}),r.push(n)}else{let{index:r,dataForProperty:i}=this.getArrayDataAndIndexFromProperty(e);r===-1?i.push(n):i[r]=n}}delete(e){if(this.append)throw new Sf.DataError("Can't delete an appended data",10);let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);r.splice(n,1)}isValid(e){let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);return r.hasOwnProperty(n)}getArrayDataAndIndexFromProperty(e){let n=0,r=e instanceof Array?e:e[this.property]??e;if(this.indicies.length>0){n=+this.indicies[this.indicies.length-1];for(let i=0;i<this.indicies.length-1;i++){let l=+this.indicies[i];l===-1&&(l=r.length-1),r=r[l]}n===-1&&(n=r.length-1)}return{index:n,dataForProperty:r}}isMultiDimensional(){return this.indicies.length>1}};al.ArrayInfo=gT;function vT(t){return!isNaN(t)&&Number(t)==t&&!isNaN(parseInt(t,10))}al.isInt=vT;function yZ(t){let e=t.filter(n=>n==="");if(e.length>1)throw Error("Only one append index is supported for nested arrays");if(e.length===1&&t[t.length-1]!=="")throw Error("Append index must be at the end of the nested array")}al.validateArrayIndicies=yZ;function gZ(t){if(t.length!==0&&!vT(t))throw new Sf.DataError("Only numerical values accepted for array index",200)}al.validateArrayIndex=gZ;function _T(t){if(t.length===0)return[];if(t.charAt(0)!=="[")throw new Error("Invalid array syntax detected");let e=t.substring(1,t.indexOf("]"));gZ(e);let n=e.length+2;return[e,..._T(t.substring(n))]}al.getArrayIndicies=_T});var EZ=k(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.DBParentData=void 0;var vZ=ET(),_Z=U0(),bT=class{parent;data;db;dataPath;constructor(e,n,r,i){this.parent=i,this.data=e,this.db=n,this.dataPath=r}checkArray(e=!1){let n=vZ.ArrayInfo.processArray(this.parent);if(n&&(!n.append||e)&&!n.isValid(this.data))throw new _Z.DataError("DataPath: /"+this.dataPath+". Can't find index "+n.index+" in array "+n.property,10);return n}getData(){if(this.parent===void 0)return this.data;let e=this.checkArray();return e?e.getData(this.data):this.data[this.parent]}setData(e){if(this.parent===void 0){this.db.resetData(e);return}let n=vZ.ArrayInfo.processArray(this.parent);if(n){if(!this.data.hasOwnProperty(n.property))this.data[n.property]=[];else if(!Array.isArray(this.data[n.property]))throw new _Z.DataError("DataPath: /"+this.dataPath+". "+n.property+" is not an array.",11);n.setData(this.data,e)}else this.data[this.parent]=e}delete(){if(this.parent===void 0){this.db.resetData({});return}let e=this.checkArray(!0);e?e.delete(this.data):delete this.data[this.parent]}};Tf.DBParentData=bT});var wZ=k((nze,bZ)=>{bZ.exports=function(){"use strict";function t(){this.readers=0,this.queue=[]}function e(l,s,a){var o;typeof l!="function"?(i.hasOwnProperty(l)
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},MB={};function $B(t,e){var n=e.getSiblings(t);return n.length<=1||(t=n.indexOf(t))<0||t===n.length-1?[]:n.slice(t+1).filter(e.isTag)}function pE(t){return{xmlMode:!!t.xmlMode,lowerCaseAttributeNames:!!t.lowerCaseAttributeNames,lowerCaseTags:!!t.lowerCaseTags,quirksMode:!!t.quirksMode,cacheResults:!!t.cacheResults,pseudos:t.pseudos,adapter:t.adapter,equals:t.equals}}var H_=(t,e,n,r,i)=>{let l=i(e,pE(n),r);return l===Pt.trueFunc?t:l===Pt.falseFunc?Pt.falseFunc:s=>l(s)&&t(s)},V_={is:H_,matches:H_,where:H_,not(t,e,n,r,i){let l=i(e,pE(n),r);return l===Pt.falseFunc?t:l===Pt.trueFunc?Pt.falseFunc:s=>!l(s)&&t(s)},has(t,e,n,r,i){let l=n.adapter,s=pE(n),a=(s.relativeSelector=!0,e.some(c=>c.some(uE))?[MB]:void 0),o=i(e,s,a);if(o===Pt.falseFunc)return Pt.falseFunc;let u=function(c,f){return c===Pt.falseFunc?Pt.falseFunc:m=>f.isTag(m)&&c(m)}(o,l);if(a&&o!==Pt.trueFunc){let{shouldTestNextSiblings:c=!1}=o;return d=>{if(!t(d))return!1;a[0]=d;var m=l.getChildren(d),d=c?[...m,...$B(d,l)]:m;return l.existsOne(u,d)}}return c=>t(c)&&l.existsOne(u,l.getChildren(c))}};function q_(t,e){return(t=e.getParent(t))&&e.isTag(t)?t:null}function Iye(t,e,n,r,i){let{adapter:l,equals:s}=n;switch(e.type){case at.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case at.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case at.Attribute:if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return n.xmlMode&&!n.lowerCaseAttributeNames||(e.name=e.name.toLowerCase()),Oye[e.action](t,e,n);case at.Pseudo:return function(a,o,u,c,f){let{name:m,data:d}=o;if(Array.isArray(d)){if(m in V_)return V_[m](a,d,u,c,f);throw new Error(`Unknownpseudo-class:${m}(${d})`)}let y=(o=u.pseudos)==null?void 0:o[m],_=typeof y=="string"?y:Rye[m];if(typeof _=="string"){if(d!=null)throw new Error(`Pseudo${m}doesn'thaveanyarguments`);let S=Z7(_);return V_.is(a,S,u,c,f)}if(typeof y=="function")return x$(y,m,d,1),S=>y(S,d)&&a(S);if(m in cE)return cE[m](a,d,u,c);if(m in T$){let S=T$[m];return x$(S,m,d,2),w=>S(w,u,d)&&a(w)}throw new Error("Unknown pseudo-class :"+m)}(t,e,n,r,i);case at.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let a=e.name;return n.xmlMode&&!n.lowerCaseTags||(a=a.toLowerCase()),function(o){return l.getName(o)===a&&t(o)}}case at.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(o){let u=o;for(;u=q_(u,l);)if(t(u))return!0;return!1};let a=new WeakSet;return function(o){let u=o;for(;u=q_(u,l);)if(!a.has(u)){if(l.isTag(u)&&t(u))return!0;a.add(u)}return!1}}case"_flexibleDescendant":return function(a){let o=a;do if(t(o))return!0;while(o=q_(o,l));return!1};case at.Parent:return function(a){return l.getChildren(a).some(o=>l.isTag(o)&&t(o))};case at.Child:return function(a){return(a=l.getParent(a))!=null&&l.isTag(a)&&t(a)};case at.Sibling:return function(a){var o=l.getSiblings(a);for(let c=0;c<o.length;c++){var u=o[c];if(s(a,u))break;if(l.isTag(u)&&t(u))return!0}return!1};case at.Adjacent:return l.prevElementSibling?function(a){return(a=l.prevElementSibling(a))!=null&&t(a)}:function(a){var o=l.getSiblings(a);let u;for(let f=0;f<o.length;f++){var c=o[f];if(s(a,c))break;l.isTag(c)&&(u=c)}return!!u&&t(u)};case at.Universal:if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not ye
`)}}):{name:r,value:i.replace(O$,`\r
`)}}).toArray()}}),Vc=function(t,e,n){if(this.length=0,this.options=n,this._root=e,t){for(var r=0;r<t.length;r++)this[r]=t[r];this.length=t.length}},VE=(Vc.prototype.cheerio="[cheerio object]",Vc.prototype.splice=Array.prototype.splice,Vc.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(Vc.prototype,gye,Qye,ige,lge,age),function(t,e){return(VE=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,r){n.__proto__=r}:function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}))(t,e)}),oge=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}VE(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)},qc=function(){return(qc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},uge=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),mr="\uFFFD",N$=(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.NUMBER_SIGN=35]="NUMBER_SIGN",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_F=70]="LATIN_CAPITAL_F",t[t.LATIN_CAPITAL_X=88]="LATIN_CAPITAL_X",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_F=102]="LATIN_SMALL_F",t[t.LATIN_SMALL_X=120]="LATIN_SMALL_X",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z",t[t.REPLACEMENT_CHARACTER=65533]="REPLACEMENT_CHARACTER"}(D=D||{}),"--"),C$="[CDATA[",R$="doctype",$1="script",cge="public",pge="system";function tH(t){return 55296<=t&&t<=57343}function nH(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&1<=t&&t<=31||127<=t&&t<=159}function rH(t){return 64976<=t&&t<=65007||uge.has(t)}(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missin
`,this.firstUpdate&&(U+=" "),this.message=U+(this.message||""),this.firstUpdate=!1,this},v}function u(w){return n.toString.call(w)==="[object Function]"}function c(w){return n.toString.call(w)==="[object Array]"}function f(w){return n.toString.call(w)==="[object String]"}function m(w){return n.toString.call(w)==="[object Object]"}function d(w){var E=function(g){return g?typeof g=="string"?g.split("."):[g]:[]}(w);return function(g){for(var v=g,x=0;x<E.length;x++){var O=E[x];if(!s(v,O))return;v=v[O]}return v}}function y(w){return Array.prototype.slice.call(w)}function _(w,E,g){return Array.prototype.indexOf.call(w||[],E,g)}function S(w){var E,g=[];for(E in w)s(w,E)&&g.push(E);return g}l.hasOwnProp=s,l._prettifyError=function(w,E,g){return(g=g.Update?g:new l.TemplateError(g)).Update(w),E||(w=g,(g=new Error(w.message)).name=w.name),g},Object.setPrototypeOf?Object.setPrototypeOf(o.prototype,Error.prototype):o.prototype=Object.create(Error.prototype,{constructor:{value:o}}),l.TemplateError=o,l.escape=function(w){return w.replace(i,a)},l.isFunction=u,l.isArray=c,l.isString=f,l.isObject=m,l.getAttrGetter=d,l.groupBy=function(w,E,g){for(var v={},x=u(E)?E:d(E),O=0;O<w.length;O++){var N=w[O],R=x(N,O);if(R===void 0&&g===!0)throw new TypeError('groupby: attribute "'+E+'" resolved to undefined');(v[R]||(v[R]=[])).push(N)}return v},l.toArray=y,l.without=function(w){var E=[];if(w)for(var g=w.length,v=y(arguments).slice(1),x=-1;++x<g;)_(v,w[x])===-1&&E.push(w[x]);return E},l.repeat=function(w,E){for(var g="",v=0;v<E;v++)g+=w;return g},l.each=function(w,E,g){if(w!=null){if(e.forEach&&w.forEach===e.forEach)w.forEach(E,g);else if(w.length===+w.length)for(var v=0,x=w.length;v<x;v++)E.call(g,w[v],v,w)}},l.map=function(w,E){var g=[];if(w!=null){if(e.map&&w.map===e.map)return w.map(E);for(var v=0;v<w.length;v++)g[g.length]=E(w[v],v);w.length===+w.length&&(g.length=w.length)}return g},l.asyncIter=function(w,E,g){var v=-1;(function x(){++v<w.length?E(w[v],v,x,g):g()})()},l.asyncFor=function(w,E,g){var v=S(w||{}),x=v.length,O=-1;(function N(){var R=v[++O];O<x?E(R,w[R],O,x,N):g()})()},l.indexOf=_,l.keys=S,l._entries=function(w){return S(w).map(function(E){return[E,w[E]]})},l._values=function(w){return S(w).map(function(E){return w[E]})},l._assign=l.extend=function(w,E){return w=w||{},S(E).forEach(function(g){w[g]=E[g]}),w},l.inOperator=function(w,E){if(c(E)||f(E))return E.indexOf(w)!==-1;if(m(E))return w in E;throw new Error('Cannot use "in" operator to search for "'+w+'" in unexpected types.')}});function NH(){throw new Error("setTimeout has not been defined")}function CH(){throw new Error("clearTimeout has not been defined")}var H2=NH,V2=CH;function RH(t){if(H2===setTimeout)return setTimeout(t,0);if((H2===NH||!H2)&&setTimeout)return(H2=setTimeout)(t,0);try{return H2(t,0)}catch{try{return H2.call(null,t,0)}catch{return H2.call(this,t,0)}}}typeof t2.setTimeout=="function"&&(H2=setTimeout),typeof t2.clearTimeout=="function"&&(V2=clearTimeout);var Y3,r2=[],n0=!1,D7=-1;function ove(){n0&&Y3&&(n0=!1,Y3.length?r2=Y3.concat(r2):D7=-1,r2.length)&&IH()}function IH(){if(!n0){var t=RH(ove);n0=!0;for(var e=r2.length;e;){for(Y3=r2,r2=[];++D7<e;)Y3&&Y3[D7].run();D7=-1,e=r2.length}Y3=null,n0=!1,function(n){if(V2===clearTimeout)return clearTimeout(n);if((V2===CH||!V2)&&clearTimeout)return(V2=clearTimeout)(n);try{V2(n)}catch{try{return V2.call(null,n)}catch{return V2.call(this,n)}}}(t)}}function kH(t,e){this.fun=t,this.array=e}function ru(){}kH.prototype.run=function(){this.fun.apply(null,this.array)};var uve=ru,cve=ru,pve=ru,fve=ru,dve=ru,hve=ru,mve=ru,G1=t2.performance||{},yve=G1.now||G1.mozNow||G1.msNow||G1.oNow||G1.webkitNow||function(){return new Date().getTime()},gve=new Date,X2={nextTick:function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];r2.push(new kH(t,e)),r2.length!==1||n0||RH(IH)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:uve,addListener:cve,once:pve,off:fve,removeListener:dve,removeAllListeners:hve,emit:mve,binding:function(t){throw new Error("process.
`?this.forward():this.back())),ll(HH,d,n,r);if(d=(d=this._extractString(this.tags.VARIABLE_END))||this._extractString("-"+this.tags.VARIABLE_END))return this.in_code=!1,ll(qH,d,n,r);if(i==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var l="";!this.isFinished();){if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}l+=this.current(),this.forward()}for(var s=["g","i","m","y"],a="";!this.isFinished()&&s.indexOf(this.current())!==-1;)a+=this.current(),this.forward();return ll(sV,{body:l,flags:a},n,r)}if(fB.indexOf(i)!==-1){this.forward();var o,u=["==","===","!=","!==","<=",">=","//","**"],c=i+this.current();switch(Le.indexOf(u,c)!==-1&&(this.forward(),Le.indexOf(u,(i=c)+this.current())!==-1)&&(i=c+this.current(),this.forward()),i){case"(":o=GH;break;case")":o=JH;break;case"[":o=KH;break;case"]":o=XH;break;case"{":o=WH;break;case"}":o=YH;break;case",":o=ZH;break;case":":o=eV;break;case"~":o=tV;break;case"|":o=nV;break;default:o=QH}return ll(o,i,n,r)}if((d=this._extractUntil(pB+fB)).match(/^[-+]?[0-9]+$/))return this.current()==="."?(this.forward(),u=this._extract("0123456789"),ll(rV,d+"."+u,n,r)):ll("int",d,n,r);if(d.match(/^(true|false)$/))return ll(iV,d,n,r);if(d==="none"||d==="null")return ll(CE,d,n,r);if(d)return ll(lV,d,n,r);throw new Error("Unexpected value while parsing: "+d)}var f,m=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if(d=(d=this._extractString(this.tags.BLOCK_START+"-"))||this._extractString(this.tags.BLOCK_START))return this.in_code=!0,ll(BH,d,n,r);if(d=(d=this._extractString(this.tags.VARIABLE_START+"-"))||this._extractString(this.tags.VARIABLE_START))return this.in_code=!0,ll(VH,d,n,r);var d="",y=!1;for(this._matches(this.tags.COMMENT_START)&&(y=!0,d=this._extractString(this.tags.COMMENT_START));(f=this._extractUntil(m))!==null;){if(d+=f,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!y){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&0<this.colno&&this.colno<=d.length){var _=d.slice(-this.colno);if(/^\s+$/.test(_)&&!(d=d.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!y)throw new Error("unexpected end of comment");d+=this._extractString(this.tags.COMMENT_END);break}d+=this.current(),this.forward()}if(f===null&&y)throw new Error("expected end of comment, got end of file");return ll(y?zH:$H,d,n,r)},e._parseString=function(n){this.forward();for(var r="";!this.isFinished()&&this.current()!==n;){var i=this.current();if(i==="\\")switch(this.forward(),this.current()){case"n":r+=`
`))})},r.compileRoot=function(i,l){var s=this,a=(l&&this.fail("compileRoot: root node can't have frame"),l=new Y_,this._emitFuncBegin(i,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(i,l),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0,[]);(l=i.findAll(X.Block)).forEach(function(o,u){var c=o.name.value;if(a.indexOf(c)!==-1)throw new Error('Block "'+c+'" defined more than once.');a.push(c),s._emitFuncBegin(o,"b_"+c),c=new Y_,s._emitLine("var frame = frame.push(true);"),s.compile(o.body,c),s._emitFuncEnd()}),this._emitLine("return {"),l.forEach(function(o,u){o="b_"+o.name.value,s._emitLine(o+": "+o+",")}),this._emitLine(`root:root
};`)},r.compile=function(i,l){var s=this["compile"+i.typename];s?s.call(this,i,l):this.fail("compile: Cannot compile node: "+i.typename,i.lineno,i.colno)},r.getCode=function(){return this.codebuf.join("")},n}(o0.Obj),S_e={compile:function(s,e,n,r,i){var l=new vB(r,(i=i===void 0?{}:i).throwOnUndefined),s=(n||[]).map(function(a){return a.preprocess}).filter(function(a){return!!a}).reduce(function(a,o){return o(a)},s);return l.compile(v_e.transform(m_e.parse(s,n,i),e,r)),l.getCode()},Compiler:vB},T_e=ht(function(t){function e(d,y){return d==null||d===!1?y:d}function n(d){return d!=d}function r(d){var y=(d=e(d,"")).toLowerCase();return mt.copySafeness(d,y.charAt(0).toUpperCase()+y.slice(1))}function i(d){if(Le.isString(d))return d.split("");if(Le.isObject(d))return Le._entries(d||{}).map(function(y){return{key:y[0],value:y[1]}});if(Le.isArray(d))return d;throw new Le.TemplateError("list filter: type not iterable")}function l(d){return function(y,_,S){var w=this,E=w.env.getTest(_=_===void 0?"truthy":_);return Le.toArray(y).filter(function(g){return E.call(w,g,S)===d})}}function s(d){return mt.copySafeness(d,d.replace(/^\s*|\s*$/g,""))}(t=t.exports={}).abs=Math.abs,t.batch=function(d,y,_){for(var S=[],w=[],E=0;E<d.length;E++)E%y==0&&w.length&&(S.push(w),w=[]),w.push(d[E]);if(w.length){if(_)for(E=w.length;E<y;E++)w.push(_);S.push(w)}return S},t.capitalize=r,t.center=function(d,y){var _;return(d=e(d,"")).length>=(y=y||80)?d:(y-=d.length,_=Le.repeat(" ",y/2-y%2),y=Le.repeat(" ",y/2),mt.copySafeness(d,_+d+y))},t.default=function(d,y,_){return _?d||y:d!==void 0?d:y},t.dictsort=function(d,y,_){if(!Le.isObject(d))throw new Le.TemplateError("dictsort filter: val must be an object");var S,w,E=[];for(w in d)E.push([w,d[w]]);if(_===void 0||_==="key")S=0;else{if(_!=="value")throw new Le.TemplateError("dictsort filter: You can only sort by either key or value");S=1}return E.sort(function(g,v){return g=g[S],v=v[S],y||(Le.isString(g)&&(g=g.toUpperCase()),Le.isString(v)&&(v=v.toUpperCase())),v<g?1:g===v?0:-1}),E},t.dump=function(d,y){return JSON.stringify(d,null,y)},t.escape=function(d){return d instanceof mt.SafeString?d:mt.markSafe(Le.escape((d=d??"").toString()))},t.safe=function(d){return d instanceof mt.SafeString?d:mt.markSafe((d=d??"").toString())},t.first=function(d){return d[0]},t.forceescape=function(d){return mt.markSafe(Le.escape((d=d??"").toString()))},t.groupby=function(d,y){return Le.groupBy(d,y,this.env.opts.throwOnUndefined)},t.indent=function(d,E,_){if((d=e(d,""))==="")return"";E=E||4;var S=d.split(`
`):_.replace(/\s+/gi," ");return mt.copySafeness(d,S)},t.title=function(d){var y=(d=e(d,"")).split(" ").map(r);return mt.copySafeness(d,y.join(" "))},t.trim=s,t.truncate=function(d,y,_,S){var w=d;return(d=e(d,"")).length<=(y=y||255)?d:(d=_?d.substring(0,y):((_=d.lastIndexOf(" ",y))===-1&&(_=y),d.substring(0,_)),mt.copySafeness(w,d+=S??"..."))},t.upper=function(d){return(d=e(d,"")).toUpperCase()},t.urlencode=function(d){var y=encodeURIComponent;return Le.isString(d)?y(d):(Le.isArray(d)?d:Le._entries(d)).map(function(w){var S=w[0],w=w[1];return y(S)+"="+y(w)}).join("&")};var a=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,o=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,u=/^https?:\/\/.*$/,c=/^www\./,f=/\.(?:org|net|com)(?:\:|\/|$)/,m=(t.urlize=function(d,y,_){n(y)&&(y=1/0);varS=_===!0?' rel="nofollow"':"";returnd.split(/(\s+)/).filter(function(w){returnw&&w.length}).map(function(w){varE=w.match(a),g=(E=E?E[1]:w).substr(0,y);returnu.test(E)?'<a href="'+E+'"'+S+">"+g+"</a>":c.test(E)?'<a href="http://'+E+'"'+S+">"+g+"</a>":o.test(E)?'<a href="mailto:'+E+'">'+E+"</a>":f.test(E)?'<a href="http://'+E+'"'+S+">"+g+"</a>":w}).join("")},t.wordcount=function(d){return(d=(d=e(d,""))?d.match(/\w+/g):null)?d.length:null},t.float=function(d,y){returnn(d=parseFloat(d))?y:d},mt.makeMacro(["value","default","base"],[],function(d,y,_){return_===void0&&(_=10),n(d=parseInt(d,_))?y:d}));t.int=m,t.d=t.default,t.e=t.escape}),X7={};functionwV(t,e){for(varn=0,r=t.length-1;0<=r;r--){vari=t[r];i==="."?t.splice(r,1):i===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;)t.unshift("..");returnt}varx_e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Q_=function(t){returnx_e.exec(t).slice(1)};functionZ_(){for(vart="",e=!1,n=arguments.length-1;-1<=n&&!e;n--){varr=0<=n?arguments[n]:"/";if(typeofr!="string")thrownewTypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,e=r.charAt(0)==="/")}return(e?"/":"")+wV(YE(t.split("/"),function(i){return!!i}),!e).join("/")||"."}function_B(t){vare=SV(t),n=A_e(t,-1)==="/";return(t=(t=wV(YE(t.split("/"),function(r){return!!r}),!e).join("/"))||e?t:".")&&n&&(t+="/"),(e?"/":"")+t}functionSV(t){returnt.charAt(0)==="/"}varr0={extname:function(t){returnQ_(t)[3]},basename:function(t,e){returnt=Q_(t)[2],e&&t.substr(-1*e.length)===e?t.substr(0,t.length-e.length):t},dirname:function(n){vare=(n=Q_(n))[0],n=n[1];returne||n?e+(n&&n.substr(0,n.length-1)):"."},sep:"/",delimiter:":",relative:function(t,e){functionn(u){for(varc=0;c<u.length&&u[c]==="";c++);for(varf=u.length-1;0<=f&&u[f]==="";f--);returnf<c?[]:u.slice(c,f-c+1)}t=Z_(t).substr(1),e=Z_(e).substr(1);for(varr=n(t.split("/")),i=n(e.split("/")),l=Math.min(r.length,i.length),s=l,a=0;a<l;a++)if(r[a]!==i[a]){s=a;break}for(varo=[],a=s;a<r.length;a++)o.push("..");return(o=o.concat(i.slice(s))).join("/")},join:function(){return_B(YE(Array.prototype.slice.call(arguments,0),function(t,e){if(typeoft!="string")thrownewTypeError("Arguments to path.join must be strings");returnt}).join("/"))},isAbsolute:SV,normalize:_B,resolve:Z_};functionYE(t,e){if(t.filter)returnt.filter(e);for(varn=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);returnn}varA_e="ab".substr(-1)==="b"?function(t,e,n){returnt.substr(e,n)}:function(t,e,n){returne<0&&(e=t.length+e),t.substr(e,n)};functionTV(t,e){return(TV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){returnn.__proto__=r,n})(t,e)}varQE=function(t){vare;functionn(){returnt.apply(this,arguments)||this}e=t,(r=n).prototype=Object.create(e.prototype),TV(r.prototype.constructor=r,e);varr=n.prototype;returnr.resolve=function(i,l){returnr0.resolve(r0.dirname(i),l)},r.isRelative=function(i){returni.indexOf("./")===0||i.indexOf("../")===0},n}(o0.EmitterObj);functionxV(t,e){return(xV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){returnn.__proto__=r,n})(t,e)}varO_e=function(t){vare,n;functionr(i){varl;return(l=t.call(this)||this).precompiled=i||{},l}returnn=t,(e=r).prototype=Object.create(n.prototype),xV(e.prototype.co
`)){let o=a.trim();if(o)if(o.startsWith("#")){if(o.startsWith("#EXT")){let u=lEe(o,l);u&&s.push(u)}}else s.push(o)}return s.length!==0&&s[0].name==="EXTM3U"||He("The EXTM3U tag MUST be the first line."),s}(t,e),r=sEe(n,e);return r.source=t,r}var aEe=["#EXTINF","#EXT-X-BYTERANGE","#EXT-X-DISCONTINUITY","#EXT-X-STREAM-INF","#EXT-X-CUE-OUT","#EXT-X-CUE-IN","#EXT-X-KEY","#EXT-X-MAP"],oEe=["#EXT-X-MEDIA"],fb=class extends Array{constructor(e){super(),this.baseUri=e}push(...e){for(let n of e)if(n.startsWith("#"))if(aEe.some(r=>n.startsWith(r)))super.push(n);else{if(this.includes(n)){if(oEe.some(r=>n.startsWith(r)))continue;He(`Redundantitem(${n})`)}super.push(n)}else super.push(n);return this.length}};function yb(t,e){let n=1e3;e&&(n=Math.pow(10,e));let r=Math.round(t*n)/n;return e?r.toFixed(e):r}function uEe(t){let e=[`DATA-ID="${t.id}"`];return t.language&&e.push(`LANGUAGE="${t.language}"`),t.value?e.push(`VALUE="${t.value}"`):t.uri&&e.push(`URI="${t.uri}"`),`#EXT-X-SESSION-DATA:${e.join(",")}`}function nq(t,e){let n=e?"#EXT-X-SESSION-KEY":"#EXT-X-KEY",r=[`METHOD=${t.method}`];return t.uri&&r.push(`URI="${t.uri}"`),t.iv&&(t.iv.length!==16&&He("IV must be a 128-bit unsigned integer"),r.push(`IV=${ZV(t.iv)}`)),t.format&&r.push(`KEYFORMAT="${t.format}"`),t.formatVersion&&r.push(`KEYFORMATVERSIONS="${t.formatVersion}"`),`${n}:${r.join(",")}`}function cEe(t,e){let n=e.isIFrameOnly?"#EXT-X-I-FRAME-STREAM-INF":"#EXT-X-STREAM-INF",r=[`BANDWIDTH=${e.bandwidth}`];if(e.averageBandwidth&&r.push(`AVERAGE-BANDWIDTH=${e.averageBandwidth}`),e.isIFrameOnly&&r.push(`URI="${e.uri}"`),e.codecs&&r.push(`CODECS="${e.codecs}"`),e.resolution&&r.push(`RESOLUTION=${e.resolution.width}x${e.resolution.height}`),e.frameRate&&r.push(`FRAME-RATE=${yb(e.frameRate,3)}`),e.hdcpLevel&&r.push(`HDCP-LEVEL=${e.hdcpLevel}`),e.audio.length>0){r.push(`AUDIO="${e.audio[0].groupId}"`);for(let i of e.audio)t.push(bp(i))}if(e.video.length>0){r.push(`VIDEO="${e.video[0].groupId}"`);for(let i of e.video)t.push(bp(i))}if(e.subtitles.length>0){r.push(`SUBTITLES="${e.subtitles[0].groupId}"`);for(let i of e.subtitles)t.push(bp(i))}if(W_e().allowClosedCaptionsNone&&e.closedCaptions.length===0)r.push("CLOSED-CAPTIONS=NONE");else if(e.closedCaptions.length>0){r.push(`CLOSED-CAPTIONS="${e.closedCaptions[0].groupId}"`);for(let i of e.closedCaptions)t.push(bp(i))}if(e.score&&r.push(`SCORE=${e.score}`),e.allowedCpc){let i=[];for(let{format:l,cpcList:s}of e.allowedCpc)i.push(`${l}:${s.join("/")}`);r.push(`ALLOWED-CPC="${i.join(",")}"`)}e.videoRange&&r.push(`VIDEO-RANGE=${e.videoRange}`),e.stableVariantId&&r.push(`STABLE-VARIANT-ID="${e.stableVariantId}"`),e.programId&&r.push(`PROGRAM-ID=${e.programId}`),t.push(`${n}:${r.join(",")}`),e.isIFrameOnly||t.push(`${e.uri}`)}function bp(t){let e=[`TYPE=${t.type}`,`GROUP-ID="${t.groupId}"`,`NAME="${t.name}"`];return t.isDefault!==void 0&&e.push("DEFAULT="+(t.isDefault?"YES":"NO")),t.autoselect!==void 0&&e.push("AUTOSELECT="+(t.autoselect?"YES":"NO")),t.forced!==void 0&&e.push("FORCED="+(t.forced?"YES":"NO")),t.language&&e.push(`LANGUAGE="${t.language}"`),t.assocLanguage&&e.push(`ASSOC-LANGUAGE="${t.assocLanguage}"`),t.instreamId&&e.push(`INSTREAM-ID="${t.instreamId}"`),t.characteristics&&e.push(`CHARACTERISTICS="${t.characteristics}"`),t.channels&&e.push(`CHANNELS="${t.channels}"`),t.uri&&e.push(`URI="${t.uri}"`),`#EXT-X-MEDIA:${e.join(",")}`}function pEe(t,e,n,r,i=1,l=null){let s=!1,a="";if(e.discontinuity&&t.push("#EXT-X-DISCONTINUITY"),e.key){let u=nq(e.key);u!==n&&(t.push(u),n=u)}if(e.map){let u=function(c){let f=[`URI="${c.uri}"`];return c.byterange&&f.push(`BYTERANGE="${ob(c.byterange)}"`),`#EXT-X-MAP:${f.join(",")}`}(e.map);u!==r&&(t.push(u),r=u)}if(e.programDateTime&&t.push(`#EXT-X-PROGRAM-DATE-TIME:${ab(e.programDateTime)}`),e.dateRange&&t.push(function(u){let c=[`ID="${u.id}"`];u.start&&c.push(`START-DATE="${ab(u.start)}"`),u.end&&c.push(`END-DATE="${ab(u.end)}"`),u.duration&&c.push(`DURATION=${u.duration}`),u.plannedDuration&&c.push(`PLANNED-DURATION=${u.plannedDuration}`),u.classId&&c.push(`CLASS="${u.classId}"`),u.endOnNext&&
`)}var iq="hls_cache",Lp=[],au={},E5={},su={},Pp="";function fEe(t,e){if(Lp.push(t),au[t]=e,Lp.length>5){let n=Lp.shift();dEe(n)}}function dEe(t){delete au[t],delete Lp[t],new JSFile(iq+"/"+t).delete()}function hEe(t,e){if(e.variants)for(let n of e.variants)n.uri.startsWith("http")||(n.uri=gb(t,n.uri));if(e.segments)for(let n of e.segments)n.uri.startsWith("http")||(n.uri=gb(t,n.uri)),n.key&&n.key.uri&&!n.key.uri.startsWith("http")&&(n.key.uri=gb(t,n.key.uri));return e}async function lq(t,e){let n=md5X(t);if(au[n])return au[n];let r={},i=t;for(;r=await req(i,{headers:e,redirect:0}),r.headers.location;)i=r.headers.location;if(r.code==200){var l=r.content;let s=hEe(i,tq(l));return fEe(n,{code:r.code,plist:s,key:n,headers:r.headers}),au[n]}return{}}async function sq(t,e,n){if(!au[t])return{};let i=au[t].plist.segments,l=!su[t];if(l){su[t]={};for(let c of i){let f=md5X(c.uri+c.mediaSequenceNumber.toString());su[t][f]={file:iq+"/"+t+"/"+f,uri:c.uri,key:f,index:c.mediaSequenceNumber,order:c.mediaSequenceNumber,state:-1,read:!1}}}for(let c in su[t]){let f=su[t][c];f.index>=e?f.order=f.index-e:f.order=i.length-e+f.index}l&&mEe(t,5,n);let s=i[e],a=md5X(s.uri+s.mediaSequenceNumber.toString()),o=su[t][a];if(o.state==1||o.state==-1){let c=new JSFile(o.file);if(await c.exist())return o.state=1,{buffer:3,code:200,headers:{connection:"close","content-type":"video/mp2t"},content:c};o.state=-1}if(o.state==-1&&aq(t,o,n),o.state==0){var u=new JSProxyStream;u.head(200,{connection:"close","content-type":"video/mp2t"});let c=0;return o.read=!0,new Promise(async function(f,m){let d=new JSFile(o.file+".dl");await d.open("r"),async function y(){let _=await d.size();if(_>c){var S=await d.read(_-c,c);await u.write(S),c=_}if(o.state==1||o.state<0){u.done(),await d.close(),await d.delete(),o.read=!1,f();return}setTimeout(y,5)}()}),{buffer:3,content:u}}}async function aq(t,e,n){if(e.state>=0||!E5[t])return;if(e.state=0,await new JSFile(e.file).exist()){e.state=1;return}let r=new JSFile(e.file+".dl");await r.open("w");let i=await req(e.uri,{buffer:3,headers:n,stream:r,timeout:[5e3,1e4]});if(i.error||i.code>=300){await r.close(),e.read||await r.delete(),e.state=-1;return}await r.close(),e.read?await r.copy(e.file):await r.move(e.file),e.state=1}async function mEe(t,e,n){Pp&&Pp!=t&&delete E5[Pp],Pp=t,E5[t]=!0;for(let r=0;r<e&&E5[t];r++)new Promise(function(i,l){(async function s(){if(!E5[t]){i();return}let a=B.pickBy(su[t],function(u){return u.state==-1}),o=B.minBy(Object.values(a),function(u){return u.order});if(!o){i();return}await aq(t,o,n),setTimeout(s,5)})()})}function gb(t,e){var n=t.split("/"),r=e.split("/");n.pop();for(var i=0;i<r.length;i++)r[i]!="."&&(r[i]==".."?n.pop():n.push(r[i]));return n.join("/")}function oq(t){let e=[];return Array.from(t.danmuku).forEach(n=>{let r=Number(n[0]),i=n[4];e.push(`<dp="${r},1,25,16777215,1659282294,0,8b53b65c,1108899274487246080"><![CDATA[${i}]]></d>`)}),String.raw`<?xmlversion="1.0"encoding="UTF-8"?><i><chatserver>chat.bilibili.com</chatserver><chatid>52175602</chatid><mission>0</mission><maxlimit>1000</maxlimit><state>0</state><real_name>0</real_name><source>k-v</source>`+e.join("")+"</i>"}varFp=class{constructor(){this.siteUrl="https://search.youku.com",this.reconnectTimes=0,this.maxReconnectTimes=5,this.jadeLog=newaa(this.getAppName(),"DEBUG")}getAppName(){return"\u5F39\u5E55"}getHeader(){return{"User-Agent":zr,Referer:this.siteUrl+"/"}}asyncreconnnect(e,n,r,i,l,s){returnawaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u8BF7\u68C0\u67E5url:"+e+",\u4E24\u79D2\u540E\u91CD\u8BD5"),Z2(2),this.reconnectTimes<this.maxReconnectTimes?(this.reconnectTimes=this.reconnectTimes+1,awaitthis.fetch(e,n,r,i,l,s)):(awaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u91CD\u8FDE\u5931\u8D25"),null)}asyncgetResponse(e,n,r,i,l,s,a){returna.headers.location!==void0?i?(awaitthis.jadeLog.debug(`\u8FD4\u56DE\u91CD\u5B9A\u5411\u8FDE\u63A5:${a.headers.location}`),a.headers.location):this.fetch(a.headers.location,n,r,i,l,s):a.content.length>0?(this.reconnectTimes=0,l?{cookie:a.headers["set-cookie"],content:a.conten
`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&aTe[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e};var vJ=Symbol("internals");function P5(t){return t&&String(t).trim().toLowerCase()}function pf(t){return t===!1||t==null?t:Z.isArray(t)?t.map(pf):String(t)}function oTe(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}var uTe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());functionhw(t,e,n,r,i){if(Z.isFunction(r))returnr.call(this,e,n);if(i&&(e=n),!!Z.isString(e)){if(Z.isString(r))returne.indexOf(r)!==-1;if(Z.isRegExp(r))returnr.test(e)}}functioncTe(t){returnt.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}functionpTe(t,e){letn=Z.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,l,s){returnthis[r].call(this,e,i,l,s)},configurable:!0})})}vark0=class{constructor(e){e&&this.set(e)}set(e,n,r){leti=this;functionl(a,o,u){letc=P5(o);if(!c)thrownewError("header name must be a non-empty string");letf=Z.findKey(i,c);(!f||i[f]===void0||u===!0||u===void0&&i[f]!==!1)&&(i[f||o]=pf(a))}lets=(a,o)=>Z.forEach(a,(u,c)=>l(u,c,o));returnZ.isPlainObject(e)||einstanceofthis.constructor?s(e,n):Z.isString(e)&&(e=e.trim())&&!uTe(e)?s(gJ(e),n):e!=null&&l(n,e,r),this}get(e,n){if(e=P5(e),e){letr=Z.findKey(this,e);if(r){leti=this[r];if(!n)returni;if(n===!0)returnoTe(i);if(Z.isFunction(n))returnn.call(this,i,r);if(Z.isRegExp(n))returnn.exec(i);thrownewTypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=P5(e),e){letr=Z.findKey(this,e);return!!(r&&this[r]!==void0&&(!n||hw(this,this[r],r,n)))}return!1}delete(e,n){letr=this,i=!1;functionl(s){if(s=P5(s),s){leta=Z.findKey(r,s);a&&(!n||hw(r,r[a],a,n))&&(deleter[a],i=!0)}}returnZ.isArray(e)?e.forEach(l):l(e),i}clear(e){letn=Object.keys(this),r=n.length,i=!1;for(;r--;){letl=n[r];(!e||hw(this,this[l],l,e,!0))&&(deletethis[l],i=!0)}returni}normalize(e){letn=this,r={};returnZ.forEach(this,(i,l)=>{lets=Z.findKey(r,l);if(s){n[s]=pf(i),deleten[l];return}leta=e?cTe(l):String(l).trim();a!==l&&deleten[l],n[a]=pf(i),r[a]=!0}),this}concat(...e){returnthis.constructor.concat(this,...e)}toJSON(e){letn=Object.create(null);returnZ.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&Z.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){returnObject.entries(this.toJSON())[Symbol.iterator]()}toString(){returnObject.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`,DTe=V5.encode(so),PTe=2,kw=class{constructor(e,n){let{escapeName:r}=this.constructor,i=Z.isString(n),l=`Content-Disposition:form-data;name="${r(e)}"${!i&&n.name?`; filename="${r(n.name)}"`:""}${so}`;i?n=V5.encode(String(n).replace(/\r?\n|\r\n?/g,so)):l+=`Content-Type:${n.type||"application/octet-stream"}${so}`,this.headers=V5.encode(l+so),this.contentLength=i?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+PTe,this.name=e,this.value=n}async*encode(){yield this.headers;let{value:e}=this;Z.isTypedArray(e)?yield e:yield*hf(e),yield DTe}static escapeName(e){return String(e).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},LTe=(t,e,n)=>{let{tag:r="form-data-boundary",size:i=25,boundary:l=r+"-"+Z.generateString(i,kTe)}=n||{};if(!Z.isFormData(t))throw TypeError("FormData instance required");if(l.length<1||l.length>70)throw Error("boundary must be 10-70 characters long");let s=V5.encode("--"+l+so),a=V5.encode("--"+l+"--"+so+so),o=a.byteLength,u=Array.from(t.entries()).map(([f,m])=>{let d=new kw(f,m);return o+=d.size,d});o+=s.byteLength*u.length,o=Z.toFiniteNumber(o);let c={"Content-Type":`multipart/form-data;boundary=${l}`};return Number.isFinite(o)&&(c["Content-Length"]=o),e&&e(c),DJ.Readable.from(async function*(){for(let f of u)yield s,yield*f.encode();yield a}())},PJ=LTe;var LJ=Yr(require("stream"),1),Dw=class extends LJ.default.Transform{__transform(e,n,r){this.push(e),r()}_transform(e,n,r){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,n)}this.__transform(e,n,r)}},FJ=Dw;var FTe=(t,e)=>Z.isAsyncFn(t)?function(...n){let r=n.pop();t.apply(this,n).then(i=>{try{e?r(null,...e(i)):r(null,i)}catch(l){r(l)}},r)}:t,jJ=FTe;var UJ={flush:l2.default.constants.Z_SYNC_FLUSH,finishFlush:l2.default.constants.Z_SYNC_FLUSH},jTe={flush:l2.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:l2.default.constants.BROTLI_OPERATION_FLUSH},MJ=Z.isFunction(l2.default.createBrotliDecompress),{http:UTe,https:MTe}=GJ.default,$Te=/https:?/,$J=ii.protocols.map(t=>t+":");function BTe(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function KJ(t,e,n){let r=e;if(!r&&r!==!1){let i=(0,HJ.getProxyForUrl)(n);i&&(r=new URL(i))}if(r){if(r.username&&(r.auth=(r.username||"")+":"+(r.password||"")),r.auth){(r.auth.username||r.auth.password)&&(r.auth=(r.auth.username||"")+":"+(r.auth.password||""));let l=Buffer.from(r.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+l}t.headers.host=t.hostname+(t.port?":"+t.port:"");let i=r.hostname||r.host;t.hostname=i,t.host=i,t.port=r.port,t.path=n,r.protocol&&(t.protocol=r.protocol.includes(":")?r.protocol:`${r.protocol}:`)}t.beforeRedirects.proxy=function(l){KJ(l,e,l.href)}}var HTe=typeof process<"u"&&Z.kindOf(process)==="process",VTe=t=>new Promise((e,n)=>{let r,i,l=(o,u)=>{i||(i=!0,r&&r(o,u))},s=o=>{l(o),e(o)},a=o=>{l(o,!0),n(o)};t(s,a,o=>r=o).catch(a)}),qTe=({address:t,family:e})=>{if(!Z.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},BJ=(t,e)=>qTe(Z.isObject(t)?t:{address:t,family:e}),XJ=HTe&&function(e){return VTe(async function(r,i,l){let{data:s,lookup:a,family:o}=e,{responseType:u,responseEncoding:c}=e,f=e.method.toUpperCase(),m,d=!1,y;if(a){let ee=jJ(a,me=>Z.isArray(me)?me:[me]);a=(me,P,G)=>{ee(me,P,(V,q,Zn)=>{if(V)return G(V);let Tt=Z.isArray(q)?q.map(Qe=>BJ(Qe)):[BJ(q,Zn)];P.all?G(V,Tt):G(V,Tt[0].address,Tt[0].family)})}}let _=new JJ.default,S=()=>{e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),_.removeAllListeners()};l((ee,me)=>{m=!0,me&&(d=!0,S())});function w(ee){_.emit("abort",!ee||ee.type?new ks(null,e,y):ee)}_.once("abort",i),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));let E=mu(e.baseURL,e.url),g=new URL(E,"http://localhost"),v=g.protocol||$J[0];if(v==="data:"){let ee;if(f!=="GET")return lo(r,i,{status:405,stat
`+l.map(eK).join(`
`):" "+eK(l[0]):"as no adapter specified";throw new qe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Pw};function Lw(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ks(null,t)}function yf(t){return Lw(t),t.headers=li.from(t.headers),t.data=L5.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),mf.getAdapter(t.adapter||I0.adapter)(t).then(function(r){return Lw(t),r.data=L5.call(t,t.transformResponse,r),r.headers=li.from(r.headers),r},function(r){return F5(r)||(Lw(t),r&&r.response&&(r.response.data=L5.call(t,t.transformResponse,r.response),r.response.headers=li.from(r.response.headers))),Promise.reject(r)})}var tK=t=>t instanceof li?t.toJSON():t;function s2(t,e){e=e||{};let n={};function r(u,c,f){return Z.isPlainObject(u)&&Z.isPlainObject(c)?Z.merge.call({caseless:f},u,c):Z.isPlainObject(c)?Z.merge({},c):Z.isArray(c)?c.slice():c}function i(u,c,f){if(Z.isUndefined(c)){if(!Z.isUndefined(u))return r(void 0,u,f)}else return r(u,c,f)}function l(u,c){if(!Z.isUndefined(c))return r(void 0,c)}function s(u,c){if(Z.isUndefined(c)){if(!Z.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,f){if(f in e)return r(u,c);if(f in t)return r(void 0,u)}let o={url:l,method:l,data:l,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken: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:a,headers:(u,c)=>i(tK(u),tK(c),!0)};return Z.forEach(Object.keys(Object.assign({},t,e)),function(c){let f=o[c]||i,m=f(t[c],e[c],c);Z.isUndefined(m)&&f!==a||(n[c]=m)}),n}var Fw={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Fw[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});var nK={};Fw.transitional=function(e,n,r){function i(l,s){return"[Axios v"+gu+"] Transitional option '"+l+"'"+s+(r?". "+r:"")}return(l,s,a)=>{if(e===!1)throw new qe(i(s," has been removed"+(n?" in "+n:"")),qe.ERR_DEPRECATED);return n&&!nK[s]&&(nK[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(l,s,a):!0}};function JTe(t,e,n){if(typeof t!="object")throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),i=r.length;for(;i-- >0;){let l=r[i],s=e[l];if(s){let a=t[l],o=a===void 0||s(a,l,t);if(o!==!0)throw new qe("option "+l+" must be "+o,qe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qe("Unknown option "+l,qe.ERR_BAD_OPTION)}}var gf={assertOptions:JTe,validators:Fw};var ao=gf.validators,P0=class{constructor(e){this.defaults=e,this.interceptors={request:new cw,response:new cw}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;let l=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`),i=[];for(let m of r)B.isEmpty(m.replaceAll(" ","").replaceAll("/",""))||i.push(m.replaceAll(" ","").replaceAll("/",""));n.type_name=i.slice(0,2).join("*");let l=e('[class="video-info-items"]');n.vod_director=e(l[0]).find("a")[0].children[0].data;let s=e(l[1]).find("a"),a=[];for(let m of s)a.push(m.children[0].data);n.vod_actor=a.join(" * "),n.vod_year=i[2],n.vod_remarks=e(e(l[3]).find(".video-info-item")).text(),n.vod_content=e(e(l[5]).find(".video-info-item")).text(),n.vod_area=i[3],n.vod_content=n.vod_content.replace("[\u6536\u8D77\u90E8\u5206]","").replace("[\u5C55\u5F00\u5168\u90E8]","").replaceAll(" ","").replaceAll(`
`,"");let o=e(e('[class="module-tab-content"]')[0]).find("span"),u=e('[class="module-list module-player-list tab-list sort-list "]'),c=[];for(let m of o)c.push(e(m).text());let f=[];for(let m of u){let d=e(e(m).find('[class="sort-item"]')).find("a"),y=[];for(let _ of d){let S=e(_).text(),w=_.attribs.href,E=S+"$"+w;y.push(E)}f.push(y.join("#"))}return n.vod_play_from=c.join("$$$"),n.vod_play_url=B.values(f).join("$$$"),n}async parseVodShortListFromDocBySearch(e){let n=e(".module-search-item"),r=[];for(let i of n){let l=new Ne;l.vod_id=e(i).find(".video-serial")[0].attribs.href,l.vod_name=e(i).find(".video-serial")[0].attribs.title,l.vod_pic=e(i).find(".module-item-pic > img")[0].attribs["data-src"],l.vod_remarks="",r.push(l)}return r}async setClasses(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!B.isEmpty(e)){let n=Be(e),r=n(n('[class="nav-menu-items"]')[0]).find("li");for(let i of r.slice(0,6)){let l=n(n(i).find("span")).text();if(l!=="\u9996\u9875"){let a={type_id:n(i).find("a")[0].attribs.href.split("/").slice(-1)[0].split(".")[0],type_name:l};this.classes.push(a)}}}}async getFilter(e){let n=e('[class="scroll-content"]').slice(1),r=[];for(let i=0;i<n.length;i++){let l={key:(i+1).toString(),name:"",value:[]};if(i<n.length-1){l.name=e(e(n[i]).find("a")[0]).text(),l.value.push({n:"\u5168\u90E8",v:"0"});for(let s of e(n[i]).find("a").slice(1))e(e(n[i]).find("a")[0]).text()==="\u5168\u90E8\u7C7B\u578B"?l.value.push({n:e(s).text(),v:s.attribs.href.split("/").slice(-1)[0].split(".")[0]}):l.value.push({n:e(s).text(),v:e(s).text()});r.push(l)}else l.name=e(e(n[i]).find("a")[0]).text(),l.value=[{n:"\u5168\u90E8",v:"0"},{n:e(e(n[i]).find("a")[1]).text(),v:"hits"},{n:e(e(n[i]).find("a")[2]).text(),v:"score"}],r.push(l)}return r}async setFilterObj(){for(let e of this.classes){let n=e.type_id;if(n!=="/"&&n!=="\u6700\u8FD1\u66F4\u65B0"){let r=this.siteUrl+`/vodshow/id/${n}.html`,i=await this.fetch(r,null,this.getHeader());if(i!=null){let l=Be(i);this.filterObj[n]=await this.getFilter(l)}}}}async setHomeVod(){let e=await this.fetch(this.siteUrl,null,this.getHeader());if(!B.isEmpty(e)){let n=Be(e);this.homeVodList=await this.parseVodShortListFromDoc(n)}}getExtend(e,n,r=""){return e!==void 0&&e!=="0"?r+e:n}async getCateUrl(e,n,r){e=this.getExtend(r[1],e);let i=this.getExtend(r[2],"","/area/"),l=this.getExtend(r[3],"","/lang/"),s=this.getExtend(r[4],"","/year/"),a=this.getExtend(r[5],"","/letter/"),o=this.getExtend(r[6],"","/by/");return this.siteUrl+`/vodshow${o}${i}/id/${e}${l}${a}${s}/page/${n}.html`}async setCategory(e,n,r,i){let l=await this.getCateUrl(e,n,i),s=await this.fetch(l,null,this.getHeader());if(!B.isEmpty(s)){let a=Be(s);this.vodList=await this.parseVodShortListFromDoc(a);let o=Se(/\$\("\.mac_total"\)\.text\('(\d+)'\)/,s);this.limit=72,o.length>0&&(this.total=parseInt(o)),this.total<=this.limit?this.count=1:this.count=Math.ceil(this.total/this.limit)}}async setDetail(e){let n=this.siteUrl+e,r=await this.fetch(n,null,this.getHeader());if(!B.isEmpty(r)){let i=Be(r);this.vodDetail=await this.parseVodDetailFromDoc(i)}}async setPlay(e,n,r){let i=await this.fetch(this.siteUrl+n,null,this.getHeader());if(!B.isEmpty(i)){let l=Se(/<script type="text\/javascript">var player_aaaa=(.*?)<\/script>/,i),s=JSON.parse(l);this.playUrl=s.url}}async setSearch(e,n){let r=this.siteUrl+`/vodsearch/wd/${e}.html`,i=await this.fetch(r,null,this.getHeader());if(!B.isEmpty(i)){let l=Be(i);this.vodList=await this.parseVodShortListFromDocBySearch(l)}}},Pn=new IS;var kS=class extends Re{constructor(){super()}getName(){return Pn.getName()}getAppName(){return Pn.getAppName()}getJSName(){return Pn.getJSName()}async init(e,n){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName()==="push_agent"?await Pn.initAli(e.server.config.alitoken):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await Pn.initCookie(e.server.config.bilicookie),await Pn.spiderInit(e),Pn.cfgObj.code=0,Pn.catOpenStatus=!0,Pn.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,n)}async
`,""),B.isEmpty(r.vod_pic)&&(r.vod_pic=Q2+"/resources/dygang.jpg"),r}async parseVodShortListFromDoc(e){let n=[],r=e('[class="index-tj-l"]').find("li");for(let i of r){let l=e(i).find("a")[0],s=this.parseVodShortFromElement(e,l);n.push(s)}return n}async parseVodShortListFromDocByCategory(e){let n=[],r=e('[class="index-area clearfix"]').find("li");for(let i of r){let l=e(i).find("a")[0],s=this.parseVodShortFromElement(e,l);n.push(s)}return n}async parseVodDetailFromDoc(e){let n=new Ue,r=e('[ class="ct mb clearfix"]');n.vod_pic=e(r).find("img")[0].attribs.src,n.vod_name=Se(/◎片 名 (.*?)<br>/,e(r).html()),n.vod_area=Se(/◎产 地 (.*?)<br>/,e(r).html()),n.vod_year=Se(/◎年 代 (.*?)<br>/,e(r).html()),n.type_name=Se(/◎类 别 (.*?)<br>/,e(r).html()),n.vod_remarks=Se(/◎集 数 (.*?)<br>/,e(r).html());let i=Se(/◎主 演 (.*?)<\/p>/s,e(r).html());B.isEmpty(i)&&(i=Se(/◎演 员 (.*?)<\/p>/s,e(r).html()));let l=[];for(let f of i.split(`