tvbox/cat/18_dist/index.js

476 lines
2.1 MiB
JavaScript
Raw Normal View History

2024-05-23 19:28:35 +08:00
var hY=Object.create;var M6=Object.defineProperty;var mY=Object.getOwnPropertyDescriptor;var gY=Object.getOwnPropertyNames;var yY=Object.getPrototypeOf,vY=Object.prototype.hasOwnProperty;var C=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Dx=(n,e)=>{for(var l in e)M6(n,l,{get:e[l],enumerable:!0})},Lx=(n,e,l,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of gY(e))!vY.call(n,r)&&r!==l&&M6(n,r,{get:()=>e[r],enumerable:!(t=mY(e,r))||t.enumerable});return n};var St=(n,e,l)=>(l=n!=null?hY(yY(n)):{},Lx(e||!n||!n.__esModule?M6(l,"default",{value:n,enumerable:!0}):l,n)),_Y=n=>Lx(M6({},"__esModule",{value:!0}),n);var Mx=C((vbe,Fx)=>{"use strict";function EY(n){var e=new n,l=e;function t(){var i=e;return i.next?e=i.next:(e=new n,l=e),i.next=null,i}function r(i){l.next=i,l=i}return{get:t,release:r}}Fx.exports=EY});var Dp=C((_be,Pp)=>{"use strict";var bY=Mx();function $x(n,e,l){if(typeof n=="function"&&(l=e,e=n,n=null),!(l>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var t=bY(TY),r=null,i=null,s=0,u=null,a={push:_,drain:m3,saturated:m3,pause:f,paused:!1,get concurrency(){return l},set concurrency(w){if(!(w>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(l=w,!a.paused)for(;r&&s<l;)s++,T()},running:c,resume:h,idle:g,length:p,getQueue:m,unshift:S,empty:m3,kill:x,killAndDrain:v,error:b};return a;function c(){return s}function f(){a.paused=!0}function p(){for(var w=r,N=0;w;)w=w.next,N++;return N}function m(){for(var w=r,N=[];w;)N.push(w.value),w=w.next;return N}function h(){if(a.paused)for(a.paused=!1;r&&s<l;)s++,T()}function g(){return s===0&&a.length()===0}function _(w,N){var O=t.get();O.context=n,O.release=T,O.value=w,O.callback=N||m3,O.errorHandler=u,s>=l||a.paused?i?(i.next=O,i=O):(r=O,i=O,a.saturated()):(s++,e.call(n,O.value,O.worked))}function S(w,N){var O=t.get();O.context=n,O.release=T,O.value=w,O.callback=N||m3,O.errorHandler=u,s>=l||a.paused?r?(O.next=r,r=O):(r=O,i=O,a.saturated()):(s++,e.call(n,O.value,O.worked))}function T(w){w&&t.release(w);var N=r;N&&s<=l?a.paused?s--:(i===r&&(i=null),r=N.next,N.next=null,e.call(n,N.value,N.worked),i===null&&a.empty()):--s===0&&a.drain()}function x(){r=null,i=null,a.drain=m3}function v(){r=null,i=null,a.drain(),a.drain=m3}function b(w){u=w}}function m3(){}function TY(){this.value=null,this.callback=m3,this.next=null,this.release=m3,this.context=null,this.errorHandler=null;var n=this;this.worked=function(l,t){var r=n.callback,i=n.errorHandler,s=n.value;n.value=null,n.callback=m3,n.errorHandler&&i(l,s),r.call(n.context,l,t),n.release(n)}}function SY(n,e,l){typeof n=="function"&&(l=e,e=n,n=null);function t(f,p){e.call(this,f).then(function(m){p(null,m)},p)}var r=$x(n,t,l),i=r.push,s=r.unshift;return r.push=u,r.unshift=a,r.drained=c,r;function u(f){var p=new Promise(function(m,h){i(f,function(g,_){if(g){h(g);return}m(_)})});return p.catch(m3),p}function a(f){var p=new Promise(function(m,h){s(f,function(g,_){if(g){h(g);return}m(_)})});return p.catch(m3),p}function c(){if(r.idle())return new Promise(function(m){m()});var f=r.drain,p=new Promise(function(m){r.drain=function(){f(),m()}});return p}}Pp.exports=$x;Pp.exports.promise=SY});var Fp=C((Ebe,jx)=>{"use strict";var{inherits:xY,format:Lp}=require("util");function ou(n,e,l=Error){if(!n)throw new Error("Avvio error code must not be empty");if(!e)throw new Error("Avvio base error message must not be empty");function t(r,i,s){if(!new.target)return new t(r,i,s);Error.captureStackTrace(this,t),this.code=n,this.message=e,this.name="AvvioError",r&&i&&s?this.message=Lp(e,r,i,s):r&&i?this.message=Lp(e,r,i):r?this.message=Lp(e,r):this.message=e}return t.prototype[Symbol.toStringTag]="Error",t.prototype.toString=function(){return`${this.name} [${this.code}]: ${this.message}`},xY(t,l),t}jx.exports={createError:ou,AVV_ERR_EXPOSE_ALREADY_DEFINED:ou("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' () is already defined, specify an expose option"),AVV_ERR_CALLBACK_NOT_FN:ou("AVV_ERR_CALLBACK_NOT_FN","Callback for '%s' hook is not a function. Received: '%s'"),AVV_ERR_PLUGIN_NO
2024-05-07 17:30:00 +08:00
`),u=`
`+l+(i.length?r("\u2502"):" ")+" ";return l+s.join(u)+`
2024-05-23 19:28:35 +08:00
`+i.map(function(a,c){var f=c===i.length-1,p=a.nodes&&a.nodes.length,m=l+(f?" ":r("\u2502"))+" ";return l+r(f?"\u2514":"\u251C")+r("\u2500")+r(p?"\u252C":"\u2500")+" "+n(a,m,t).slice(l.length+2)}).join("")}});var Xx=C((Tbe,Gx)=>{"use strict";var AY=Bx(),Hx=Symbol("avvio.TimeTree.untrackNode"),Mp=Symbol("avvio.TimeTree.trackNode"),qx=Symbol("avvio.TimeTree.getParent"),Vx=Symbol("avvio.TimeTree.getNode"),zx=Symbol("avvio.TimeTree.addNode"),$p=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Mp](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[Hx](e){this.tableId.delete(e.id);let l=this.tableLabel.get(e.label);if(l.id){this.tableLabel.delete(e.label);return}l.pop(),l.length===0&&this.tableLabel.delete(e.label)}[qx](e){if(e===null)return this.root;let l=this.tableLabel.get(e);return l.id?l:l[l.length-1]}[Vx](e){return this.tableId.get(e)}[zx](e,l,t){if(e===null)return this.root={id:"root",label:l,start:t,nodes:[]},this[Mp](this.root),this.root.id;let i=this[qx](e),s=`${l}-${Math.random()}`,u={id:s,parent:e,start:t,label:l,nodes:[]};return i.nodes.push(u),this[Mp](u),s}start(e,l,t=Date.now()){return this[zx](e,l,t)}stop(e,l=Date.now()){let t=this[Vx](e);t&&(t.stop=l,t.diff=t.stop-t.start||0,this[Hx](t))}toJSON(){return Object.assign({},this.root)}prittyPrint(){let e=t=>(t.label=`${t.label} ${t.diff} ms`,t.nodes.length>0&&(t.nodes=t.nodes.map(r=>e(r))),t),l=e(this.toJSON());return AY(l)}};Gx.exports=$p});var Kx=C((Sbe,Wx)=>{var ka=1e3,Pa=ka*60,Da=Pa*60,cu=Da*24,wY=cu*7,RY=cu*365.25;Wx.exports=function(n,e){e=e||{};var l=typeof n;if(l==="string"&&n.length>0)return OY(n);if(l==="number"&&isFinite(n))return e.long?IY(n):NY(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function OY(n){if(n=String(n),!(n.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(e){var l=parseFloat(e[1]),t=(e[2]||"ms").toLowerCase();switch(t){case"years":case"year":case"yrs":case"yr":case"y":return l*RY;case"weeks":case"week":case"w":return l*wY;case"days":case"day":case"d":return l*cu;case"hours":case"hour":case"hrs":case"hr":case"h":return l*Da;case"minutes":case"minute":case"mins":case"min":case"m":return l*Pa;case"seconds":case"second":case"secs":case"sec":case"s":return l*ka;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}function NY(n){var e=Math.abs(n);return e>=cu?Math.round(n/cu)+"d":e>=Da?Math.round(n/Da)+"h":e>=Pa?Math.round(n/Pa)+"m":e>=ka?Math.round(n/ka)+"s":n+"ms"}function IY(n){var e=Math.abs(n);return e>=cu?$6(n,e,cu,"day"):e>=Da?$6(n,e,Da,"hour"):e>=Pa?$6(n,e,Pa,"minute"):e>=ka?$6(n,e,ka,"second"):n+" ms"}function $6(n,e,l,t){var r=e>=l*1.5;return Math.round(n/l)+" "+t+(r?"s":"")}});var jp=C((xbe,Yx)=>{function CY(n){l.debug=l,l.default=l,l.coerce=a,l.disable=i,l.enable=r,l.enabled=s,l.humanize=Kx(),l.destroy=c,Object.keys(n).forEach(f=>{l[f]=n[f]}),l.names=[],l.skips=[],l.formatters={};function e(f){let p=0;for(let m=0;m<f.length;m++)p=(p<<5)-p+f.charCodeAt(m),p|=0;return l.colors[Math.abs(p)%l.colors.length]}l.selectColor=e;function l(f){let p,m=null,h,g;function _(...S){if(!_.enabled)return;let T=_,x=Number(new Date),v=x-(p||x);T.diff=v,T.prev=p,T.curr=x,p=x,S[0]=l.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let b=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(N,O)=>{if(N==="%%")return"%";b++;let k=l.formatters[O];if(typeof k=="function"){let j=S[b];N=k.call(T,j),S.splice(b,1),b--}return N}),l.formatArgs.call(T,S),(T.log||l.log).apply(T,S)}return _.namespace=f,_.useColors=l.useColors(),_.color=l.selectColor(f),_.extend=t,_.destroy=l.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(h!==l.namespaces&&(h=l.namespaces,g=l.enabled(f)),g),set:S=>{m=S}}),typeof l.init=="function"&&l.init(_),_}function t(f,p){let m=l(this.namespace+(typeof p>"u"?":":p)+f);return m.log=this.log,m}function r(
2024-04-02 15:03:09 +08:00
`).join(`
2024-05-23 19:28:35 +08:00
`+i),n.push(r+"m+"+B6.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=VY()+e+" "+n[0]}function VY(){return Gt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function zY(...n){return process.stderr.write(U6.format(...n)+`
`)}function GY(n){n?process.env.DEBUG=n:delete process.env.DEBUG}function XY(){return process.env.DEBUG}function WY(n){n.inspectOpts={};let e=Object.keys(Gt.inspectOpts);for(let l=0;l<e.length;l++)n.inspectOpts[e[l]]=Gt.inspectOpts[e[l]]}B6.exports=jp()(Gt);var{formatters:lA}=B6.exports;lA.o=function(n){return this.inspectOpts.colors=this.useColors,U6.inspect(n,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};lA.O=function(n){return this.inspectOpts.colors=this.useColors,U6.inspect(n,this.inspectOpts)}});var H6=C((Rbe,Bp)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Bp.exports=Jx():Bp.exports=tA()});var rA=C((Obe,Vp)=>{"use strict";var KY=Dp(),YY=require("events").EventEmitter,JY=require("util").inherits,Ft=H6()("avvio"),{AVV_ERR_READY_TIMEOUT:QY}=Fp(),Hp=Symbol.for("plugin-meta");function ZY(n,e){return n[Hp]&&n[Hp].name?n[Hp].name:typeof e<"u"&&typeof e!="function"&&e.name?e.name:n.name?n.name:n.toString().split(`
`).slice(0,2).map(l=>l.trim()).join(" -- ")}function eJ(){let n={};return n.promise=new Promise((e,l)=>{n.resolve=e,n.reject=l}),n}function Fa(n,e,l,t,r){this.started=!1,this.func=e,this.opts=l,this.onFinish=null,this.parent=n,this.timeout=r===void 0?n._timeout:r,this.name=ZY(e,l),this.isAfter=t,this.q=KY(n,nJ,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}JY(Fa,YY);Fa.prototype.exec=function(n,e){let l=this.func,t=!1,r=this.name;if(this.parent._error&&!this.isAfter){Ft("skipping loading of plugin as parent errored and it is not an after",r),process.nextTick(e);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,l,this.opts)}catch(a){return Ft("override errored",r),e(a)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ft("exec",r);let i,s=a=>{if(t){Ft("loading complete",r);return}this._error=a,Ft(a?"exec errored":"exec completed",r),t=!0,i&&clearTimeout(i),e(a)};this.timeout>0&&(Ft("setting up timeout",r,this.timeout),i=setTimeout(function(){Ft("timed out",r),i=null;let a=new QY(r);a.fn=l,s(a)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());let u=l(this.server,this.opts,s);u&&typeof u.then=="function"&&(Ft("exec: resolving promise",r),u.then(()=>process.nextTick(s),a=>process.nextTick(s,a)))};Fa.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();let n=()=>{this.server.after((l,t)=>{this._error=l,this.q.pause(),l?(Ft("rejecting promise",this.name,l),this._promise.reject(l)):(Ft("resolving promise",this.name),this._promise.resolve()),this._promise=null,process.nextTick(t,l)}),this.q.resume()},e;return this._promise?e=Promise.resolve():(this._promise=eJ(),e=this._promise.promise,this.server?n():this.on("start",n)),e};Fa.prototype.enqueue=function(n,e){Ft("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,e)};Fa.prototype.finish=function(n,e){Ft("finish",this.name,n);let l=()=>{this.loaded||(Ft("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,e(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),l();return}let t=()=>{if(Ft("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){let r=()=>{Ft("wrap"),queueMicrotask(t)};this._promise.resolve(),this._promise.promise.then(r,r),this._promise=null}else l();else Ft("delayed",this.name),this.q.drain=()=>{Ft("drain",this.name),this.q.drain=lJ,queueMicrotask(t)}};queueMicrotask(t),this.q.resume()};function nJ(n,e){let l=this;process.nextTick(qp.bind(l),n,e)}function qp(n,e){if(typeof n.func.then=="function"){n.func.then(t=>{typeof t.default=="function"&&(t=t.default),n.func=t,qp.call(this,n,e)},e);return}let l=this._current[0];this._current.unshift(n),n.exec(l&&l.server||this._server,t=>{n.finish(t,r=>{this._current.shift(),e(r)})})}function lJ(){}Vp.exports=Fa;Vp.exports.loadPlugin=qp});var oA=C((Nbe,Kp)=>{"use strict";var iA=Dp(),tJ=require("events").EventEmitter,rJ=require("util").inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:zp,AVV_ERR_CALLBACK_NOT_FN:Y4,AVV_ERR_PLUGIN_NOT_VALID:iJ,AVV_ERR_ROOT_PLG_BOOTED:sJ,AVV_ERR_READY_TIMEOUT:uJ}=Fp(),aJ=Xx(),Wp=rA(),Ma=H6()("avvio"),q6=Symbol("kAvvio"),Gp=Symbol("kThenifyDoNotWrap");function oJ(n,e,l){let t=e.expose||{},r=t.use||"use",i=t.after||"after",s=t.ready||"ready",u=t.onClose||"onClose",a=t.close||"close";if(n[r])throw new zp(r);if(n[i])throw new zp(i);if(n[s])throw new zp(s);n[r]=function(c,f){return l.use(c,f),this},Object.defineProperty(n,"then",{get:uA.bind(l)}),n[q6]=!0,n[i]=function(c){return typeof c!="function"?l._loadRegistered():(l.after(Xp(c,this)),this)},n[s]=function(c){if(c&&typeof c!="function")throw new Y4(s,typeof c);return l.ready(c?Xp(c,this):void 0)},n[u]=function(c){if(typeof c!="function")throw new Y4(u,typeof c);return l.onClose(hJ(c,this)),this},n[a]=function(c){if(c&&typeof c!="function")throw new Y4(a,typeof c);return c?(l.close(Xp(c,this)),this):l.
causes have become circular...`;let t=fd(n);return t?(e.add(n),l+`
caused by: `+HA(t,e)):l},NQ=n=>HA(n,new Set),qA=(n,e,l)=>{if(!e0(n))return"";let t=l?"":n.message||"";if(e.has(n))return t+": ...";let r=fd(n);if(r){e.add(n);let i=typeof n.cause=="function";return t+(i?"":": ")+qA(r,e,i)}else return t},IQ=n=>qA(n,new Set);VA.exports={isErrorLike:e0,getErrorCause:fd,stackWithCauses:NQ,messageWithCauses:IQ}});var dd=C((Hbe,GA)=>{"use strict";var CQ=Symbol("circular-ref-tag"),e8=Symbol("pino-raw-err-ref"),zA=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[e8]},set:function(n){this[e8]=n}}});Object.defineProperty(zA,e8,{writable:!0,value:{}});GA.exports={pinoErrProto:zA,pinoErrorSymbols:{seen:CQ,rawSymbol:e8}}});var KA=C((qbe,WA)=>{"use strict";WA.exports=md;var{messageWithCauses:kQ,stackWithCauses:PQ,isErrorLike:XA}=pd(),{pinoErrProto:DQ,pinoErrorSymbols:LQ}=dd(),{seen:hd}=LQ,{toString:FQ}=Object.prototype;function md(n){if(!XA(n))return n;n[hd]=void 0;let e=Object.create(DQ);e.type=FQ.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,e.message=kQ(n),e.stack=PQ(n),Array.isArray(n.errors)&&(e.aggregateErrors=n.errors.map(l=>md(l)));for(let l in n)if(e[l]===void 0){let t=n[l];XA(t)?l!=="cause"&&!Object.prototype.hasOwnProperty.call(t,hd)&&(e[l]=md(t)):e[l]=t}return delete n[hd],e.raw=n,e}});var JA=C((Vbe,YA)=>{"use strict";YA.exports=l8;var{isErrorLike:gd}=pd(),{pinoErrProto:MQ,pinoErrorSymbols:$Q}=dd(),{seen:n8}=$Q,{toString:jQ}=Object.prototype;function l8(n){if(!gd(n))return n;n[n8]=void 0;let e=Object.create(MQ);e.type=jQ.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,e.message=n.message,e.stack=n.stack,Array.isArray(n.errors)&&(e.aggregateErrors=n.errors.map(l=>l8(l))),gd(n.cause)&&!Object.prototype.hasOwnProperty.call(n.cause,n8)&&(e.cause=l8(n.cause));for(let l in n)if(e[l]===void 0){let t=n[l];gd(t)?Object.prototype.hasOwnProperty.call(t,n8)||(e[l]=l8(t)):e[l]=t}return delete n[n8],e.raw=n,e}});var nw=C((zbe,ew)=>{"use strict";ew.exports={mapHttpRequest:UQ,reqSerializer:ZA};var yd=Symbol("pino-raw-req-ref"),QA=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[yd]},set:function(n){this[yd]=n}}});Object.defineProperty(QA,yd,{writable:!0,value:{}});function ZA(n){let e=n.info||n.socket,l=Object.create(QA);if(l.id=typeof n.id=="function"?n.id():n.id||(n.info?n.info.id:void 0),l.method=n.method,n.originalUrl)l.url=n.originalUrl;else{let t=n.path;l.url=typeof t=="string"?t:n.url?n.url.path||n.url:void 0}return n.query&&(l.query=n.query),n.params&&(l.params=n.params),l.headers=n.headers,l.remoteAddress=e&&e.remoteAddress,l.remotePort=e&&e.remotePort,l.raw=n.raw||n,l}function UQ(n){return{req:ZA(n)}}});var iw=C((Gbe,rw)=>{"use strict";rw.exports={mapHttpResponse:BQ,resSerializer:tw};var vd=Symbol("pino-raw-res-ref"),lw=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[vd]},set:function(n){this[vd]=n}}});Object.defineProperty(lw,vd,{writable:!0,value:{}});function tw(n){let e=Object.create(lw);return e.statusCode=n.headersSent?n.statusCode:null,e.headers=n.getHeaders?n.getHeaders():n._headers,e.raw=n,e}function BQ(n){return{res:tw(n)}}});var Ed=C((Xbe,sw)=>{"use strict";var _d=KA(),HQ=JA(),t8=nw(),r8=iw();sw.exports={err:_d,errWithCause:HQ,mapHttpRequest:t8.mapHttpRequest,mapHttpResponse:r8.mapHttpResponse,req:t8.reqSerializer,res:r8.resSerializer,wrapErrorSerializer:function(e){return e===_d?e:function(t){return e(_d(t))}},wrapRequestSerializer:function(e){return e===t8.reqS
2024-04-02 15:03:09 +08:00
'use strict'
const o = new Proxy({}, { get: () => o, set: () => { throw Error() } });
const \u3007 = null;
o${s}
2024-05-23 19:28:35 +08:00
if ([o${s}].length !== 1) throw Error()`)()}catch{throw Error(l(i))}})}}});var i8=C((Ybe,cw)=>{"use strict";cw.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var pw=C((Jbe,fw)=>{"use strict";var zQ=i8();fw.exports=GQ;function GQ({paths:n}){let e=[];var l=0;let t=n.reduce(function(r,i,s){var u=i.match(zQ).map(f=>f.replace(/'|"|`/g,""));let a=i[0]==="[";u=u.map(f=>f[0]==="["?f.substr(1,f.length-2):f);let c=u.indexOf("*");if(c>-1){let f=u.slice(0,c),p=f.join("."),m=u.slice(c+1,u.length),h=m.length>0;l++,e.push({before:f,beforeStr:p,after:m,nested:h})}else r[i]={path:u,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:a};return r},{});return{wildcards:e,wcLen:l,secret:t}}});var hw=C((Qbe,dw)=>{"use strict";var XQ=i8();dw.exports=WQ;function WQ({secret:n,serialize:e,wcLen:l,strict:t,isCensorFct:r,censorFctTakesPath:i},s){let u=Function("o",`
2024-04-02 15:03:09 +08:00
if (typeof o !== 'object' || o == null) {
2024-05-23 19:28:35 +08:00
${QQ(t,e)}
2024-04-02 15:03:09 +08:00
}
const { censor, secret } = this
2024-05-23 19:28:35 +08:00
${KQ(n,r,i)}
2024-04-02 15:03:09 +08:00
this.compileRestore()
2024-05-23 19:28:35 +08:00
${YQ(l>0,r,i)}
${JQ(e)}
`).bind(s);return e===!1&&(u.restore=a=>s.restore(a)),u}function KQ(n,e,l){return Object.keys(n).map(t=>{let{escPath:r,leadingBracket:i,path:s}=n[t],u=i?1:0,a=i?"":".",c=[];for(var f;(f=XQ.exec(t))!==null;){let[,g]=f,{index:_,input:S}=f;_>u&&c.push(S.substring(0,_-(g?0:1)))}var p=c.map(g=>`o${a}${g}`).join(" && ");p.length===0?p+=`o${a}${t} != null`:p+=` && o${a}${t} != null`;let m=`
2024-04-02 15:03:09 +08:00
switch (true) {
2024-04-23 12:29:20 +08:00
${c.reverse().map(g=>`
2024-05-07 17:30:00 +08:00
case o${a}${g} === censor:
secret[${r}].circle = ${JSON.stringify(g)}
2024-04-02 15:03:09 +08:00
break
`).join(`
`)}
}
2024-05-23 19:28:35 +08:00
`,h=l?`val, ${JSON.stringify(s)}`:"val";return`
2024-04-02 15:03:09 +08:00
if (${p}) {
2024-05-07 17:30:00 +08:00
const val = o${a}${t}
2024-04-02 15:03:09 +08:00
if (val === censor) {
2024-05-07 17:30:00 +08:00
secret[${r}].precensored = true
2024-04-02 15:03:09 +08:00
} else {
2024-05-07 17:30:00 +08:00
secret[${r}].val = val
2024-05-23 19:28:35 +08:00
o${a}${t} = ${e?`censor(${h})`:"censor"}
2024-04-02 15:03:09 +08:00
${m}
}
}
`}).join(`
2024-05-23 19:28:35 +08:00
`)}function YQ(n,e,l){return n===!0?`
2024-04-02 15:03:09 +08:00
{
const { wildcards, wcLen, groupRedact, nestedRedact } = this
for (var i = 0; i < wcLen; i++) {
const { before, beforeStr, after, nested } = wildcards[i]
if (nested === true) {
secret[beforeStr] = secret[beforeStr] || []
2024-05-07 17:30:00 +08:00
nestedRedact(secret[beforeStr], o, before, after, censor, ${e}, ${l})
} else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${l})
2024-04-02 15:03:09 +08:00
}
}
2024-05-23 19:28:35 +08:00
`:""}function JQ(n){return n===!1?"return o":`
2024-04-02 15:03:09 +08:00
var s = this.serialize(o)
this.restore(o)
return s
2024-05-23 19:28:35 +08:00
`}function QQ(n,e){return n===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Sd=C((Zbe,yw)=>{"use strict";yw.exports={groupRedact:eZ,groupRestore:ZQ,nestedRedact:lZ,nestedRestore:nZ};function ZQ({keys:n,values:e,target:l}){if(l==null)return;let t=n.length;for(var r=0;r<t;r++){let i=n[r];l[i]=e[r]}}function eZ(n,e,l,t,r){let i=mw(n,e);if(i==null)return{keys:null,values:null,target:null,flat:!0};let s=Object.keys(i),u=s.length,a=e.length,c=r?[...e]:void 0,f=new Array(u);for(var p=0;p<u;p++){let m=s[p];f[p]=i[m],r?(c[a]=m,i[m]=l(i[m],c)):t?i[m]=l(i[m]):i[m]=l}return{keys:s,values:f,target:i,flat:!0}}function nZ(n){for(let e=0;e<n.length;e++){let{target:l,path:t,value:r}=n[e],i=l;for(let s=t.length-1;s>0;s--)i=i[t[s]];i[t[0]]=r}}function lZ(n,e,l,t,r,i,s){let u=mw(e,l);if(u==null)return;let a=Object.keys(u),c=a.length;for(var f=0;f<c;f++){let p=a[f];tZ(n,u,p,l,t,r,i,s)}return n}function Td(n,e){return n!=null?"hasOwn"in Object?Object.hasOwn(n,e):Object.prototype.hasOwnProperty.call(n,e):!1}function tZ(n,e,l,t,r,i,s,u){let a=r.length,c=a-1,f=l;var p=-1,m,h,g,_=null,S=null,T,x,v=!1,b=0,w=0,N=rZ();if(g=m=e[l],typeof m=="object"){for(;m!=null&&++p<a&&(w+=1,l=r[p],_=g,!(l!=="*"&&!S&&!(typeof m=="object"&&l in m)));)if(!(l==="*"&&(S==="*"&&(v=!0),S=l,p!==c))){if(S){let k=Object.keys(m);for(var O=0;O<k.length;O++){let j=k[O];if(x=m[j],T=l==="*",v)N=si(N,j,w),b=p,g=gw(x,b-1,l,t,r,i,s,u,f,m,h,g,T,j,p,c,N,n,e[f],w+1);else if(T||typeof x=="object"&&x!==null&&l in x){if(T?g=x:g=x[l],h=p!==c?g:s?u?i(g,[...t,f,...r]):i(g):i,T){let L=n0(si(N,j,w),g,e[f]);n.push(L),m[j]=h}else if(x[l]!==h)if(h===void 0&&i!==void 0||Td(x,l)&&h===g)N=si(N,j,w);else{N=si(N,j,w);let L=n0(si(N,l,w+1),g,e[f]);n.push(L),x[l]=h}}}S=null}else{if(g=m[l],N=si(N,l,w),h=p!==c?g:s?u?i(g,[...t,f,...r]):i(g):i,!(Td(m,l)&&h===g||h===void 0&&i!==void 0)){let k=n0(N,g,e[f]);n.push(k),m[l]=h}m=m[l]}if(typeof m!="object")break}}}function mw(n,e){for(var l=-1,t=e.length,r=n;r!=null&&++l<t;)r=r[e[l]];return r}function gw(n,e,l,t,r,i,s,u,a,c,f,p,m,h,g,_,S,T,x,v){if(e===0&&(m||typeof n=="object"&&n!==null&&l in n)){if(m?p=n:p=n[l],f=g!==_?p:s?u?i(p,[...t,a,...r]):i(p):i,m){let b=n0(S,p,x);T.push(b),c[h]=f}else if(n[l]!==f){if(!(f===void 0&&i!==void 0||Td(n,l)&&f===p)){let b=n0(si(S,l,v+1),p,x);T.push(b),n[l]=f}}}for(let b in n)typeof n[b]=="object"&&(S=si(S,b,v),gw(n[b],e-1,l,t,r,i,s,u,a,c,f,p,m,h,g,_,S,T,x,v+1))}function rZ(){return{parent:null,key:null,children:[],depth:0}}function si(n,e,l){if(n.depth===l)return si(n.parent,e,l);var t={parent:n,key:e,depth:l,children:[]};return n.children.push(t),t}function n0(n,e,l){let t=n,r=[];do r.push(t.key),t=t.parent;while(t.parent!=null);return{path:r,value:e,target:l}}});var _w=C((eTe,vw)=>{"use strict";var{groupRestore:iZ,nestedRestore:sZ}=Sd();vw.exports=uZ;function uZ({secret:n,wcLen:e}){return function(){if(this.restore)return;let t=Object.keys(n),r=aZ(n,t),i=e>0,s=i?{secret:n,groupRestore:iZ,nestedRestore:sZ}:{secret:n};this.restore=Function("o",oZ(r,t,i)).bind(s)}}function aZ(n,e){return e.map(l=>{let{circle:t,escPath:r,leadingBracket:i}=n[l],u=t?`o.${t} = secret[${r}].val`:`o${i?"":"."}${l} = secret[${r}].val`,a=`secret[${r}].val = undefined`;return`
2024-05-07 17:30:00 +08:00
if (secret[${r}].val !== undefined) {
try { ${u} } catch (e) {}
${a}
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`}).join("")}function oZ(n,e,l){return`
2024-04-02 15:03:09 +08:00
const secret = this.secret
2024-05-07 17:30:00 +08:00
${l===!0?`
2024-04-02 15:03:09 +08:00
const keys = Object.keys(secret)
const len = keys.length
for (var i = len - 1; i >= ${e.length}; i--) {
const k = keys[i]
const o = secret[k]
if (o.flat === true) this.groupRestore(o)
else this.nestedRestore(o)
secret[k] = null
}
`:""}
2024-05-07 17:30:00 +08:00
${n}
2024-04-02 15:03:09 +08:00
return o
2024-05-23 19:28:35 +08:00
`}});var bw=C((nTe,Ew)=>{"use strict";Ew.exports=cZ;function cZ(n){let{secret:e,censor:l,compileRestore:t,serialize:r,groupRedact:i,nestedRedact:s,wildcards:u,wcLen:a}=n,c=[{secret:e,censor:l,compileRestore:t}];return r!==!1&&c.push({serialize:r}),a>0&&c.push({groupRedact:i,nestedRedact:s,wildcards:u,wcLen:a}),Object.assign(...c)}});var xw=C((lTe,Sw)=>{"use strict";var Tw=ow(),fZ=pw(),pZ=hw(),dZ=_w(),{groupRedact:hZ,nestedRedact:mZ}=Sd(),gZ=bw(),yZ=i8(),vZ=Tw(),xd=n=>n;xd.restore=xd;var _Z="[REDACTED]";Ad.rx=yZ;Ad.validator=Tw;Sw.exports=Ad;function Ad(n={}){let e=Array.from(new Set(n.paths||[])),l="serialize"in n&&(n.serialize===!1||typeof n.serialize=="function")?n.serialize:JSON.stringify,t=n.remove;if(t===!0&&l!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let r=t===!0?void 0:"censor"in n?n.censor:_Z,i=typeof r=="function",s=i&&r.length>1;if(e.length===0)return l||xd;vZ({paths:e,serialize:l,censor:r});let{wildcards:u,wcLen:a,secret:c}=fZ({paths:e,censor:r}),f=dZ({secret:c,wcLen:a}),p="strict"in n?n.strict:!0;return pZ({secret:c,wcLen:a,serialize:l,strict:p,isCensorFct:i,censorFctTakesPath:s},gZ({secret:c,censor:r,compileRestore:f,serialize:l,groupRedact:hZ,nestedRedact:mZ,wildcards:u,wcLen:a}))}});var Ba=C((tTe,Aw)=>{"use strict";var EZ=Symbol("pino.setLevel"),bZ=Symbol("pino.getLevel"),TZ=Symbol("pino.levelVal"),SZ=Symbol("pino.levelComp"),xZ=Symbol("pino.useLevelLabels"),AZ=Symbol("pino.useOnlyCustomLevels"),wZ=Symbol("pino.mixin"),RZ=Symbol("pino.lsCache"),OZ=Symbol("pino.chindings"),NZ=Symbol("pino.asJson"),IZ=Symbol("pino.write"),CZ=Symbol("pino.redactFmt"),kZ=Symbol("pino.time"),PZ=Symbol("pino.timeSliceIndex"),DZ=Symbol("pino.stream"),LZ=Symbol("pino.stringify"),FZ=Symbol("pino.stringifySafe"),MZ=Symbol("pino.stringifiers"),$Z=Symbol("pino.end"),jZ=Symbol("pino.formatOpts"),UZ=Symbol("pino.messageKey"),BZ=Symbol("pino.errorKey"),HZ=Symbol("pino.nestedKey"),qZ=Symbol("pino.nestedKeyStr"),VZ=Symbol("pino.mixinMergeStrategy"),zZ=Symbol("pino.msgPrefix"),GZ=Symbol("pino.wildcardFirst"),XZ=Symbol.for("pino.serializers"),WZ=Symbol.for("pino.formatters"),KZ=Symbol.for("pino.hooks"),YZ=Symbol.for("pino.metadata");Aw.exports={setLevelSym:EZ,getLevelSym:bZ,levelValSym:TZ,levelCompSym:SZ,useLevelLabelsSym:xZ,mixinSym:wZ,lsCacheSym:RZ,chindingsSym:OZ,asJsonSym:NZ,writeSym:IZ,serializersSym:XZ,redactFmtSym:CZ,timeSym:kZ,timeSliceIndexSym:PZ,streamSym:DZ,stringifySym:LZ,stringifySafeSym:FZ,stringifiersSym:MZ,endSym:$Z,formatOptsSym:jZ,messageKeySym:UZ,errorKeySym:BZ,nestedKeySym:HZ,wildcardFirstSym:GZ,needsMetadataGsym:YZ,useOnlyCustomLevelsSym:AZ,formattersSym:WZ,hooksSym:KZ,nestedKeyStrSym:qZ,mixinMergeStrategySym:VZ,msgPrefixSym:zZ}});var Od=C((rTe,Nw)=>{"use strict";var Rd=xw(),{redactFmtSym:JZ,wildcardFirstSym:s8}=Ba(),{rx:wd,validator:QZ}=Rd,ww=QZ({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:n=>`pino \u2013 redact paths array contains an invalid path (${n})`}),Rw="[Redacted]",Ow=!1;function ZZ(n,e){let{paths:l,censor:t}=eee(n),r=l.reduce((u,a)=>{wd.lastIndex=0;let c=wd.exec(a),f=wd.exec(a),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=s8),f===null)return u[p]=null,u;if(u[p]===null)return u;let{index:m}=f,h=`${a.substr(m,a.length-1)}`;return u[p]=u[p]||[],p!==s8&&u[p].length===0&&u[p].push(...u[s8]||[]),p===s8&&Object.keys(u).forEach(function(g){u[g]&&u[g].push(h)}),u[p].push(h),u},{}),i={[JZ]:Rd({paths:l,censor:t,serialize:e,strict:Ow})},s=(...u)=>e(typeof t=="function"?t(...u):t);return[...Object.keys(r),...Object.getOwnPropertySymbols(r)].reduce((u,a)=>{if(r[a]===null)u[a]=c=>s(c,[a]);else{let c=typeof t=="function"?(f,p)=>t(f,[a,...p]):t;u[a]=Rd({paths:r[a],censor:c,serialize:e,strict:Ow})}return u},i)}function eee(n){if(Array.isArray(n))return n={paths:n,censor:Rw},ww(n),n;let{paths:e,censor:l=Rw,remove:t}=n;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return t===!0&&(l=void 0),ww({paths:e,censor:l}),{paths:e,censo
2024-04-02 15:03:09 +08:00
${T}`,b=`,
2024-05-23 19:28:35 +08:00
${T}`);let Q=Math.min(x.length,s),Y=0;for(;Y<Q-1;Y++){let _e=u(String(Y),x,g,_,S,T);v+=_e!==void 0?_e:"null",v+=b}let Z=u(String(Y),x,g,_,S,T);if(v+=Z!==void 0?Z:"null",x.length-1>s){let _e=x.length-s-1;v+=`${b}"... ${du(_e)} not stringified"`}return S!==""&&(v+=`
${w}`),g.pop(),`[${v}]`}let N=Object.keys(x),O=N.length;if(O===0)return"{}";if(i<g.length+1)return'"[Object]"';let k="",j="";S!==""&&(T+=S,b=`,
${T}`,k=" ");let L=Math.min(O,s);r&&!Zd(x)&&(N=Qd(N)),g.push(x);for(let Q=0;Q<L;Q++){let Y=N[Q],Z=u(Y,x,g,_,S,T);Z!==void 0&&(v+=`${j}${Hi(Y)}:${k}${Z}`,j=b)}if(O>s){let Q=O-s;v+=`${j}"...":${k}"${du(Q)} not stringified"`,j=b}return S!==""&&j.length>1&&(v=`
2024-04-15 09:41:50 +08:00
${T}${v}
2024-05-23 19:28:35 +08:00
${w}`),g.pop(),`{${v}}`}case"number":return isFinite(x)?String(x):e?e(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(t)return String(x);default:return e?e(x):void 0}}function a(m,h,g,_,S,T){switch(typeof h=="object"&&h!==null&&typeof h.toJSON=="function"&&(h=h.toJSON(m)),typeof h){case"string":return Hi(h);case"object":{if(h===null)return"null";if(g.indexOf(h)!==-1)return l;let x=T,v="",b=",";if(Array.isArray(h)){if(h.length===0)return"[]";if(i<g.length+1)return'"[Array]"';g.push(h),S!==""&&(T+=S,v+=`
2024-04-02 15:03:09 +08:00
${T}`,b=`,
2024-05-23 19:28:35 +08:00
${T}`);let O=Math.min(h.length,s),k=0;for(;k<O-1;k++){let L=a(String(k),h[k],g,_,S,T);v+=L!==void 0?L:"null",v+=b}let j=a(String(k),h[k],g,_,S,T);if(v+=j!==void 0?j:"null",h.length-1>s){let L=h.length-s-1;v+=`${b}"... ${du(L)} not stringified"`}return S!==""&&(v+=`
${x}`),g.pop(),`[${v}]`}g.push(h);let w="";S!==""&&(T+=S,b=`,
${T}`,w=" ");let N="";for(let O of _){let k=a(O,h[O],g,_,S,T);k!==void 0&&(v+=`${N}${Hi(O)}:${w}${k}`,N=b)}return S!==""&&N.length>1&&(v=`
2024-04-15 09:41:50 +08:00
${T}${v}
2024-05-23 19:28:35 +08:00
${x}`),g.pop(),`{${v}}`}case"number":return isFinite(h)?String(h):e?e(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(t)return String(h);default:return e?e(h):void 0}}function c(m,h,g,_,S){switch(typeof h){case"string":return Hi(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(m),typeof h!="object")return c(m,h,g,_,S);if(h===null)return"null"}if(g.indexOf(h)!==-1)return l;let T=S;if(Array.isArray(h)){if(h.length===0)return"[]";if(i<g.length+1)return'"[Array]"';g.push(h),S+=_;let k=`
2024-04-23 12:29:20 +08:00
${S}`,j=`,
2024-05-23 19:28:35 +08:00
${S}`,L=Math.min(h.length,s),Q=0;for(;Q<L-1;Q++){let Z=c(String(Q),h[Q],g,_,S);k+=Z!==void 0?Z:"null",k+=j}let Y=c(String(Q),h[Q],g,_,S);if(k+=Y!==void 0?Y:"null",h.length-1>s){let Z=h.length-s-1;k+=`${j}"... ${du(Z)} not stringified"`}return k+=`
${T}`,g.pop(),`[${k}]`}let x=Object.keys(h),v=x.length;if(v===0)return"{}";if(i<g.length+1)return'"[Object]"';S+=_;let b=`,
${S}`,w="",N="",O=Math.min(v,s);Zd(h)&&(w+=CR(h,b,s),x=x.slice(h.length),O-=h.length,N=b),r&&(x=Qd(x)),g.push(h);for(let k=0;k<O;k++){let j=x[k],L=c(j,h[j],g,_,S);L!==void 0&&(w+=`${N}${Hi(j)}: ${L}`,N=b)}if(v>s){let k=v-s;w+=`${N}"...": "${du(k)} not stringified"`,N=b}return N!==""&&(w=`
${S}${w}
${T}`),g.pop(),`{${w}}`}case"number":return isFinite(h)?String(h):e?e(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(t)return String(h);default:return e?e(h):void 0}}function f(m,h,g){switch(typeof h){case"string":return Hi(h);case"object":{if(h===null)return"null";if(typeof h.toJSON=="function"){if(h=h.toJSON(m),typeof h!="object")return f(m,h,g);if(h===null)return"null"}if(g.indexOf(h)!==-1)return l;let _="";if(Array.isArray(h)){if(h.length===0)return"[]";if(i<g.length+1)return'"[Array]"';g.push(h);let b=Math.min(h.length,s),w=0;for(;w<b-1;w++){let O=f(String(w),h[w],g);_+=O!==void 0?O:"null",_+=","}let N=f(String(w),h[w],g);if(_+=N!==void 0?N:"null",h.length-1>s){let O=h.length-s-1;_+=`,"... ${du(O)} not stringified"`}return g.pop(),`[${_}]`}let S=Object.keys(h),T=S.length;if(T===0)return"{}";if(i<g.length+1)return'"[Object]"';let x="",v=Math.min(T,s);Zd(h)&&(_+=CR(h,",",s),S=S.slice(h.length),v-=h.length,x=","),r&&(S=Qd(S)),g.push(h);for(let b=0;b<v;b++){let w=S[b],N=f(w,h[w],g);N!==void 0&&(_+=`${x}${Hi(w)}:${N}`,x=",")}if(T>s){let b=T-s;_+=`${x}"...":"${du(b)} not stringified"`}return g.pop(),`{${_}}`}case"number":return isFinite(h)?String(h):e?e(h):"null";case"boolean":return h===!0?"true":"false";case"undefined":return;case"bigint":if(t)return String(h);default:return e?e(h):void 0}}function p(m,h,g){if(arguments.length>1){let _="";if(typeof g=="number"?_=" ".repeat(Math.min(g,10)):typeof g=="string"&&(_=g.slice(0,10)),h!=null){if(typeof h=="function")return u("",{"":m},[],h,_,"");if(Array.isArray(h))return a("",m,[],Ale(h),_,"")}if(_.length!==0)return c("",m,[],_,"")}return f("",m,[])}return p}});var $R=C((bTe,MR)=>{"use strict";var lh=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:FR}=g8(),Rle=FR.info;function Ole(n,e){let l=0;n=n||[],e=e||{dedupe:!1};let t=Object.create(FR);t.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(f=>{t[f]=e.levels[f]});let r={write:i,add:u,flushSync:s,end:a,minLevel:0,streams:[],clone:c,[lh]:!0,streamLevels:t};return Array.isArray(n)?n.forEach(u,r):u.call(r,n),n=null,r;function i(f){let p,m=this.lastLevel,{streams:h}=this,g=0,_;for(let S=Ile(h.length,e.dedupe);kle(S,h.length,e.dedupe);S=Cle(S,e.dedupe))if(p=h[S],p.level<=m){if(g!==0&&g!==p.level)break;if(_=p.stream,_[lh]){let{lastTime:T,lastMsg:x,lastObj:v,lastLogger:b}=this;_.lastLevel=m,_.lastTime=T,_.lastMsg=x,_.lastObj=v,_.lastLogger=b}_.write(f),e.dedupe&&(g=p.level)}else if(!e.dedupe)break}function s(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync()}function u(f){if(!f)return r;let p=typeof f.write=="function"||f.stream,m=f.write?f:f.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:h,streamLevels:g}=this,_;typeof f.levelVal=="number"?_=f.levelVal:typeof f.level=="string"?_=g[f.level]:typeof f.level=="number"?_=f.level:_=Rle;let S={stream:m,level:_,levelVal:void 0,id:l++};return h.unshift(S),h.sort(Nle),this.minLevel=h[0].level,r}function a(){for(let{stream:f}of this.streams)typeof f.flushSync=="function"&&f.flushSync(),f.end()}function c(f){let p=new Array(this.streams.length);for(let m=0;m<p.length;m++)p[m]={level:f,stream:this.streams[m].stream};return{write:i,add:u,minLevel:f,streams:p,clone:c,flushSync:s,[lh]:!0}}}function Nle(n,e){return n.level-e.level}function Ile(n,e){return e?n-1:0}function Cle(n,e){return e?n-1:n+1}function kle(n,e,l){return l?n>=0:n<e}MR.exports=Ole});var JR=C((TTe,g3)=>{"use strict";var Ple=require("os"),GR=Ed(),Dle=bd(),Lle=Od(),XR=Cw(),Fle=IR(),WR=Ba(),{configure:Mle}=LR(),{assertDefaultLevelFound:$le,mappings:KR,genLsCache:jle,genLevelComparison:Ule,assertLevelComparison:Ble}=Xd(),{DEFAULT_LEVELS:Hle,SORTING_ORDER:qle}=g8(),{createArgsNormalizer:Vle,asChindings:zle,buildSafeSonicBoom:jR,buildFormatters:Gle,stringify:th,normalizeDestFileDescriptor:UR,noop:Xle}=m8(),{version:Wle}=Wd(),{chindingsSym:BR,redactFmtSym:Kle,serializersSym:HR,timeSym:Yle,timeSliceIndexSym:Jle,streamSym:Qle,stringifySym:qR,stringifySafeSym:rh,strin
2024-04-02 15:03:09 +08:00
`:`
2024-05-23 19:28:35 +08:00
`),Ne=zle.bind(null,{[BR]:"",[HR]:s,[VR]:Y,[qR]:th,[rh]:j,[zR]:L}),pe="";p!==null&&(m===void 0?pe=Ne(p):pe=Ne(Object.assign({},p,{name:m})));let ue=u instanceof Function?u:u?YR:pte,ve=ue().indexOf(":")+1;if(x&&!g)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(S&&typeof S!="function")throw Error(`Unknown mixin type "${typeof S}" - expected "function"`);if(k&&typeof k!="string")throw Error(`Unknown msgPrefix type "${typeof k}" - expected "string"`);$le(h,g,x);let q=KR(g,x);Ble(_);let re=Ule(_);return Object.assign(e,{levels:q,[ste]:re,[ute]:x,[Qle]:t,[Yle]:ue,[Jle]:ve,[qR]:th,[rh]:j,[VR]:Y,[ete]:_e,[nte]:Z,[lte]:a,[tte]:c,[rte]:f,[ote]:f?`,${JSON.stringify(f)}:{`:"",[HR]:s,[ite]:S,[cte]:T,[BR]:pe,[zR]:L,[ate]:b,silent:Xle,onChild:O,[fte]:k}),Object.setPrototypeOf(e,Fle()),jle(e),e[Zle](h),e}g3.exports=ih;g3.exports.destination=(n=process.stdout.fd)=>typeof n=="object"?(n.dest=UR(n.dest||process.stdout.fd),jR(n)):jR({dest:UR(n),minLength:0});g3.exports.transport=Bd();g3.exports.multistream=$R();g3.exports.levels=KR();g3.exports.stdSerializers=vte;g3.exports.stdTimeFunctions=Object.assign({},XR);g3.exports.symbols=WR;g3.exports.version=Wle;g3.exports.default=ih;g3.exports.pino=ih});var t0=C((STe,lO)=>{"use strict";var _te=BA(),v8=JR(),{serializersSym:QR}=v8.symbols,{FST_ERR_LOG_INVALID_DESTINATION:Ete,FST_ERR_LOG_INVALID_LOGGER:bte}=a2();function ZR(n){if(n.stream&&n.file)throw new Ete;n.file&&(n.stream=v8.destination(n.file),delete n.file);let e=n.logger,l=n.genReqId,t=null;return e?(n.logger=void 0,n.genReqId=void 0,e[QR]&&(n.serializers=Object.assign({},n.serializers,e[QR])),t=e.child({},n),n.logger=e,n.genReqId=l):t=v8(n,n.stream),t}var sh={req:function(e){return{method:e.method,url:e.url,version:e.headers&&e.headers["accept-version"],hostname:e.hostname,remoteAddress:e.ip,remotePort:e.socket?e.socket.remotePort:void 0}},err:v8.stdSerializers.err,res:function(e){return{statusCode:e.statusCode}}};function Tte(){let n=process.hrtime();return n[0]*1e3+n[1]/1e6}function Ste(n){if(!n.logger){let t=_te;return t.child=()=>t,{logger:t,hasLogger:!1}}if(eO(n.logger))return{logger:ZR({logger:n.logger,serializers:Object.assign({},sh,n.logger.serializers)}),hasLogger:!0};let e={};return Object.prototype.toString.call(n.logger)==="[object Object]"&&Reflect.ownKeys(n.logger).forEach(t=>{Object.defineProperty(e,t,{value:n.logger[t],writable:!0,enumerable:!0,configurable:!0})}),e.level=e.level||"info",e.serializers=Object.assign({},sh,e.serializers),n.logger=e,{logger:ZR(n.logger),hasLogger:!0}}function eO(n,e){let l=["info","error","debug","fatal","warn","trace","child"],t=n?l.filter(r=>!n[r]||typeof n[r]!="function"):l;if(t.length){if(t.length===l.length&&!e)return!1;throw bte(t.join(","))}else return!0}function xte(n,e,l,t,r){let i={[n.requestIdLogLabel]:t},s=n.childLoggerFactory.call(n.server,e,i,r||{},l);return n.childLoggerFactory!==nO&&eO(s,!0),s}function nO(n,e,l){return n.child(e,l)}lO.exports={createLogger:Ste,createChildLogger:xte,defaultChildLoggerFactory:nO,serializers:sh,now:Tte}});var r0=C((xTe,tO)=>{"use strict";tO.exports=Ate;function Va(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function Ate(n){if(n=n||{},n.circles)return wte(n);return n.proto?t:l;function e(r,i){for(var s=Object.keys(r),u=new Array(s.length),a=0;a<s.length;a++){var c=s[a],f=r[c];typeof f!="object"||f===null?u[c]=f:f instanceof Date?u[c]=new Date(f):ArrayBuffer.isView(f)?u[c]=Va(f):u[c]=i(f)}return u}function l(r){if(typeof r!="object"||r===null)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return e(r,l);if(r instanceof Map)return new Map(e(Array.from(r),l));if(r instanceof Set)return new Set(e(Array.from(r),l));var i={};for(var s in r)if(Object.hasOwnProperty.call(r,s)!==!1){var u=r[s];typeof u!="object"||u===null?i[s]=u:u instanceof Date?i[s]=new Date(u):u instanceof Map?i[s]=new Map(e(Array.from(u),l)):u instanceof Set?i[s]=new Set(e(Array.from(u),l)):ArrayBuffer.isView(u)?i[s]=Va(u):i[s]=l(u)}return i}function t(r){if(typeof r!="object"
`:""},this._extScope=e,this._scope=new B3.Scope({parent:e}),this._nodes=[new bh]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,l){let t=this._extScope.value(e,l);return(this._values[t.prefix]||(this._values[t.prefix]=new Set)).add(t),t}getScopeValue(e,l){return this._extScope.getValue(e,l)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,l,t,r){let i=this._scope.toName(l);return t!==void 0&&r&&(this._constants[i.str]=t),this._leafNode(new mh(e,i,t)),i}const(e,l,t){return this._def(B3.varKinds.const,e,l,t)}let(e,l,t){return this._def(B3.varKinds.let,e,l,t)}var(e,l,t){return this._def(B3.varKinds.var,e,l,t)}assign(e,l,t){return this._leafNode(new S8(e,l,t))}add(e,l){return this._leafNode(new gh(e,Sn.operators.ADD,l))}code(e){return typeof e=="function"?e():e!==jn.nil&&this._leafNode(new Eh(e)),this}object(...e){let l=["{"];for(let[t,r]of e)l.length>1&&l.push(","),l.push(t),(t!==r||this.opts.es5)&&(l.push(":"),(0,jn.addCodeArg)(l,r));return l.push("}"),new jn._Code(l)}if(e,l,t){if(this._blockNode(new gu(e)),l&&t)this.code(l).else().code(t).endIf();else if(l)this.code(l).endIf();else if(t)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new gu(e))}else(){return this._elseNode(new Ga)}endIf(){return this._endBlockNode(gu,Ga)}_for(e,l){return this._blockNode(e),l&&this.code(l).endFor(),this}for(e,l){return this._for(new Th(e),l)}forRange(e,l,t,r,i=this.opts.es5?B3.varKinds.var:B3.varKinds.let){let s=this._scope.toName(e);return this._for(new Sh(i,s,l,t),()=>r(s))}forOf(e,l,t,r=B3.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let s=l instanceof jn.Name?l:this.var("_arr",l);return this.forRange("_i",0,(0,jn._)`${s}.length`,u=>{this.var(i,(0,jn._)`${s}[${u}]`),t(i)})}return this._for(new x8("of",r,i,l),()=>t(i))}forIn(e,l,t,r=this.opts.es5?B3.varKinds.var:B3.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,jn._)`Object.keys(${l})`,t);let i=this._scope.toName(e);return this._for(new x8("in",r,i,l),()=>t(i))}endFor(){return this._endBlockNode(yu)}label(e){return this._leafNode(new yh(e))}break(e){return this._leafNode(new vh(e))}return(e){let l=new c0;if(this._blockNode(l),this.code(e),l.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(c0)}try(e,l,t){if(!l&&!t)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new xh;if(this._blockNode(r),this.code(e),l){let i=this.name("e");this._currNode=r.catch=new f0(i),l(i)}return t&&(this._currNode=r.finally=new p0,this.code(t)),this._endBlockNode(f0,p0)}throw(e){return this._leafNode(new _h(e))}block(e,l){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(l),this}endBlock(e){let l=this._blockStarts.pop();if(l===void 0)throw new Error("CodeGen: not in self-balancing block");let t=this._nodes.length-l;if(t<0||e!==void 0&&t!==e)throw new Error(`CodeGen: wrong number of nodes: ${t} vs ${e} expected`);return this._nodes.length=l,this}func(e,l=jn.nil,t,r){return this._blockNode(new o0(e,l,t)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(o0)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,l){let t=this._currNode;if(t instanceof e||l&&t instanceof l)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${l?`${e.kind}/${l.kind}`:e.kind}"`)}_elseNode(e){let l=this._currNode;if(!(l instanceof gu))throw new Error('CodeGen: "else" without "if"');return this._currNode=l.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let l=this._nodes;l[l.length-1]=e}};Sn.CodeGen=Ah;function vu(n,e){for(let l in e)n[l]=(n[l]||0)+(e[l]||0);return n}function A8(n,e){return e in
2024-05-07 17:30:00 +08:00
|| (${s} == "string" && ${r} && ${r} == +${r})`).assign(u,(0,_n._)`+${r}`);return;case"integer":t.elseIf((0,_n._)`${s} === "boolean" || ${r} === null
|| (${s} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(u,(0,_n._)`+${r}`);return;case"boolean":t.elseIf((0,_n._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(u,!1).elseIf((0,_n._)`${r} === "true" || ${r} === 1`).assign(u,!0);return;case"null":t.elseIf((0,_n._)`${r} === "" || ${r} === 0 || ${r} === false`),t.assign(u,null);return;case"array":t.elseIf((0,_n._)`${s} === "string" || ${s} === "number"
2024-05-23 19:28:35 +08:00
|| ${s} === "boolean" || ${r} === null`).assign(u,(0,_n._)`[${r}]`)}}}function D2e({gen:n,parentData:e,parentDataProperty:l},t){n.if((0,_n._)`${e} !== undefined`,()=>n.assign((0,_n._)`${e}[${l}]`,t))}function kh(n,e,l,t=h0.Correct){let r=t===h0.Correct?_n.operators.EQ:_n.operators.NEQ,i;switch(n){case"null":return(0,_n._)`${e} ${r} null`;case"array":i=(0,_n._)`Array.isArray(${e})`;break;case"object":i=(0,_n._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=s((0,_n._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=s();break;default:return(0,_n._)`typeof ${e} ${r} ${n}`}return t===h0.Correct?i:(0,_n.not)(i);function s(u=_n.nil){return(0,_n.and)((0,_n._)`typeof ${e} == "number"`,u,l?(0,_n._)`isFinite(${e})`:_n.nil)}}Xt.checkDataType=kh;function Ph(n,e,l,t){if(n.length===1)return kh(n[0],e,l,t);let r,i=(0,NO.toHash)(n);if(i.array&&i.object){let s=(0,_n._)`typeof ${e} != "object"`;r=i.null?s:(0,_n._)`!${e} || ${s}`,delete i.null,delete i.array,delete i.object}else r=_n.nil;i.number&&delete i.integer;for(let s in i)r=(0,_n.and)(r,kh(s,e,l,t));return r}Xt.checkDataTypes=Ph;var L2e={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:e})=>typeof n=="string"?(0,_n._)`{type: ${n}}`:(0,_n._)`{type: ${e}}`};function Dh(n){let e=F2e(n);(0,N2e.reportError)(e,L2e)}Xt.reportTypeError=Dh;function F2e(n){let{gen:e,data:l,schema:t}=n,r=(0,NO.schemaRefOrVal)(n,t,"type");return{gen:e,keyword:"type",data:l,schema:t.type,schemaCode:r,schemaValue:r,parentSchema:t,params:{},it:n}}});var PO=C(O8=>{"use strict";Object.defineProperty(O8,"__esModule",{value:!0});O8.assignDefaults=void 0;var Ya=Ze(),M2e=En();function $2e(n,e){let{properties:l,items:t}=n.schema;if(e==="object"&&l)for(let r in l)kO(n,r,l[r].default);else e==="array"&&Array.isArray(t)&&t.forEach((r,i)=>kO(n,i,r.default))}O8.assignDefaults=$2e;function kO(n,e,l){let{gen:t,compositeRule:r,data:i,opts:s}=n;if(l===void 0)return;let u=(0,Ya._)`${i}${(0,Ya.getProperty)(e)}`;if(r){(0,M2e.checkStrictMode)(n,`default is ignored for: ${u}`);return}let a=(0,Ya._)`${u} === undefined`;s.useDefaults==="empty"&&(a=(0,Ya._)`${a} || ${u} === null || ${u} === ""`),t.if(a,(0,Ya._)`${u} = ${(0,Ya.stringify)(l)}`)}});var Wt=C(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.validateUnion=vl.validateArray=vl.usePattern=vl.callValidateCode=vl.schemaProperties=vl.allSchemaProperties=vl.noPropertyInData=vl.propertyInData=vl.isOwnProperty=vl.hasPropFunc=vl.reportMissingProp=vl.checkMissingProp=vl.checkReportMissingProp=void 0;var Ll=Ze(),Lh=En(),zi=v3(),j2e=En();function U2e(n,e){let{gen:l,data:t,it:r}=n;l.if(Mh(l,t,e,r.opts.ownProperties),()=>{n.setParams({missingProperty:(0,Ll._)`${e}`},!0),n.error()})}vl.checkReportMissingProp=U2e;function B2e({gen:n,data:e,it:{opts:l}},t,r){return(0,Ll.or)(...t.map(i=>(0,Ll.and)(Mh(n,e,i,l.ownProperties),(0,Ll._)`${r} = ${i}`)))}vl.checkMissingProp=B2e;function H2e(n,e){n.setParams({missingProperty:e},!0),n.error()}vl.reportMissingProp=H2e;function DO(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ll._)`Object.prototype.hasOwnProperty`})}vl.hasPropFunc=DO;function Fh(n,e,l){return(0,Ll._)`${DO(n)}.call(${e}, ${l})`}vl.isOwnProperty=Fh;function q2e(n,e,l,t){let r=(0,Ll._)`${e}${(0,Ll.getProperty)(l)} !== undefined`;return t?(0,Ll._)`${r} && ${Fh(n,e,l)}`:r}vl.propertyInData=q2e;function Mh(n,e,l,t){let r=(0,Ll._)`${e}${(0,Ll.getProperty)(l)} === undefined`;return t?(0,Ll.or)(r,(0,Ll.not)(Fh(n,e,l))):r}vl.noPropertyInData=Mh;function LO(n){return n?Object.keys(n).filter(e=>e!=="__proto__"):[]}vl.allSchemaProperties=LO;function V2e(n,e){return LO(e).filter(l=>!(0,Lh.alwaysValidSchema)(n,e[l]))}vl.schemaProperties=V2e;function z2e({schemaCode:n,data:e,it:{gen:l,topSchemaRef:t,schemaPath:r,errorPath:i},it:s},u,a,c){let f=c?(0,Ll._)`${n}, ${e}, ${t}${r}`:e,p=[[zi.default.instancePath,(0,Ll.strConcat)(zi.default.instancePath,i)],[zi.default.parentData,s.parentData],[zi.default.parentDataProperty,s.parentDataProperty],[zi.default.rootData,zi.default.rootData]];s.opts.d
2024-05-07 17:30:00 +08:00
missingProperty: ${t},
2024-04-02 15:03:09 +08:00
depsCount: ${e},
2024-05-23 19:28:35 +08:00
deps: ${l}}`};var Sie={keyword:"dependencies",type:"object",schemaType:"object",error:_r.error,code(n){let[e,l]=xie(n);XN(n,e),WN(n,l)}};function xie({schema:n}){let e={},l={};for(let t in n){if(t==="__proto__")continue;let r=Array.isArray(n[t])?e:l;r[t]=n[t]}return[e,l]}function XN(n,e=n.schema){let{gen:l,data:t,it:r}=n;if(Object.keys(e).length===0)return;let i=l.let("missing");for(let s in e){let u=e[s];if(u.length===0)continue;let a=(0,k0.propertyInData)(l,t,s,r.opts.ownProperties);n.setParams({property:s,depsCount:u.length,deps:u.join(", ")}),r.allErrors?l.if(a,()=>{for(let c of u)(0,k0.checkReportMissingProp)(n,c)}):(l.if((0,Sm._)`${a} && (${(0,k0.checkMissingProp)(n,u,i)})`),(0,k0.reportMissingProp)(n,i),l.else())}}_r.validatePropertyDeps=XN;function WN(n,e=n.schema){let{gen:l,data:t,keyword:r,it:i}=n,s=l.name("valid");for(let u in e)(0,Tie.alwaysValidSchema)(i,e[u])||(l.if((0,k0.propertyInData)(l,t,u,i.opts.ownProperties),()=>{let a=n.subschema({keyword:r,schemaProp:u},s);n.mergeValidEvaluated(a,s)},()=>l.var(s,!0)),n.ok(s))}_r.validateSchemaDeps=WN;_r.default=Sie});var JN=C(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var YN=Ze(),Aie=En(),wie={message:"property name must be valid",params:({params:n})=>(0,YN._)`{propertyName: ${n.propertyName}}`},Rie={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:wie,code(n){let{gen:e,schema:l,data:t,it:r}=n;if((0,Aie.alwaysValidSchema)(r,l))return;let i=e.name("valid");e.forIn("key",t,s=>{n.setParams({propertyName:s}),n.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),e.if((0,YN.not)(i),()=>{n.error(!0),r.allErrors||e.break()})}),n.ok(i)}};xm.default=Rie});var wm=C(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});var H8=Wt(),V3=Ze(),Oie=v3(),q8=En(),Nie={message:"must NOT have additional properties",params:({params:n})=>(0,V3._)`{additionalProperty: ${n.additionalProperty}}`},Iie={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Nie,code(n){let{gen:e,schema:l,parentSchema:t,data:r,errsCount:i,it:s}=n;if(!i)throw new Error("ajv implementation error");let{allErrors:u,opts:a}=s;if(s.props=!0,a.removeAdditional!=="all"&&(0,q8.alwaysValidSchema)(s,l))return;let c=(0,H8.allSchemaProperties)(t.properties),f=(0,H8.allSchemaProperties)(t.patternProperties);p(),n.ok((0,V3._)`${i} === ${Oie.default.errors}`);function p(){e.forIn("key",r,S=>{!c.length&&!f.length?g(S):e.if(m(S),()=>g(S))})}function m(S){let T;if(c.length>8){let x=(0,q8.schemaRefOrVal)(s,t.properties,"properties");T=(0,H8.isOwnProperty)(e,x,S)}else c.length?T=(0,V3.or)(...c.map(x=>(0,V3._)`${S} === ${x}`)):T=V3.nil;return f.length&&(T=(0,V3.or)(T,...f.map(x=>(0,V3._)`${(0,H8.usePattern)(n,x)}.test(${S})`))),(0,V3.not)(T)}function h(S){e.code((0,V3._)`delete ${r}[${S}]`)}function g(S){if(a.removeAdditional==="all"||a.removeAdditional&&l===!1){h(S);return}if(l===!1){n.setParams({additionalProperty:S}),n.error(),u||e.break();return}if(typeof l=="object"&&!(0,q8.alwaysValidSchema)(s,l)){let T=e.name("valid");a.removeAdditional==="failing"?(_(S,T,!1),e.if((0,V3.not)(T),()=>{n.reset(),h(S)})):(_(S,T),u||e.if((0,V3.not)(T),()=>e.break()))}}function _(S,T,x){let v={keyword:"additionalProperties",dataProp:S,dataPropType:q8.Type.Str};x===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(v,T)}}};Am.default=Iie});var eI=C(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});var Cie=Za(),QN=Wt(),Rm=En(),ZN=wm(),kie={keyword:"properties",type:"object",schemaType:"object",code(n){let{gen:e,schema:l,parentSchema:t,data:r,it:i}=n;i.opts.removeAdditional==="all"&&t.additionalProperties===void 0&&ZN.default.code(new Cie.KeywordCxt(i,ZN.default,"additionalProperties"));let s=(0,QN.allSchemaProperties)(l);for(let p of s)i.definedProperties.add(p);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=Rm.mergeEvaluated.props(e,(0,Rm.toHash)(s),i.props));let u=s.filter(p=>!(0,Rm.alwaysValidSchema)(i,l[p]));if(u.le
2024-05-07 17:30:00 +08:00
`,r+=`const validator = Validator.restoreFromState(validatorState)
`):r+=`const validator = null
2024-04-02 15:03:09 +08:00
`,`
'use strict'
const { dependencies } = require('fast-json-stringify/lib/standalone')
const { Serializer, Validator } = dependencies
2024-05-07 17:30:00 +08:00
const serializerState = ${JSON.stringify(l.getState())}
2024-04-02 15:03:09 +08:00
const serializer = Serializer.restoreFromState(serializerState)
2024-05-07 17:30:00 +08:00
${r}
2024-04-02 15:03:09 +08:00
2024-05-23 19:28:35 +08:00
module.exports = ${n.toString()}(validator, serializer)`}lg.exports=Iue;lg.exports.dependencies={Serializer:oh(),Validator:ng()}});var ZI=C((GSe,QI)=>{"use strict";var{dependencies:Cue}=tg(),{Serializer:kue,Validator:zSe}=Cue,Pue={mode:"standalone"},Due=kue.restoreFromState(Pue),Lue=null;QI.exports=function(e,l){function t(i){let s=i&&typeof i.toJSON=="function"?i.toJSON():i;if(s===null)return"{}";let u=!1,a="{";return s.statusCode!==void 0&&(!u&&(u=!0)||(a+=","),a+='"statusCode":',a+=l.asNumber(s.statusCode)),s.code!==void 0&&(!u&&(u=!0)||(a+=","),a+='"code":',a+=l.asString(s.code)),s.error!==void 0&&(!u&&(u=!0)||(a+=","),a+='"error":',a+=l.asString(s.error)),s.message!==void 0&&(!u&&(u=!0)||(a+=","),a+='"message":',a+=l.asString(s.message)),a+"}"}return t}(Lue,Due)});var F0=C((XSe,tC)=>{"use strict";var eC=require("node:http").STATUS_CODES,Fue=sd(),{kReplyHeaders:wu,kReplyNextErrorHandler:n9,kReplyIsRunningOnErrorHook:Mue,kReplyHasStatusCode:$ue,kRouteContext:lC}=$t(),{FST_ERR_REP_INVALID_PAYLOAD_TYPE:jue,FST_ERR_FAILED_ERROR_SERIALIZATION:Uue}=a2(),{getSchemaSerializer:Bue}=i0(),rg=ZI(),Hue={func:Vue,toJSON(){return this.func.name.toString()+"()"}};function que(n,e,l){n[Mue]=!1;let t=n[lC];if(n[n9]===!1){nC(e,n,function(u,a){try{u.raw.writeHead(u.raw.statusCode,u[wu])}catch(c){u.log.warn({req:u.request,res:u,err:c},c&&c.message),u.raw.writeHead(u.raw.statusCode)}u.raw.end(a)});return}let r=n[n9]||t.errorHandler;n[n9]=Object.getPrototypeOf(r),delete n[wu]["content-type"],delete n[wu]["content-length"];let i=r.func;if(!i){n[n9]=!1,nC(e,n,l);return}let s=i(e,n.request,n);s!==void 0&&(s!==null&&typeof s.then=="function"?Fue(s,n):n.send(s))}function Vue(n,e,l){if(Gue(n,l),!l[$ue]||l.statusCode===200){let t=n.statusCode||n.status;l.code(t>=400?t:500)}l.statusCode<500?l.log.info({res:l,err:n},n&&n.message):l.log.error({req:e,res:l,err:n},n&&n.message),l.send(n)}function nC(n,e,l){let t=e.raw,r=e.statusCode;e[wu]["content-type"]=e[wu]["content-type"]??"application/json; charset=utf-8";let i;try{let s=Bue(e[lC],r,e[wu]["content-type"]);i=s===!1?rg({error:eC[r+""],code:n.code,message:n.message,statusCode:r}):s(Object.create(n,{error:{value:eC[r+""]},message:{value:n.message},statusCode:{value:r}}))}catch(s){e.log.error({err:s,statusCode:t.statusCode},"The serializer for the given status code failed"),e.code(500),i=rg(new Uue(s.message,n.message))}typeof i!="string"&&!Buffer.isBuffer(i)&&(i=rg(new jue(typeof i))),e[wu]["content-length"]=""+Buffer.byteLength(i),l(e,i)}function zue(n=Hue,e){if(!e)return n;let l=Object.create(n);return l.func=e,l}function Gue(n,e){let l=e.raw,t=l.statusCode;t=t>=400?t:500,n!=null&&(n.headers!==void 0&&e.headers(n.headers),n.status>=400?t=n.status:n.statusCode>=400&&(t=n.statusCode)),l.statusCode=t}tC.exports={buildErrorHandler:zue,handleError:que}});var u9=C((WSe,s9)=>{"use strict";var ag=require("node:stream").finished,Xue=require("node:stream").Readable,{kFourOhFourContext:rC,kPublicRouteContext:iC,kReplyErrorHandlerCalled:dC,kReplyHijacked:M0,kReplyStartTime:$0,kReplyEndTime:cg,kReplySerializer:fi,kReplySerializerDefault:t9,kReplyIsError:r9,kReplyHeaders:Nl,kReplyTrailers:jt,kReplyHasStatusCode:fg,kReplyIsRunningOnErrorHook:pg,kReplyNextErrorHandler:Wue,kDisableRequestLogging:hC,kSchemaResponse:i9,kReplyCacheSerializeFns:Qi,kSchemaController:ig,kOptions:Kue,kRouteContext:In}=$t(),{onSendHookRunner:mC,onResponseHookRunner:Yue,preHandlerHookRunner:Jue,preSerializationHookRunner:Que}=$i(),sC=cd()[Symbol.for("internals")],Zue=t0(),og=Zue.now,{handleError:uC}=F0(),{getSchemaSerializer:eae}=i0(),sg={JSON:"application/json; charset=utf-8",PLAIN:"text/plain; charset=utf-8",OCTET:"application/octet-stream"},{FST_ERR_REP_INVALID_PAYLOAD_TYPE:nae,FST_ERR_REP_RESPONSE_BODY_CONSUMED:lae,FST_ERR_REP_ALREADY_SENT:gC,FST_ERR_REP_SENT_VALUE:tae,FST_ERR_SEND_INSIDE_ONERR:rae,FST_ERR_BAD_STATUS_CODE:iae,FST_ERR_BAD_TRAILER_NAME:sae,FST_ERR_BAD_TRAILER_VALUE:uae,FST_ERR_MISSING_SERIALIZATION_FN:aae,FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN:oae}=a2(),{FSTDEP010:cae,FSTDEP013:fae,FSTDEP019:pae,FSTDEP020:dae}=ii
2024-05-07 17:30:00 +08:00
${l.functions.join(`
2024-04-02 15:03:09 +08:00
`)}
const main = anonymous0
return main
`:s=`
function main (input) {
let json = ''
${i}
return json
}
2024-05-07 17:30:00 +08:00
${l.functions.join(`
2024-04-02 15:03:09 +08:00
`)}
return main
2024-05-23 19:28:35 +08:00
`;let u=new J1e(e),a=new Q1e(e.ajv);for(let f of l.validatorSchemasIds){let p=l.refResolver.getSchema(f);a.addSchema(p,f);let m=l.refResolver.getSchemaDependencies(f);for(let[h,g]of Object.entries(m))a.addSchema(g,h)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:a,serializer:u,code:`validator
2024-04-02 15:03:09 +08:00
serializer
2024-05-23 19:28:35 +08:00
${s}`,ajv:a.ajv};let c=new Function("validator","serializer",s);return e.mode==="standalone"?tg()(c,l,u,a):c(a,u)}var n5e=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],l5e=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],t5e=["maxLength","minLength","pattern"],r5e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function TD(n){for(var e of n5e)if(e in n)return"object";for(var e of l5e)if(e in n)return"array";for(var e of t5e)if(e in n)return"string";for(var e of r5e)if(e in n)return"number";return n.type}function i5e(n,e){let l=e.schema,t=Object.keys(l.properties||{}),r=`
2024-05-07 17:30:00 +08:00
const propertiesKeys = ${JSON.stringify(t)}
2024-04-02 15:03:09 +08:00
for (const [key, value] of Object.entries(obj)) {
if (
propertiesKeys.includes(key) ||
value === undefined ||
typeof value === 'function' ||
typeof value === 'symbol'
) continue
2024-05-07 17:30:00 +08:00
`,i=e.getPropertyLocation("patternProperties"),s=i.schema;if(s!==void 0)for(let c in s){let f=i.getPropertyLocation(c);r+=`
2024-04-23 12:29:20 +08:00
if (/${c.replace(/\\*\//g,"\\/")}/.test(key)) {
2024-05-23 19:28:35 +08:00
${go}
2024-04-02 15:03:09 +08:00
json += serializer.asString(key) + ':'
2024-05-23 19:28:35 +08:00
${Sr(n,f,"value")}
2024-04-02 15:03:09 +08:00
continue
}
2024-05-07 17:30:00 +08:00
`}let a=e.getPropertyLocation("additionalProperties").schema;if(a!==void 0)if(a===!0)r+=`
2024-05-23 19:28:35 +08:00
${go}
2024-04-02 15:03:09 +08:00
json += serializer.asString(key) + ':' + JSON.stringify(value)
2024-05-07 17:30:00 +08:00
`;else{let c=e.getPropertyLocation("additionalProperties");r+=`
2024-05-23 19:28:35 +08:00
${go}
2024-04-02 15:03:09 +08:00
json += serializer.asString(key) + ':'
2024-05-23 19:28:35 +08:00
${Sr(n,c,"value")}
2024-05-07 17:30:00 +08:00
`}return r+=`
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`,r}function s5e(n,e){let l="",t=e.schema,r=t.required||[],i=e.getPropertyLocation("properties"),s=[],u=[];if(t.properties)for(let c of Object.keys(t.properties)){if(r.indexOf(c)===-1)continue;let f=i.getPropertyLocation(c);f.schema.$ref&&(f=yo(n,e,f.schema.$ref));let p=JSON.stringify(c);f.schema.default===void 0&&(l+=`if (obj[${p}] === undefined) throw new Error('${p} is required!')
2024-05-07 17:30:00 +08:00
`,u.push(c)),s.push(c)}for(let c of r)s.indexOf(c)===-1&&(l+=`if (obj['${c}'] === undefined) throw new Error('"${c}" is required!')
`);l+=`
2024-04-02 15:03:09 +08:00
let addComma = false
2024-05-07 17:30:00 +08:00
let json = '${n.wrapObjects?"{":""}'
2024-05-23 19:28:35 +08:00
`;let a=n.wrapObjects;if(n.wrapObjects=!0,t.properties)for(let c of Object.keys(t.properties)){let f=i.getPropertyLocation(c);f.schema.$ref&&(f=yo(n,e,f.schema.$ref));let p=JSON.stringify(c);if(u.indexOf(c)!==-1)l+=`
${go}
2024-04-02 15:03:09 +08:00
json += ${JSON.stringify(p+":")}
2024-05-23 19:28:35 +08:00
${Sr(n,f,`obj[${p}]`)}
2024-05-07 17:30:00 +08:00
`;else{l+=`
2024-04-02 15:03:09 +08:00
if (obj[${p}] !== undefined) {
2024-05-23 19:28:35 +08:00
${go}
2024-04-02 15:03:09 +08:00
json += ${JSON.stringify(p+":")}
2024-05-23 19:28:35 +08:00
${Sr(n,f,`obj[${p}]`)}
2024-04-02 15:03:09 +08:00
}
2024-05-07 17:30:00 +08:00
`;let m=f.schema.default;m!==void 0&&(l+=`
2024-04-02 15:03:09 +08:00
else {
2024-05-23 19:28:35 +08:00
${go}
2024-04-02 15:03:09 +08:00
json += ${JSON.stringify(p+":"+JSON.stringify(m))}
}
2024-05-23 19:28:35 +08:00
`)}}return(t.patternProperties||t.additionalProperties)&&(l+=i5e(n,e)),n.wrapObjects=a,l+=`
2024-05-07 17:30:00 +08:00
return json${n.wrapObjects?" + '}'":""}
2024-05-23 19:28:35 +08:00
`,l}function SD(n,e,l,t){let r=e.getPropertyLocation("allOf");for(let i=0;i<l.allOf.length;i++){let s=l.allOf[i];if(s.$ref){let a=r.getPropertyLocation(i);s=yo(n,a,s.$ref).schema}let u=s.type;if(u===void 0&&(u=TD(s)),u!==void 0){if(t.type!==void 0&&t.type!==u)throw new Error("allOf schemas have different type values");t.type=u}if(s.format!==void 0){if(t.format!==void 0&&t.format!==s.format)throw new Error("allOf schemas have different format values");t.format=s.format}if(s.nullable!==void 0){if(t.nullable!==void 0&&t.nullable!==s.nullable)throw new Error("allOf schemas have different nullable values");t.nullable=s.nullable}s.properties!==void 0&&(t.properties===void 0&&(t.properties={}),Object.assign(t.properties,s.properties)),s.additionalProperties!==void 0&&(t.additionalProperties===void 0&&(t.additionalProperties={}),Object.assign(t.additionalProperties,s.additionalProperties)),s.patternProperties!==void 0&&(t.patternProperties===void 0&&(t.patternProperties={}),Object.assign(t.patternProperties,s.patternProperties)),s.required!==void 0&&(t.required===void 0&&(t.required=[]),t.required.push(...s.required)),s.oneOf!==void 0&&(t.oneOf===void 0&&(t.oneOf=[]),t.oneOf.push(...s.oneOf)),s.anyOf!==void 0&&(t.anyOf===void 0&&(t.anyOf=[]),t.anyOf.push(...s.anyOf)),s.allOf!==void 0&&SD(n,e,s,t)}delete t.allOf,t.$id=`__fjs_merged_${bD++}`,n.refResolver.addSchema(t),e.addMergedSchema(t,t.$id)}function u5e(n,e,l){n.validatorSchemasIds.add(e.getSchemaId());let t=iy({},e.schema),r=t.then,i=t.else||{additionalProperties:!0};delete t.if,delete t.then,delete t.else;let u=e.getPropertyLocation("if").getSchemaRef(),a=e.getPropertyLocation("then");a.schema=iy(t,r);let c=e.getPropertyLocation("else");return c.schema=iy(t,i),`
2024-05-07 17:30:00 +08:00
if (validator.validate("${u}", ${l})) {
2024-05-23 19:28:35 +08:00
${Sr(n,a,l)}
2024-04-02 15:03:09 +08:00
} else {
2024-05-23 19:28:35 +08:00
${Sr(n,c,l)}
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`}function a5e(n){return`(${n} && typeof ${n}.toJSON === 'function')
2024-05-07 17:30:00 +08:00
? ${n}.toJSON()
: ${n}
2024-05-23 19:28:35 +08:00
`}function xD(n,e){let l=e.schema;if(n.functionsNamesBySchema.has(l))return n.functionsNamesBySchema.get(l);let t=wD(n);n.functionsNamesBySchema.set(l,t);let r=e.getSchemaRef();r.startsWith(n.rootSchemaId)&&(r=r.replace(n.rootSchemaId,""));let i=`
2024-05-07 17:30:00 +08:00
`,s=l.nullable===!0;return i+=`
// ${r}
function ${t} (input) {
2024-05-23 19:28:35 +08:00
const obj = ${a5e("input")}
2024-04-02 15:03:09 +08:00
${s?"":"if (obj === null) return '{}'"}
2024-05-23 19:28:35 +08:00
${s5e(n,e)}
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`,n.functions.push(i),t}function o5e(n,e){let l=e.schema,t=e.getPropertyLocation("items");t.schema=t.schema||{},t.schema.$ref&&(t=yo(n,t,t.schema.$ref));let r=t.schema;if(n.functionsNamesBySchema.has(l))return n.functionsNamesBySchema.get(l);let i=wD(n);n.functionsNamesBySchema.set(l,i);let s=e.getSchemaRef();s.startsWith(n.rootSchemaId)&&(s=s.replace(n.rootSchemaId,""));let u=`
2024-04-02 15:03:09 +08:00
function ${i} (obj) {
// ${s}
2024-05-07 17:30:00 +08:00
`,a=l.nullable===!0;if(u+=`
${a?"":"if (obj === null) return '[]'"}
2024-04-02 15:03:09 +08:00
if (!Array.isArray(obj)) {
throw new TypeError(\`The value of '${s}' does not match schema definition.\`)
}
const arrayLength = obj.length
2024-05-07 17:30:00 +08:00
`,!l.additionalItems&&Array.isArray(r)&&(u+=`
if (arrayLength > ${r.length}) {
throw new Error(\`Item at ${r.length} does not match schema definition.\`)
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`),_D==="json-stringify"&&(u+=`if (arrayLength && arrayLength >= ${L9}) return JSON.stringify(obj)
2024-05-07 17:30:00 +08:00
`),u+=`
2024-04-02 15:03:09 +08:00
let jsonOutput = ''
2024-05-23 19:28:35 +08:00
`,Array.isArray(r)){for(let c=0;c<r.length;c++){let f=r[c],p=Sr(n,t.getPropertyLocation(c),`obj[${c}]`);u+=`
2024-04-23 12:29:20 +08:00
if (${c} < arrayLength) {
2024-05-23 19:28:35 +08:00
if (${AD(f.type,`[${c}]`)}) {
2024-04-02 15:03:09 +08:00
let json = ''
${p}
jsonOutput += json
2024-04-23 12:29:20 +08:00
if (${c} < arrayLength - 1) {
2024-04-02 15:03:09 +08:00
jsonOutput += ','
}
} else {
2024-04-23 12:29:20 +08:00
throw new Error(\`Item at ${c} does not match schema definition.\`)
2024-04-02 15:03:09 +08:00
}
}
2024-05-07 17:30:00 +08:00
`}l.additionalItems&&(u+=`
for (let i = ${r.length}; i < arrayLength; i++) {
2024-04-02 15:03:09 +08:00
jsonOutput += JSON.stringify(obj[i])
if (i < arrayLength - 1) {
jsonOutput += ','
}
2024-05-23 19:28:35 +08:00
}`)}else{let c=Sr(n,t,"obj[i]");u+=`
2024-04-02 15:03:09 +08:00
for (let i = 0; i < arrayLength; i++) {
let json = ''
2024-04-23 12:29:20 +08:00
${c}
2024-04-02 15:03:09 +08:00
jsonOutput += json
if (i < arrayLength - 1) {
jsonOutput += ','
}
2024-05-23 19:28:35 +08:00
}`}return u+="\n return `[${jsonOutput}]`\n }",n.functions.push(u),i}function AD(n,e){let l;switch(n){case"null":l=`obj${e} === null`;break;case"string":l=`typeof obj${e} === 'string' ||
2024-04-02 15:03:09 +08:00
obj${e} === null ||
obj${e} instanceof Date ||
obj${e} instanceof RegExp ||
(
typeof obj${e} === "object" &&
typeof obj${e}.toString === "function" &&
obj${e}.toString !== Object.prototype.toString
2024-05-23 19:28:35 +08:00
)`;break;case"integer":l=`Number.isInteger(obj${e})`;break;case"number":l=`Number.isFinite(obj${e})`;break;case"boolean":l=`typeof obj${e} === 'boolean'`;break;case"object":l=`obj${e} && typeof obj${e} === 'object' && obj${e}.constructor === Object`;break;case"array":l=`Array.isArray(obj${e})`;break;default:Array.isArray(n)&&(l=`(${n.map(r=>AD(r,e)).join(" || ")})`)}return l}function wD(n){return"anonymous"+n.functionsCounter++}function c5e(n,e,l){let r=e.schema.type.sort(u=>u==="null"?-1:1),i="";r.forEach((u,a)=>{e.schema={...e.schema,type:u};let c=RD(n,e,l),f=a===0?"if":"else if";switch(u){case"null":i+=`
2024-05-07 17:30:00 +08:00
${f} (${l} === null)
2024-04-23 12:29:20 +08:00
${c}
2024-04-02 15:03:09 +08:00
`;break;case"string":{i+=`
2024-04-23 12:29:20 +08:00
${f}(
2024-05-07 17:30:00 +08:00
typeof ${l} === "string" ||
${l} === null ||
${l} instanceof Date ||
${l} instanceof RegExp ||
2024-04-02 15:03:09 +08:00
(
2024-05-07 17:30:00 +08:00
typeof ${l} === "object" &&
typeof ${l}.toString === "function" &&
${l}.toString !== Object.prototype.toString
2024-04-02 15:03:09 +08:00
)
)
2024-04-23 12:29:20 +08:00
${c}
2024-04-02 15:03:09 +08:00
`;break}case"array":{i+=`
2024-05-07 17:30:00 +08:00
${f}(Array.isArray(${l}))
2024-04-23 12:29:20 +08:00
${c}
2024-04-02 15:03:09 +08:00
`;break}case"integer":{i+=`
2024-05-07 17:30:00 +08:00
${f}(Number.isInteger(${l}) || ${l} === null)
2024-04-23 12:29:20 +08:00
${c}
2024-04-02 15:03:09 +08:00
`;break}default:{i+=`
2024-05-07 17:30:00 +08:00
${f}(typeof ${l} === "${u}" || ${l} === null)
2024-04-23 12:29:20 +08:00
${c}
2024-05-07 17:30:00 +08:00
`;break}}});let s=e.getSchemaRef();return s.startsWith(n.rootSchemaId)&&(s=s.replace(n.rootSchemaId,"")),i+=`
2024-04-02 15:03:09 +08:00
else throw new TypeError(\`The value of '${s}' does not match schema definition.\`)
2024-05-23 19:28:35 +08:00
`,i}function RD(n,e,l){let t=e.schema;switch(t.type){case"null":return"json += 'null'";case"string":return t.format==="date-time"?`json += serializer.asDateTime(${l})`:t.format==="date"?`json += serializer.asDate(${l})`:t.format==="time"?`json += serializer.asTime(${l})`:`json += serializer.asString(${l})`;case"integer":return`json += serializer.asInteger(${l})`;case"number":return`json += serializer.asNumber(${l})`;case"boolean":return`json += serializer.asBoolean(${l})`;case"object":return`json += ${xD(n,e)}(${l})`;case"array":return`json += ${o5e(n,e)}(${l})`;case void 0:return`json += JSON.stringify(${l})`;default:throw new Error(`${t.type} unsupported`)}}function f5e(n,e){let l=n.schema,t=l.type,r=Array.isArray(t)&&t.includes("null"),i="";return r&&(i+=`
2024-04-02 15:03:09 +08:00
if (${e} === null) {
json += 'null'
} else {
2024-05-23 19:28:35 +08:00
`),i+=`json += '${JSON.stringify(l.const).replace(Z1e,"\\'")}'`,r&&(i+=`
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`),i}function Sr(n,e,l){let t=e.schema;if(typeof t=="boolean")return`json += JSON.stringify(${l})`;if(t.$ref&&(e=yo(n,e,t.$ref),t=e.schema),t.type===void 0){let u=TD(t);u&&(t.type=u)}if(t.if&&t.then)return u5e(n,e,l);t.allOf&&(SD(n,e,t,K1e(t)),t=e.schema);let r=t.type,i="";if((r===void 0||r==="object")&&(t.anyOf||t.oneOf)){if(n.validatorSchemasIds.add(e.getSchemaId()),t.type==="object"){n.wrapObjects=!1;let f=xD(n,e);i+=`
2024-04-02 15:03:09 +08:00
json += '{'
2024-05-07 17:30:00 +08:00
json += ${f}(${l})
2024-04-02 15:03:09 +08:00
json += ','
2024-05-23 19:28:35 +08:00
`}let u=t.anyOf?"anyOf":"oneOf",a=e.getPropertyLocation(u);for(let f=0;f<e.schema[u].length;f++){let p=a.getPropertyLocation(f),m=p.getSchemaRef(),h=Sr(n,p,l);i+=`
2024-05-07 17:30:00 +08:00
${f===0?"if":"else if"}(validator.validate("${m}", ${l}))
2024-05-23 19:28:35 +08:00
${h}
2024-05-07 17:30:00 +08:00
`}let c=e.getSchemaRef();return c.startsWith(n.rootSchemaId)&&(c=c.replace(n.rootSchemaId,"")),i+=`
2024-04-23 12:29:20 +08:00
else throw new TypeError(\`The value of '${c}' does not match schema definition.\`)
2024-05-07 17:30:00 +08:00
`,t.type==="object"&&(i+=`
2024-04-02 15:03:09 +08:00
json += '}'
2024-05-07 17:30:00 +08:00
`,n.wrapObjects=!0),i}let s=t.nullable===!0;return s&&(i+=`
if (${l} === null) {
2024-04-02 15:03:09 +08:00
json += 'null'
} else {
2024-05-23 19:28:35 +08:00
`),t.const!==void 0?i+=f5e(e,l):Array.isArray(r)?i+=c5e(n,e,l):i+=RD(n,e,l),s&&(i+=`
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`),i}vo.exports=uy;vo.exports.default=uy;vo.exports.build=uy;vo.exports.validLargeArrayMechanisms=ED;vo.exports.restore=function({code:n,validator:e,serializer:l}){return Function.apply(null,["validator","serializer",n]).apply(null,[e,l])}});var ID=C((lAe,ay)=>{"use strict";var p5e=oy();function ND(n={readMode:!0}){if(n.readMode===!0&&typeof n.restoreFunction!="function")throw new Error("You must provide a function for the restoreFunction-option when readMode ON");if(n.readMode!==!0&&typeof n.storeFunction!="function")throw new Error("You must provide a function for the storeFunction-option when readMode OFF");if(n.readMode===!0)return function(){return function(t){return n.restoreFunction(t)}};let e=p5e();return function(t,r={}){r.mode="standalone";let i=e(t,r);return function(s){let u=i(s);return n.storeFunction(s,u),new Function(u)}}}ay.exports=ND;ay.exports.default=ND});var oy=C((tAe,e1)=>{"use strict";var d5e=OD();function cy(){return function(e,l){let t=Object.assign({},l,{schema:e});return h5e.bind(null,t)}}function h5e(n,{schema:e}){return n.schema&&e.$id&&n.schema[e.$id]&&(n.schema={...n.schema},delete n.schema[e.$id]),d5e(e,n)}e1.exports=cy;e1.exports.default=cy;e1.exports.SerializerSelector=cy;e1.exports.StandaloneSerializer=ID()});var gi=C(n1=>{"use strict";Object.defineProperty(n1,"__esModule",{value:!0});n1.checkMetadata=void 0;var m5e=En(),g5e={keyword:"metadata",schemaType:"object",code(n){CD(n);let{gen:e,schema:l,it:t}=n;if((0,m5e.alwaysValidSchema)(t,l))return;let r=e.name("valid");n.subschema({keyword:"metadata",jtdMetadata:!0},r),n.ok(r)}};function CD({it:n,keyword:e},l){if(n.jtdMetadata!==l)throw new Error(`JTD: "${e}" cannot be used in this schema location`)}n1.checkMetadata=CD;n1.default=g5e});var F9=C(t1=>{"use strict";Object.defineProperty(t1,"__esModule",{value:!0});t1.hasRef=void 0;var kD=Tu(),l1=Ze(),y5e=Ki(),PD=v3(),DD=em(),v5e=gi(),_5e={keyword:"ref",schemaType:"string",code(n){(0,v5e.checkMetadata)(n);let{gen:e,data:l,schema:t,parentSchema:r,it:i}=n,{schemaEnv:{root:s}}=i,u=e.name("valid");r.nullable?(e.var(u,(0,l1._)`${l} === null`),e.if((0,l1.not)(u),a)):(e.var(u,!1),a()),n.ok(u);function a(){var p;let m=(p=s.schema.definitions)===null||p===void 0?void 0:p[t];if(!m)throw new y5e.default(i.opts.uriResolver,"",t,`No definition ${t}`);fy(m)||!i.opts.inlineRefs?c(m):f(m)}function c(p){let m=kD.compileSchema.call(i.self,new kD.SchemaEnv({schema:p,root:s,schemaPath:`/definitions/${t}`})),h=(0,DD.getValidate)(n,m),g=e.const("_errs",PD.default.errors);(0,DD.callRef)(n,h,m,m.$async),e.assign(u,(0,l1._)`${g} === ${PD.default.errors}`)}function f(p){let m=e.scopeValue("schema",i.opts.code.source===!0?{ref:p,code:(0,l1.stringify)(p)}:{ref:p});n.subschema({schema:p,dataTypes:[],schemaPath:l1.nil,topSchemaRef:m,errSchemaPath:`/definitions/${t}`},u)}}};function fy(n){for(let e in n){let l;if(e==="ref"||typeof(l=n[e])=="object"&&fy(l))return!0}return!1}t1.hasRef=fy;t1.default=_5e});var dy=C(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});var E5e=/t|\s/i,b5e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,T5e=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,S5e=[0,31,28,31,30,31,30,31,31,30,31,30,31];function FD(n,e){let l=n.split(E5e);return l.length===2&&LD(l[0])&&x5e(l[1])||e&&l.length===1&&LD(l[0])}py.default=FD;function LD(n){let e=b5e.exec(n);if(!e)return!1;let l=+e[1],t=+e[2],r=+e[3];return t>=1&&t<=12&&r>=1&&(r<=S5e[t]||t===2&&r===29&&(l%100===0?l%400===0:l%4===0))}function x5e(n){let e=T5e.exec(n);if(!e)return!1;let l=+e[1],t=+e[2],r=+e[3],i=+(e[4]||0),s=+(e[5]||0);return l<=23&&t<=59&&r<=59||l-i===23&&t-s===59&&r===60}FD.code='require("ajv/dist/runtime/timestamp").default'});var _o=C(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.typeErrorParams=es.typeErrorMessage=es.typeError=void 0;var A5e=Ze();function w5e(n){return{message:e=>MD(e,n),params:e=>$D(e,n)}}es.typeError=w5e;function MD({parentSchema:n},e){return n?.nullable?`must be ${e} or null`:`must be ${e}`}es.typeErrorMessage=MD;function $D({parentSchema:n},e){return(0,A5e._)`{type: ${e}, nullab
`,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},B6e=97,H6e=48;function ts(n,e){let l="",t;for(ts.message=void 0;t=n[e++],t!=='"';)if(t==="\\")if(t=n[e],t in dL)l+=dL[t],e++;else if(t==="u"){e++;let i=4,s=0;for(;i--;){if(s<<=4,t=n[e],t===void 0){r("unexpected end");return}if(t=t.toLowerCase(),t>="a"&&t<="f")s+=t.charCodeAt(0)-B6e+10;else if(t>="0"&&t<="9")s+=t.charCodeAt(0)-H6e;else{r(`unexpected token ${t}`);return}e++}l+=String.fromCharCode(s)}else{r(`unexpected token ${t}`);return}else if(t===void 0){r("unexpected end");return}else if(t.charCodeAt(0)>=32)l+=t;else{r(`unexpected token ${t}`);return}return ts.position=e,l;function r(i){ts.position=e,ts.message=i}}rs.parseJsonString=ts;ts.message=void 0;ts.position=0;ts.code='require("ajv/dist/runtime/parseJson").parseJsonString'});var AL=C(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0});var q6e=Ay(),vL=Tu(),ze=Ze(),V6e=Ki(),kn=v3(),z6e=Wt(),G6e=F9(),X6e=hy(),ky=hL(),_L=En(),W6e=dy(),K6e={elements:Z6e,values:e8e,discriminator:l8e,properties:mL,optionalProperties:mL,enum:r8e,type:t8e,ref:i8e};function EL(n,e){let l=vL.getCompilingSchema.call(this,n);if(l)return l;let{es5:t,lines:r}=this.opts.code,{ownProperties:i}=this.opts,s=new ze.CodeGen(this.scope,{es5:t,lines:r,ownProperties:i}),u=s.scopeName("parse"),a={self:this,gen:s,schema:n.schema,schemaEnv:n,definitions:e,data:kn.default.data,parseName:u,char:s.name("c")},c;try{this._compilations.add(n),n.parseName=u,Y6e(a),s.optimize(this.opts.code.optimize);let f=s.toString();c=`${s.scopeRefs(kn.default.scope)}return ${f}`;let m=new Function(`${kn.default.scope}`,c)(this.scope.get());this.scope.value(u,{ref:m}),n.parse=m}catch(f){throw c&&this.logger.error("Error compiling parser, function code:",c),delete n.parse,delete n.parseName,f}finally{this._compilations.delete(n)}return n}My.default=EL;var Cy=(0,ze._)`undefined`;function Y6e(n){let{gen:e,parseName:l,char:t}=n;e.func(l,(0,ze._)`${kn.default.json}, ${kn.default.jsonPos}, ${kn.default.jsonPart}`,!1,()=>{e.let(kn.default.data),e.let(t),e.assign((0,ze._)`${l}.message`,Cy),e.assign((0,ze._)`${l}.position`,Cy),e.assign(kn.default.jsonPos,(0,ze._)`${kn.default.jsonPos} || 0`),e.const(kn.default.jsonLen,(0,ze._)`${kn.default.json}.length`),B9(n),Fy(n),e.if(kn.default.jsonPart,()=>{e.assign((0,ze._)`${l}.position`,kn.default.jsonPos),e.return(kn.default.data)}),e.if((0,ze._)`${kn.default.jsonPos} === ${kn.default.jsonLen}`,()=>e.return(kn.default.data)),xo(n)})}function B9(n){let e;for(let l of q6e.jtdForms)if(l in n.schema){e=l;break}e?Q6e(n,K6e[e]):Dy(n)}var J6e=yL(!0,yL(!1,xo));function Q6e(n,e){let{gen:l,schema:t,data:r}=n;if(!t.nullable)return e(n);s1(n,"null",e,()=>l.assign(r,null))}function Z6e(n){let{gen:e,schema:l,data:t}=n;xr(n,"[");let r=e.let("i",0);e.assign(t,(0,ze._)`[]`),Py(n,"]",()=>{let i=e.let("el");B9({...n,schema:l.elements,data:i}),e.assign((0,ze._)`${t}[${r}++]`,i)})}function e8e(n){let{gen:e,schema:l,data:t}=n;xr(n,"{"),e.assign(t,(0,ze._)`{}`),Py(n,"}",()=>n8e(n,l.values))}function Py(n,e,l){bL(n,e,l),xr(n,e)}function bL(n,e,l){let{gen:t}=n;t.for((0,ze._)`;${kn.default.jsonPos}<${kn.default.jsonLen} && ${H9(1)}!==${e};`,()=>{l(),s1(n,",",()=>t.break(),r)});function r(){s1(n,e,()=>{},xo)}}function n8e(n,e){let{gen:l}=n,t=l.let("key");Du({...n,data:t}),xr(n,":"),SL(n,t,e)}function l8e(n){let{gen:e,data:l,schema:t}=n,{discriminator:r,mapping:i}=t;xr(n,"{"),e.assign(l,(0,ze._)`{}`);let s=e.const("pos",kn.default.jsonPos),u=e.let("value"),a=e.let("tag");bL(n,"}",()=>{let c=e.let("key");Du({...n,data:c}),xr(n,":"),e.if((0,ze._)`${c} === ${r}`,()=>{Du({...n,data:a}),e.assign((0,ze._)`${l}[${c}]`,a),e.break()},()=>Dy({...n,data:u}))}),e.assign(kn.default.jsonPos,s),e.if((0,ze._)`${a} === undefined`),bi(n,(0,ze.str)`discriminator tag not found`);for(let c in i)e.elseIf((0,ze._)`${a} === ${c}`),TL({...n,schema:i[c]},r);e.else(),bi(n,(0,ze.str)`discriminator value not in schema`),e.endIf()}function mL(n){let{gen:e,data:l}=n;xr(n,"{"),e.assign(l,(0,ze._)`{}`),TL(n)}function TL(n,e){let{gen:l,schema:t,data:r}=n,{properties:i,optionalProperties:s,additio
`).slice(0,2).map(e=>e.trim()).join(" -- ")}function qL(n){return n[Symbol.for("fastify.display-name")]}function VL(n){return!!n[Symbol.for("skip-override")]}function zL(n){let e=o1(n);if(!e)return;let l=e.dependencies;l&&(Wy(Array.isArray(l),"The dependencies should be an array of strings"),l.forEach(t=>{Wy(this[Ky].indexOf(t)>-1,`The dependency '${t}' of plugin '${e.name}' is not registered`)}))}function GL(n){let e=o1(n);if(!e)return;let{decorators:l,name:t}=e;l&&(l.fastify&&Xy(this,"Fastify",l.fastify,t),l.reply&&Xy(this,"Reply",l.reply,t),l.request&&Xy(this,"Request",l.request,t))}var F8e={Fastify:N8e,Request:C8e,Reply:I8e};function Xy(n,e,l,t){Wy(Array.isArray(l),"The decorators should be an array of strings"),l.forEach(r=>{let i=typeof t=="string"?` required by '${t}'`:"";if(!F8e[e].call(n,r))throw new P8e(r,i,e)})}function M8e(n){let e=o1(n);if(!e)return;let l=e.fastify,t=/-rc.+$/.test(this.version);if(!(t===!0&&Gy.gt(this.version,Gy.coerce(l))===!0)&&l&&Gy.satisfies(this.version,l,{includePrerelease:t})===!1)throw new k8e(e.name,l,this.version)}function $8e(n){let e=o1(n);if(!e)return;let l=e.name;if(l)return this[Ky].push(l),l}function j8e(n,e){n.constructor.name==="AsyncFunction"&&n.length===3&&D8e(e||"anonymous")}function U8e(n){let e=$8e.call(this,n)||HL(n);return j8e.call(this,n,e),M8e.call(this,n),GL.call(this,n),zL.call(this,n),VL(n)}Yy.exports={getPluginName:HL,getFuncPreview:L8e,kRegisteredPlugins:Ky,getDisplayName:qL,registerPlugin:U8e};Yy.exports[O8e]={shouldSkipOverride:VL,getMeta:o1,checkDecorators:GL,checkDependencies:zL}});var V9=C((CAe,XL)=>{"use strict";function B8e(n,e){let l=e||q8e();return n?V8e(n,l):l}function H8e(n,e){return n.genReqId(e)}function q8e(){let e=0;return function(){return e=e+1&2147483647,`req-${e.toString(36)}`}}function V8e(n,e){return function(l){return l.headers[n]||e(l)}}XL.exports={getGenReqId:H8e,reqIdGenFactory:B8e}});var JL=C((kAe,YL)=>{"use strict";var WL=12,z8e=0,Qy=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,8,7,7,10,9,9,9,11,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,24,36,48,60,72,84,96,0,12,12,12,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,24,24,24,0,0,0,0,0,0,0,0,0,24,24,0,0,0,0,0,0,0,0,0,0,48,48,48,0,0,0,0,0,0,0,0,0,0,48,48,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,127,63,63,63,0,31,15,15,15,7,7,7];function G8e(n){var e=n.indexOf("%");if(e===-1)return n;for(var l=n.length,t="",r=0,i=0,s=e,u=WL;e>-1&&e<l;){var a=KL(n[e+1],4),c=KL(n[e+2],0),f=a|c,p=Qy[f];if(u=Qy[256+u+p],i=i<<6|f&Qy[364+p],u===WL)t+=n.slice(r,s),t+=i<=65535?String.fromCharCode(i):String.fromCharCode(55232+(i>>10),56320+(i&1023)),i=0,r=e+3,e=s=n.indexOf("%",r);else{if(u===z8e)return null;if(e+=3,e<l&&n.charCodeAt(e)===37)continue;return null}}return t+n.slice(r)}var X8e={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};function KL(n,e){var l=X8e[n];return l===void 0?255:l<<e}YL.exports=G8e});var lF=C((PAe,nF)=>{"use strict";var QL=JL(),ZL=/\+/g,eF=function(){};eF.prototype=Object.create(null);function W8e(n){let e=new eF;if(typeof n!="string")return e;let l=n.length,t="",r="",i=-1,s=-1,u=!1,a=!1,c=!1,f=!1,p=!1,m=0;for(let h=0;h<l+1;h++)if(m=h!==l?n.charCodeAt(h):38,m===38){if(p=s>i,p||(s=h),t=n.slice(i+1,s),p||t.length>0){c&&(t=t.replace(ZL," ")),u&&(t=QL(t)||t),p&&(r=n.slice(s+1,h),f&&(r=r.replace(ZL," ")),a&&(r=QL(r)||r));let g=e[t];g===void 0?e[t]=r:g.pop?g.push(r):e[t]=[g,r]}r="",i=h,s=h,u=!1,a=!1,c=!1,f=!1}else m===61?s<=i?s=h:a=!0:m===43?s>i?f=!0:c=!0:m===37&&(s>i?a=!0:u=!0);return e}nF.exports=W8e});var rF=C((DAe,tF)=>{var Ar=Array.from({length:256},(n,e)=>"%"+((e<16?"0":"")+e.toString(16)).toUpperCase(
2024-04-02 15:03:09 +08:00
`).join(`
2024-05-07 17:30:00 +08:00
`+e+c);l+=e+a+i+p+`
2024-05-23 19:28:35 +08:00
`,l+=wF(s,e+c)}return l}function t9e(n){let e=n.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function RF(n){return Array.isArray(n)?n.map(e=>RF(e)):typeof n=="symbol"?n.toString():typeof n=="function"?t9e(n):n}function r9e(n,e){if(!e.includeMeta)return{};let l=e.buildPrettyMeta(n),t={},r=e.includeMeta;Array.isArray(r)||(r=Reflect.ownKeys(l));for(let i of r){if(!Object.prototype.hasOwnProperty.call(l,i))continue;let s=i.toString(),u=l[i];if(u!=null){let a=JSON.stringify(RF(u));t[s]=a}}return t}function i9e(n){let e="";for(let[l,t]of Object.entries(n))e+=`
\u2022 (${l}) ${t}`;return e}function s9e(n){let e={...n.opts.constraints},l=e[xF.name];return delete e[xF.name],{...n,method:l,opts:{constraints:e}}}function u9e(n){let e=` (${n.method})`,l=n.opts.constraints||{};return Object.keys(l).length!==0&&(e+=" "+JSON.stringify(l)),e+=i9e(n.metaData),e}function a9e(n){return n.reduce((e,l)=>{for(let t of e)if(SF(l.opts.constraints,t.opts.constraints)&&SF(l.metaData,t.metaData))return t.method+=", "+l.method,e;return e.push(l),e},[])}function o9e(n,e,l){let t=n.routes;return l.method===void 0&&(t=t.map(s9e)),t=t.map(r=>(r.metaData=r9e(r,l),r)),l.method===void 0&&(t=a9e(t)),t.map(u9e).join(`
${e}`)}function W9(n,e,l,t){if((n.isLeafNode||t.commonPrefix!==!1)&&(l=l||"(empty root node)",e=e[l]={},n.isLeafNode&&(e[AF]=o9e(n,l,t)),l=""),n.staticChildren)for(let r of Object.values(n.staticChildren))W9(r,e,l+r.prefix,t);if(n.parametricChildren)for(let r of Object.values(n.parametricChildren)){let i=Array.from(r.nodePaths).join("|");W9(r,e,l+i,t)}n.wildcardChild&&W9(n.wildcardChild,e,"*",t)}function c9e(n,e){let l={};return W9(n,l,n.prefix,e),wF(l)}OF.exports={prettyPrintTree:c9e}});var CF=C((zAe,IF)=>{"use strict";var f9e=X9(),tv=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,l){let t=l.params,r=l.opts.constraints||{},i={params:t,constraints:r,handler:l.handler,store:l.store||null,_createParamsObject:this._compileCreateParamsObject(t)},s=Object.keys(r);s.length===0&&(this.unconstrainedHandler=i);for(let a of s)this.constraints.includes(a)||(a==="version"?this.constraints.unshift(a):this.constraints.push(a));let u=s.includes(f9e.name);if(!u&&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(i),this.handlers.sort((a,c)=>Object.keys(a.constraints).length-Object.keys(c.constraints).length),u||this._compileGetHandlerMatchingConstraints(e,r)}_compileCreateParamsObject(e){let l=[];for(let t=0;t<e.length;t++)l.push(`'${e[t]}': paramsArray[${t}]`);return new Function("paramsArray",`return {${l.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,l){for(let t=0;t<this.handlers.length;t++){let i=this.handlers[t].constraints[l];if(i!==void 0){let s=e.get(i)||0;s|=1<<t,e.set(i,s)}}}_constrainedIndexBitmask(e){let l=0;for(let t=0;t<this.handlers.length;t++)this.handlers[t].constraints[e]!==void 0&&(l|=1<<t);return~l}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let t of this.constraints){let r=e.newStoreForConstraint(t);this.constrainedHandlerStores[t]=r,this._buildConstraintStore(r,t)}let l=[];l.push(`
2024-04-02 15:03:09 +08:00
let candidates = ${(1<<this.handlers.length)-1}
let mask, matches
2024-05-07 17:30:00 +08:00
`);for(let t of this.constraints){l.push(`
mask = ${this._constrainedIndexBitmask(t)}
value = derivedConstraints.${t}
`);let i=e.strategies[t].mustMatchWhenDerived?"matches":"(matches | mask)";l.push(`
2024-04-02 15:03:09 +08:00
if (value === undefined) {
candidates &= mask
} else {
2024-05-07 17:30:00 +08:00
matches = this.constrainedHandlerStores.${t}.get(value) || 0
2024-04-02 15:03:09 +08:00
candidates &= ${i}
}
if (candidates === 0) return null;
2024-05-07 17:30:00 +08:00
`)}for(let t in e.strategies)e.strategies[t].mustMatchWhenDerived&&!this.constraints.includes(t)&&l.push(`if (derivedConstraints.${t} !== undefined) return null`);l.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",l.join(`
2024-05-23 19:28:35 +08:00
`))}};IF.exports=tv});var PF=C((GAe,kF)=>{"use strict";var p9e=CF(),e7={STATIC:0,PARAMETRIC:1,WILDCARD:2},K9=class{constructor(){this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}addRoute(e,l){this.routes===null&&(this.routes=[]),this.handlerStorage===null&&(this.handlerStorage=new p9e),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(l,e)}},Y9=class extends K9{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,l){let t=this.staticChildren[e.charAt(l)];return t===void 0||!t.matchPrefix(e,l)?null:t}getStaticChild(e,l=0){if(e.length===l)return this;let t=this.findStaticMatchingChild(e,l);return t?t.getStaticChild(e,l+t.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let l=this.staticChildren[e.charAt(0)];if(l){let r=1;for(;r<l.prefix.length;r++)if(e.charCodeAt(r)!==l.prefix.charCodeAt(r)){l=l.split(this,r);break}return l.createStaticChild(e.slice(r))}let t=e.charAt(0);return this.staticChildren[t]=new J9(e),this.staticChildren[t]}},J9=class n extends Y9{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=e7.STATIC,this._compilePrefixMatch()}getParametricChild(e){let l=e&&e.source,t=this.parametricChildren.find(r=>(r.regex&&r.regex.source)===l);return t||null}createParametricChild(e,l,t){let r=this.getParametricChild(e);return r?(r.nodePaths.add(t),r):(r=new Q9(e,l,t),this.parametricChildren.push(r),this.parametricChildren.sort((i,s)=>i.isRegex?s.isRegex?i.staticSuffix===null?1:s.staticSuffix===null?-1:s.staticSuffix.endsWith(i.staticSuffix)?1:i.staticSuffix.endsWith(s.staticSuffix)?-1:0:-1:1),r)}getWildcardChild(){return this.wildcardChild?this.wildcardChild:null}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new Z9,this.wildcardChild}split(e,l){let t=this.prefix.slice(0,l),r=this.prefix.slice(l);this.prefix=r,this._compilePrefixMatch();let i=new n(t);return i.staticChildren[r.charAt(0)]=this,e.staticChildren[t.charAt(0)]=i,i}getNextNode(e,l,t,r){let i=this.findStaticMatchingChild(e,l),s=0;if(i===null){if(this.parametricChildren.length===0)return this.wildcardChild;i=this.parametricChildren[0],s=1}this.wildcardChild!==null&&t.push({paramsCount:r,brotherPathIndex:l,brotherNode:this.wildcardChild});for(let u=this.parametricChildren.length-1;u>=s;u--)t.push({paramsCount:r,brotherPathIndex:l,brotherNode:this.parametricChildren[u]});return i}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let l=1;l<this.prefix.length;l++){let t=this.prefix.charCodeAt(l);e.push(`path.charCodeAt(i + ${l}) === ${t}`)}this.matchPrefix=new Function("path","i",`return ${e.join(" && ")}`)}},Q9=class extends Y9{constructor(e,l,t){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=l||null,this.kind=e7.PARAMETRIC,this.nodePaths=new Set([t])}getNextNode(e,l){return this.findStaticMatchingChild(e,l)}},Z9=class extends K9{constructor(){super(),this.kind=e7.WILDCARD}getNextNode(){return null}};kF.exports={StaticNode:J9,ParametricNode:Q9,WildcardNode:Z9,NODE_TYPES:e7}});var LF=C((XAe,DF)=>{"use strict";var d9e=require("assert");function h1(){if(!(this instanceof h1))return new h1;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}h1.prototype.set=function(n,e){if(typeof n!="string")throw new TypeError("Version should be a string");let[l,t,r]=n.split(".");return l=Number(l)||0,t=Number(t)||0,r=Number(r)||0,l>=this.maxMajor&&(this.maxMajor=l,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),t>=(this.maxMinors[l]||0)&&(this.maxMinors[l]=t,this.store[`${l}.x`]=e,this.store[`${l}.x.x`]=e),r>=(this.store[`${l}.${t}`]||0)&&(this.maxPatches[`${l}.${t}`]=r,this.store[`${l}.${t}.x`]=e),this.store[`${l}.${t}.${r}`]=e,this};h1.prototype.get=function(n){return this.store[n]};DF.exports={name:"version",mustMatchWhenDerived:!0,storage:h1,validate(n){d9e(typeof n=="string","Version should be a string")}}});var MF=C((WAe,FF)=>{"use strict";var h9e=require("assert");function m9e(){let n={},e=[];return{get:l=>{let t=n[l];if(t)return t;for
`)).bind(this)}};$F.exports=iv});var BF=C((YAe,UF)=>{"use strict";var v9e=["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"];UF.exports=v9e});var VF=C((JAe,qF)=>{"use strict";function HF(n,e){return n===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:n===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:n===52&&e===48?"@":null}function _9e(n,e){let l=!1,t=!1,r="";for(let s=1;s<n.length;s++){let u=n.charCodeAt(s);if(u===37){let a=n.charCodeAt(s+1),c=n.charCodeAt(s+2);HF(a,c)===null?l=!0:(t=!0,a===50&&c===53&&(l=!0,n=n.slice(0,s+1)+"25"+n.slice(s+1),s+=2),s+=2)}else if(u===63||u===35||u===59&&e){r=n.slice(s+1),n=n.slice(0,s);break}}return{path:l?decodeURI(n):n,querystring:r,shouldDecodeParam:t}}function E9e(n){let e=n.indexOf("%");if(e===-1)return n;let l="",t=e;for(let r=e;r<n.length;r++)if(n.charCodeAt(r)===37){let i=n.charCodeAt(r+1),s=n.charCodeAt(r+2),u=HF(i,s);l+=n.slice(t,r)+u,t=r+3}return n.slice(0,e)+l+n.slice(t)}qF.exports={safeDecodeURI:_9e,safeDecodeURIComponent:E9e}});var fv=C((QAe,JF)=>{"use strict";var ct=require("assert"),b9e=fF(),n7=bF(),av=Ja(),{prettyPrintTree:T9e}=NF(),{StaticNode:zF,NODE_TYPES:sv}=PF(),S9e=jF(),Io=BF(),uv=X9(),{safeDecodeURI:x9e,safeDecodeURIComponent:GF}=VF(),XF=/^https?:\/\/.*?\//,Fu=/(\/:[^/()]*?)\?(\/?)/;if(!n7(XF))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!n7(Fu))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function Gl(n){if(!(this instanceof Gl))return new Gl(n);n=n||{},this._opts=n,n.defaultRoute?(ct(typeof n.defaultRoute=="function","The default route must be a function"),this.defaultRoute=n.defaultRoute):this.defaultRoute=null,n.onBadUrl?(ct(typeof n.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=n.onBadUrl):this.onBadUrl=null,n.buildPrettyMeta?(ct(typeof n.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=n.buildPrettyMeta):this.buildPrettyMeta=A9e,n.querystringParser?(ct(typeof n.querystringParser=="function","querystringParser must be a function"),this.querystringParser=n.querystringParser):this.querystringParser=e=>e===""?{}:b9e.parse(e),this.caseSensitive=n.caseSensitive===void 0?!0:n.caseSensitive,this.ignoreTrailingSlash=n.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=n.ignoreDuplicateSlashes||!1,this.maxParamLength=n.maxParamLength||100,this.allowUnsafeRegex=n.allowUnsafeRegex||!1,this.constrainer=new S9e(n.constraints),this.useSemicolonDelimiter=n.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}Gl.prototype.on=function(e,l,t,r,i){typeof t=="function"&&(r!==void 0&&(i=r),r=t,t={}),ct(typeof l=="string","Path should be a string"),ct(l.length>0,"The path could not be empty"),ct(l[0]==="/"||l[0]==="*","The first character of a path should be `/` or `*`"),ct(typeof r=="function","Handler should be a function");let s=l.match(Fu);if(s){ct(l.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let c=l.replace(Fu,"$1$2"),f=l.replace(Fu,"$2");this.on(e,c,t,r,i),this.on(e,f,t,r,i);return}let u=l;this.ignoreDuplicateSlashes&&(l=ov(l)),this.ignoreTrailingSlash&&(l=cv(l));let a=Array.isArray(e)?e:[e];for(let c of a)ct(typeof c=="string","Method should be a string"),ct(Io.includes(c),`Method '${c}' is not an http method.`),this._on(c,l,t,r,i,u)};Gl.prototype._on=function(e,l,t,r,i){let s={};t.constraints!==void 0&&(ct(typeof t.constraints=="object"&&t.constraints!==null,"Constraints should be an object"),Object.keys(t.constraints).length!==0&&(s=t.constraints)),this.constrainer.validateConstraints(s),this.constrainer.noteUsage(s),this.trees[e]===void 0&&(this.trees[e]=new zF("/"));let u=l;if(u==="*"&&this.trees[e].prefix.length!==0){let m=this.trees[e]
2024-04-23 12:29:20 +08:00
Content-Length: ${Te.length}\r
2024-04-02 15:03:09 +08:00
Content-Type: application/json\r
\r
2024-05-23 19:28:35 +08:00
${Te}`),ge.destroy(J)}function ve(J,ge){J.headers["accept-version"]!==void 0&&(J.headers[fce]=J.headers["accept-version"],J.headers["accept-version"]=void 0),h.router.lookup(J,ge)}function q(J,ge,Te){if(u){let sn=o$(L.server,ge),Ce=u$(L,a,ge,sn),On=new p7(sn,null,ge,null,Ce,L),Wl=new A1(Te,On,Ce);return i===!1&&Ce.info({req:On},"incoming request"),u(new Cce(J),On,Wl)}let Ue=`{"error":"Bad Request","code":"FST_ERR_BAD_URL","message":"'${J}' is not a valid url component","statusCode":400}`;Te.writeHead(400,{"Content-Type":"application/json","Content-Length":Ue.length}),Te.end(Ue)}function re(J,ge,Te){if(J!==!1)return function(sn){if(sn){if(u){let On=o$(L.server,ge),Wl=u$(L,a,ge,On),Nn=new p7(On,null,ge,null,Wl,L),Gn=new A1(Te,Nn,Wl);return i===!1&&Wl.info({req:Nn},"incoming request"),u(new Ice,Nn,Gn)}let Ce='{"error":"Internal Server Error","message":"Unexpected error from async constraint","statusCode":500}';Te.writeHead(500,{"Content-Type":"application/json","Content-Length":Ce.length}),Te.end(Ce)}}}function te(J,ge){return Q('Cannot call "setNotFoundHandler"!'),h.setNotFoundHandler.call(this,J,ge,j,m.routeHandler),this}function ne(J){return Q('Cannot call "setValidatorCompiler"!'),this[us].setValidatorCompiler(J),this}function Bl(J){return Q('Cannot call "setSchemaErrorFormatter"!'),h$(J),this[Lv]=J.bind(this),this}function Rn(J){return Q('Cannot call "setSerializerCompiler"!'),this[us].setSerializerCompiler(J),this}function Ge(J){Q('Cannot call "setSchemaController"!');let ge=this[us],Te=i$.buildSchemaController(ge,Object.assign({},ge.opts,J));return this[us]=Te,this.getSchema=Te.getSchema.bind(Te),this.getSchemas=Te.getSchemas.bind(Te),this}function Hn(J){return Q('Cannot call "setReplySerializer"!'),this[r$]=J,this}function Ke(J){return Q('Cannot call "setErrorHandler"!'),this[f7]=d$(this[f7],J.bind(this)),this}function Xe(J){return Q('Cannot call "setChildLoggerFactory"!'),this[Mv]=J,this}function bl(J={}){return J.includeMeta=J.includeHooks?J.includeMeta?jv.concat(J.includeMeta):jv:J.includeMeta,m.printRoutes(J)}function fn(J,{rewriteUrl:ge,logger:Te}){let Ue;return function(Ce,On){if(Ue===void 0&&(Ue=J.isAsyncConstraint()),ge){Ce.originalUrl=Ce.url;let Wl=ge.call(O,Ce);if(typeof Wl=="string")Ce.url=Wl;else{let Nn=new Bce(Ce.url,typeof Wl);Ce.destroy(Nn)}}J.routing(Ce,On,re(Ue,Ce,On))}}function dn(J){return Q('Cannot call "setGenReqId"!'),this[$v]=c$(this[Dv].requestIdHeader,J),this}}d7.errorCodes=$u;function h$(n){if(typeof n!="function")throw new p$(typeof n);if(n.constructor.name==="AsyncFunction")throw new p$("AsyncFunction")}h7.exports=d7;h7.exports.fastify=d7;h7.exports.default=d7});var KH=C((dOe,WH)=>{"use strict";WH.exports=Error});var JH=C((hOe,YH)=>{"use strict";YH.exports=EvalError});var ZH=C((mOe,QH)=>{"use strict";QH.exports=RangeError});var nq=C((gOe,eq)=>{"use strict";eq.exports=ReferenceError});var CE=C((yOe,lq)=>{"use strict";lq.exports=SyntaxError});var p4=C((vOe,tq)=>{"use strict";tq.exports=TypeError});var iq=C((_Oe,rq)=>{"use strict";rq.exports=URIError});var uq=C((EOe,sq)=>{"use strict";sq.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},l=Symbol("test"),t=Object(l);if(typeof l=="string"||Object.prototype.toString.call(l)!=="[object Symbol]"||Object.prototype.toString.call(t)!=="[object Symbol]")return!1;var r=42;e[l]=r;for(l in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==l||!Object.prototype.propertyIsEnumerable.call(e,l))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,l);if(s.value!==r||s.enumerable!==!0)return!1}return!0}});var cq=C((bOe,oq)=>{"use strict";var aq=typeof Symbol<"u"&&Symbol,Ume=uq();oq.exports=function(){return typeof aq!="function"||typeof Symbol!="function"||typeof aq("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ume()
`)>=0)return!1;return!0}function Yge(n,e){var l;if(n.indent===" ")l=" ";else if(typeof n.indent=="number"&&n.indent>0)l=jr.call(Array(n.indent+1)," ");else return null;return{base:l,prev:jr.call(Array(e+1),l)}}function GE(n,e){if(n.length===0)return"";var l=`
`+e.prev+e.base;return l+jr.call(n,","+l)+`
`+e.prev}function nf(n,e){var l=zE(n),t=[];if(l){t.length=n.length;for(var r=0;r<n.length;r++)t[r]=bs(n,r)?e(n[r],n):""}var i=typeof UE=="function"?UE(n):[],s;if(v4){s={};for(var u=0;u<i.length;u++)s["$"+i[u]]=i[u]}for(var a in n)bs(n,a)&&(l&&String(Number(a))===a&&a<n.length||v4&&s["$"+a]instanceof Symbol||(aV.call(/[^\w$]/,a)?t.push(e(a,n)+": "+e(n[a],n)):t.push(a+": "+e(n[a],n))));if(typeof UE=="function")for(var c=0;c<i.length;c++)oV.call(n,i[c])&&t.push("["+e(i[c])+"]: "+e(n[i[c]],n));return t}});var vV=C((FOe,yV)=>{"use strict";var gV=ia(),_4=Xq(),Jge=mV(),Qge=p4(),rf=gV("%WeakMap%",!0),sf=gV("%Map%",!0),Zge=_4("WeakMap.prototype.get",!0),eye=_4("WeakMap.prototype.set",!0),nye=_4("WeakMap.prototype.has",!0),lye=_4("Map.prototype.get",!0),tye=_4("Map.prototype.set",!0),rye=_4("Map.prototype.has",!0),YE=function(n,e){for(var l=n,t;(t=l.next)!==null;l=t)if(t.key===e)return l.next=t.next,t.next=n.next,n.next=t,t},iye=function(n,e){var l=YE(n,e);return l&&l.value},sye=function(n,e,l){var t=YE(n,e);t?t.value=l:n.next={key:e,next:n.next,value:l}},uye=function(n,e){return!!YE(n,e)};yV.exports=function(){var e,l,t,r={assert:function(i){if(!r.has(i))throw new Qge("Side channel does not contain "+Jge(i))},get:function(i){if(rf&&i&&(typeof i=="object"||typeof i=="function")){if(e)return Zge(e,i)}else if(sf){if(l)return lye(l,i)}else if(t)return iye(t,i)},has:function(i){if(rf&&i&&(typeof i=="object"||typeof i=="function")){if(e)return nye(e,i)}else if(sf){if(l)return rye(l,i)}else if(t)return uye(t,i);return!1},set:function(i,s){rf&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new rf),eye(e,i,s)):sf?(l||(l=new sf),tye(l,i,s)):(t||(t={key:{},next:null}),sye(t,i,s))}};return r}});var uf=C((MOe,_V)=>{"use strict";var aye=String.prototype.replace,oye=/%20/g,JE={RFC1738:"RFC1738",RFC3986:"RFC3986"};_V.exports={default:JE.RFC3986,formatters:{RFC1738:function(n){return aye.call(n,oye,"+")},RFC3986:function(n){return String(n)}},RFC1738:JE.RFC1738,RFC3986:JE.RFC3986}});var eb=C(($Oe,bV)=>{"use strict";var cye=uf(),QE=Object.prototype.hasOwnProperty,sa=Array.isArray,Ur=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),fye=function(e){for(;e.length>1;){var l=e.pop(),t=l.obj[l.prop];if(sa(t)){for(var r=[],i=0;i<t.length;++i)typeof t[i]<"u"&&r.push(t[i]);l.obj[l.prop]=r}}},EV=function(e,l){for(var t=l&&l.plainObjects?Object.create(null):{},r=0;r<e.length;++r)typeof e[r]<"u"&&(t[r]=e[r]);return t},pye=function n(e,l,t){if(!l)return e;if(typeof l!="object"){if(sa(e))e.push(l);else if(e&&typeof e=="object")(t&&(t.plainObjects||t.allowPrototypes)||!QE.call(Object.prototype,l))&&(e[l]=!0);else return[e,l];return e}if(!e||typeof e!="object")return[e].concat(l);var r=e;return sa(e)&&!sa(l)&&(r=EV(e,t)),sa(e)&&sa(l)?(l.forEach(function(i,s){if(QE.call(e,s)){var u=e[s];u&&typeof u=="object"&&i&&typeof i=="object"?e[s]=n(u,i,t):e.push(i)}else e[s]=i}),e):Object.keys(l).reduce(function(i,s){var u=l[s];return QE.call(i,s)?i[s]=n(i[s],u,t):i[s]=u,i},r)},dye=function(e,l){return Object.keys(l).reduce(function(t,r){return t[r]=l[r],t},e)},hye=function(n,e,l){var t=n.replace(/\+/g," ");if(l==="iso-8859-1")return t.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(t)}catch{return t}},ZE=1024,mye=function(e,l,t,r,i){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),t==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var u="",a=0;a<s.length;a+=ZE){for(var c=s.length>=ZE?s.slice(a,a+ZE):s,f=[],p=0;p<c.length;++p){var m=c.charCodeAt(p);if(m===45||m===46||m===95||m===126||m>=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||i===cye.RFC1738&&(m===40||m===41)){f[f.length]=c.charAt(p);continue}if(m<128){f[f.length]=Ur[m];continue}if(m<2048){f[f.length]=Ur[192|m>>6]+Ur[128|m&63];continue}if(m<55296||m>=57344){f[f.length]=Ur[224|m>>12]+Ur[128|m>>6&63]+Ur[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|c.charCodeAt(p)&1023),f[f.length]=Ur[240|m>>18]+Ur[12
`;Jn.DEFAULT_CONTENT_TYPE="application/octet-stream";Jn.prototype.append=function(n,e,l){l=l||{},typeof l=="string"&&(l={filename:l});var t=mb.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),Tz.isArray(e)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(n,e,l),i=this._multiPartFooter();t(r),t(e),t(i),this._trackLength(r,e,l)};Jn.prototype._trackLength=function(n,e,l){var t=0;l.knownLength!=null?t+=+l.knownLength:Buffer.isBuffer(e)?t=e.length:typeof e=="string"&&(t=Buffer.byteLength(e)),this._valueLength+=t,this._overheadLength+=Buffer.byteLength(n)+Jn.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof Qve))&&(l.knownLength||this._valuesToMeasure.push(e))};Jn.prototype._lengthRetriever=function(n,e){n.hasOwnProperty("fd")?n.end!=null&&n.end!=1/0&&n.start!=null?e(null,n.end+1-(n.start?n.start:0)):Jve.stat(n.path,function(l,t){var r;if(l){e(l);return}r=t.size-(n.start?n.start:0),e(null,r)}):n.hasOwnProperty("httpVersion")?e(null,+n.headers["content-length"]):n.hasOwnProperty("httpModule")?(n.on("response",function(l){n.pause(),e(null,+l.headers["content-length"])}),n.resume()):e("Unknown stream")};Jn.prototype._multiPartHeader=function(n,e,l){if(typeof l.header=="string")return l.header;var t=this._getContentDisposition(e,l),r=this._getContentType(e,l),i="",s={"Content-Disposition":["form-data",'name="'+n+'"'].concat(t||[]),"Content-Type":[].concat(r||[])};typeof l.header=="object"&&hb(s,l.header);var u;for(var a in s)s.hasOwnProperty(a)&&(u=s[a],u!=null&&(Array.isArray(u)||(u=[u]),u.length&&(i+=a+": "+u.join("; ")+Jn.LINE_BREAK)));return"--"+this.getBoundary()+Jn.LINE_BREAK+i+Jn.LINE_BREAK};Jn.prototype._getContentDisposition=function(n,e){var l,t;return typeof e.filepath=="string"?l=pb.normalize(e.filepath).replace(/\\/g,"/"):e.filename||n.name||n.path?l=pb.basename(e.filename||n.name||n.path):n.readable&&n.hasOwnProperty("httpVersion")&&(l=pb.basename(n.client._httpMessage.path||"")),l&&(t='filename="'+l+'"'),t};Jn.prototype._getContentType=function(n,e){var l=e.contentType;return!l&&n.name&&(l=db.lookup(n.name)),!l&&n.path&&(l=db.lookup(n.path)),!l&&n.readable&&n.hasOwnProperty("httpVersion")&&(l=n.headers["content-type"]),!l&&(e.filepath||e.filename)&&(l=db.lookup(e.filepath||e.filename)),!l&&typeof n=="object"&&(l=Jn.DEFAULT_CONTENT_TYPE),l};Jn.prototype._multiPartFooter=function(){return function(n){var e=Jn.LINE_BREAK,l=this._streams.length===0;l&&(e+=this._lastBoundary()),n(e)}.bind(this)};Jn.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Jn.LINE_BREAK};Jn.prototype.getHeaders=function(n){var e,l={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in n)n.hasOwnProperty(e)&&(l[e.toLowerCase()]=n[e]);return l};Jn.prototype.setBoundary=function(n){this._boundary=n};Jn.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Jn.prototype.getBuffer=function(){for(var n=new Buffer.alloc(0),e=this.getBoundary(),l=0,t=this._streams.length;l<t;l++)typeof this._streams[l]!="function"&&(Buffer.isBuffer(this._streams[l])?n=Buffer.concat([n,this._streams[l]]):n=Buffer.concat([n,Buffer.from(this._streams[l])]),(typeof this._streams[l]!="string"||this._streams[l].substring(2,e.length+2)!==e)&&(n=Buffer.concat([n,Buffer.from(Jn.LINE_BREAK)])));return Buffer.concat([n,Buffer.from(this._lastBoundary())])};Jn.prototype._generateBoundary=function(){for(var n="--------------------------",e=0;e<24;e++)n+=Math.floor(Math.random()*10).toString(16);this._boundary=n};Jn.prototype.getLengthSync=function(){var n=this._overheadLength+this._valueLength;return this._streams.length&&(n+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),n};Jn.prototype.hasKnownLength=function(){var n=!0;return this._valuesToMeasure.length&&(n=!1),n};Jn.prototype.getLength=function(n){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure
`,p.message,p.stack);var m=new Error("tunneling socket could not be established, cause="+p.message);m.code="ECONNRESET",e.request.emit("error",m),t.removeSocket(r)}};Ii.prototype.removeSocket=function(e){var l=this.sockets.indexOf(e);if(l!==-1){this.sockets.splice(l,1);var t=this.requests.shift();t&&this.createSocket(t,function(r){t.request.onSocket(r)})}};function RG(n,e){var l=this;Ii.prototype.createSocket.call(l,n,function(t){var r=n.request.getHeader("host"),i=Yb({},l.options,{socket:t,servername:r?r.replace(/:.*$/,""):n.host}),s=J_e.connect(0,i);l.sockets[l.sockets.indexOf(t)]=s,e(s)})}function OG(n,e,l){return typeof n=="string"?{host:n,port:e,localAddress:l}:n}function Yb(n){for(var e=1,l=arguments.length;e<l;++e){var t=arguments[e];if(typeof t=="object")for(var r=Object.keys(t),i=0,s=r.length;i<s;++i){var u=r[i];t[u]!==void 0&&(n[u]=t[u])}}return n}var Os;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?Os=function(){var n=Array.prototype.slice.call(arguments);typeof n[0]=="string"?n[0]="TUNNEL: "+n[0]:n.unshift("TUNNEL:"),console.error.apply(console,n)}:Os=function(){};N4.debug=Os});var CG=C((Cke,IG)=>{IG.exports=NG()});var EW=C(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.removeTrailingChar=ha.merge=void 0;var ZEe=(...n)=>{let e={};return n.forEach(function(l){var t;for(t in l)t in e&&e[t]===null?e[t]=l[t]:t in e&&Array.isArray(e[t])?e[t]=e[t].concat(l[t]):t in e&&typeof e[t]=="object"?e[t]=(0,ha.merge)(e[t],l[t]):e[t]=l[t]}),e};ha.merge=ZEe;var ebe=(n,e)=>n.length>1&&n.endsWith(e)?n.substring(0,n.length-1):n;ha.removeTrailingChar=ebe});var C4=C(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.DataError=Gs.DatabaseError=Gs.NestedError=void 0;var z5=class extends Error{inner;id;constructor(e,l,t){super(e),this.inner=t,this.id=l,this.name=this.constructor.name}toString(){let e=this.name+": "+this.message;return this.inner?e+`:
`+this.inner:e}};Gs.NestedError=z5;var AT=class extends z5{};Gs.DatabaseError=AT;var wT=class extends z5{};Gs.DataError=wT});var CT=C(I2=>{"use strict";Object.defineProperty(I2,"__esModule",{value:!0});I2.getArrayIndicies=I2.validateArrayIndex=I2.validateArrayIndicies=I2.isInt=I2.ArrayInfo=I2.arrayRegex=void 0;var Rf=C4(),nbe=()=>/^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;I2.arrayRegex=nbe;var RT={},OT=class n{property;index=0;append=!1;indicies=[];constructor(e,l){this.property=e;let t=l[0]??0;if(this.append=t===""||l[l.length-1]==="",this.indicies=l,NT(t))this.index=parseInt(t);else if(!this.append)throw new Rf.DataError("Only numerical values accepted for array index",200)}static processArray(e){if(typeof e>"u")return null;if(RT[e])return RT[e];let t=(0,I2.arrayRegex)().exec(e.trim());if(t!=null){let r=t[1],i="["+t[2].toString()+"]",s=IT(i);return bW(s),RT[e]=new n(r,s)}return null}getIndex(e,l){if(this.append)return-1;let t=this.index;if(t==-1){let r=l?e:e[this.property];return r.length===0?0:r.length-1}return t}getData(e){if(this.append)throw new Rf.DataError("Can't get data when appending",100);let{index:l,dataForProperty:t}=this.getArrayDataAndIndexFromProperty(e);return t[l]}setData(e,l){if(this.append){let t=e[this.property];this.indicies.forEach(r=>{r!==""&&(r=+r,r===-1&&(r=t.length-1),t=t[+r])}),t.push(l)}else{let{index:t,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);t===-1?r.push(l):r[t]=l}}delete(e){if(this.append)throw new Rf.DataError("Can't delete an appended data",10);let{index:l,dataForProperty:t}=this.getArrayDataAndIndexFromProperty(e);t.splice(l,1)}isValid(e){let{index:l,dataForProperty:t}=this.getArrayDataAndIndexFromProperty(e);return t.hasOwnProperty(l)}getArrayDataAndIndexFromProperty(e){let l=0,t=e instanceof Array?e:e[this.property]??e;if(this.indicies.length>0){l=+this.indicies[this.indicies.length-1];for(let r=0;r<this.indicies.length-1;r++){let i=+this.indicies[r];i===-1&&(i=t.length-1),t=t[i]}l===-1&&(l=t.length-1)}return{index:l,dataForProperty:t}}isMultiDimensional(){return this.indicies.length>1}};I2.ArrayInfo=OT;function NT(n){return!isNaN(n)&&Number(n)==n&&!isNaN(parseInt(n,10))}I2.isInt=NT;function bW(n){let e=n.filter(l=>l==="");if(e.length>1)throw Error("Only one append index is supported for nested arrays");if(e.length===1&&n[n.length-1]!=="")throw Error("Append index must be at the end of the nested array")}I2.validateArrayIndicies=bW;function TW(n){if(n.length!==0&&!NT(n))throw new Rf.DataError("Only numerical values accepted for array index",200)}I2.validateArrayIndex=TW;function IT(n){if(n.length===0)return[];if(n.charAt(0)!=="[")throw new Error("Invalid array syntax detected");let e=n.substring(1,n.indexOf("]"));TW(e);let l=e.length+2;return[e,...IT(n.substring(l))]}I2.getArrayIndicies=IT});var AW=C(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.DBParentData=void 0;var SW=CT(),xW=C4(),kT=class{parent;data;db;dataPath;constructor(e,l,t,r){this.parent=r,this.data=e,this.db=l,this.dataPath=t}checkArray(e=!1){let l=SW.ArrayInfo.processArray(this.parent);if(l&&(!l.append||e)&&!l.isValid(this.data))throw new xW.DataError("DataPath: /"+this.dataPath+". Can't find index "+l.index+" in array "+l.property,10);return l}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 l=SW.ArrayInfo.processArray(this.parent);if(l){if(!this.data.hasOwnProperty(l.property))this.data[l.property]=[];else if(!Array.isArray(this.data[l.property]))throw new xW.DataError("DataPath: /"+this.dataPath+". "+l.property+" is not an array.",11);l.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]}};Of.DBParentData=kT});var RW=C((YDe,wW)=>{wW.exports=function(){"use strict";function n(){this.readers=0,this.queue=[]}function e(i,s,u){var a;typeof i!="function"?(r.hasOwnProperty(i)
`:n(e.children):P7(e)?n(e.children):Pr(e)?e.data:""},textContent:Qo,innerText:F7,getChildren:X7,getParent:Uj,getSiblings:Bj,getAttributeValue:function(n,e){return(n=n.attribs)==null?void 0:n[e]},hasAttrib:function(n,e){return n.attribs!=null&&Object.prototype.hasOwnProperty.call(n.attribs,e)&&n.attribs[e]!=null},getName:function(n){return n.name},nextElementSibling:$_,prevElementSibling:j_,removeElement:Bu,replaceElement:function(n,e){let l=e.prev=n.prev;l&&(l.next=e);var t=e.next=n.next;if(t&&(t.prev=e),t=e.parent=n.parent){let r=t.children;r[r.lastIndexOf(n)]=e,n.parent=null}},appendChild:function(n,e){Bu(e),e.next=null,1<(e.parent=n).children.push(e)?((n=n.children[n.children.length-2]).next=e).prev=n:e.prev=null},append:function(n,e){Bu(e);var l=n.parent,t=n.next;if(e.next=t,((e.prev=n).next=e).parent=l,t){if(t.prev=e,l){let r=l.children;r.splice(r.lastIndexOf(t),0,e)}}else l&&l.children.push(e)},prependChild:function(n,e){Bu(e),e.parent=n,e.prev=null,n.children.unshift(e)!==1?((n=n.children[1]).prev=e).next=n:e.next=null},prepend:function(n,e){Bu(e);var l,t=n.parent;t&&(l=t.children).splice(l.indexOf(n),0,e),n.prev&&(n.prev.next=e),e.parent=t,e.prev=n.prev,(e.next=n).prev=e},filter:S7,find:U_,findOneChild:function(n,e){return e.find(n)},findOne:c_,existsOne:function n(e,l){return l.some(t=>cn(t)&&(e(t)||n(e,t.children)))},findAll:function(n,e){for(var l=[],t=[e],r=[0];;)if(r[0]>=t[0].length){if(t.length===1)return l;t.shift(),r.shift()}else{let i=t[0][r[0]++];cn(i)&&(n(i)&&l.push(i),0<i.children.length)&&(r.unshift(0),t.unshift(i.children))}},testElement:function(n,e){return!(n=S$(n))||n(e)},getElements:function(n,e,l,t=1/0){return(n=S$(n))?S7(n,e,l,t):[]},getElementById:function(n,e,l=!0){return Array.isArray(e)||(e=[e]),c_(Hj("id",n),e,l)},getElementsByTagName:Go,getElementsByTagType:function(n,e,l=!0,t=1/0){return S7(M7.tag_type(n),e,l,t)},removeSubsets:function(n){let e=n.length;for(;0<=--e;){var l=n[e];if(0<e&&0<=n.lastIndexOf(l,e-1))n.splice(e,1);else for(let t=l.parent;t;t=t.parent)if(n.includes(t)){n.splice(e,1);break}}return n},get DocumentPosition(){return w3},compareDocumentPosition:qj,uniqueSort:Zo,getFeed:function(n){return(n=m7(hfe,n))?(n.name==="feed"?function(e){var l={type:"atom",items:Go("entry",e=e.children).map(r=>{var i={media:x$(r=r.children)},s=(H2(i,"id","id",r),H2(i,"title","title",r),(s=m7("link",r))==null?void 0:s.attribs.href);return s&&(i.link=s),(s=as("summary",r)||as("content",r))&&(i.description=s),(s=as("updated",r))&&(i.pubDate=new Date(s)),i})},t=(H2(l,"id","id",e),H2(l,"title","title",e),(t=m7("link",e))==null?void 0:t.attribs.href);return t&&(l.link=t),H2(l,"description","subtitle",e),(t=as("updated",e))&&(l.updated=new Date(t)),H2(l,"author","email",e,!0),l}:function(t){var l=(l=(l=m7("channel",t.children))==null?void 0:l.children)!=null?l:[],t={type:t.name.substr(0,3),id:"",items:Go("item",t.children).map(i=>{var s={media:x$(i=i.children)};return H2(s,"id","guid",i),H2(s,"title","title",i),H2(s,"link","link",i),H2(s,"description","description",i),(i=as("pubDate",i)||as("dc:date",i))&&(s.pubDate=new Date(i)),s})},r=(H2(t,"title","title",l),H2(t,"link","link",l),H2(t,"description","description",l),as("lastBuildDate",l));return r&&(t.updated=new Date(r)),H2(t,"author","managingEditor",l,!0),t})(n):null}}),Xo=function(){return(Xo=Object.assign||function(n){for(var e,l=1,t=arguments.length;l<t;l++)for(var r in e=arguments[l])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}).apply(this,arguments)};function Vj(n,e,l){return n?n(e??n._root.children,null,void 0,l).toString():""}function mfe(n,e){return Vj(this,function(l){return!(typeof l!="object"||l==null||"length"in l||"type"in l)}(n)?void(e=n):n,Xo(Xo(Xo({},M_),this==null?void 0:this._options),u_(e??{})))}function gfe(n){return Vj(this,n,Xo(Xo({},this._options),{xmlMode:!0}))}function Q1(n){for(var e=n||(this?this.root():[]),l="",t=0;t<e.length;t++)l+=Qo(e[t]);return l}function yfe(n,e,l){return l===void 0&&(l=typeof e=="boolean"&&e),n&&typeof n=="string"?(typeof e=="boolean"&&(l=e),e=this.load(n,M_,!1),l||e("script
2024-04-02 15:03:09 +08:00
:is(button, input, select, textarea, optgroup, option)[disabled],
optgroup[disabled] > option,
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
2024-05-23 19:28:35 +08:00
)`,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])"},Yj={};function Jj(n,e){var l=e.getSiblings(n);return l.length<=1||(n=l.indexOf(n))<0||n===l.length-1?[]:l.slice(n+1).filter(e.isTag)}function m_(n){return{xmlMode:!!n.xmlMode,lowerCaseAttributeNames:!!n.lowerCaseAttributeNames,lowerCaseTags:!!n.lowerCaseTags,quirksMode:!!n.quirksMode,cacheResults:!!n.cacheResults,pseudos:n.pseudos,adapter:n.adapter,equals:n.equals}}var Gv=(n,e,l,t,r)=>{let i=r(e,m_(l),t);return i===wn.trueFunc?n:i===wn.falseFunc?wn.falseFunc:s=>i(s)&&n(s)},Xv={is:Gv,matches:Gv,where:Gv,not(n,e,l,t,r){let i=r(e,m_(l),t);return i===wn.falseFunc?n:i===wn.trueFunc?wn.falseFunc:s=>!i(s)&&n(s)},has(n,e,l,t,r){let i=l.adapter,s=m_(l),u=(s.relativeSelector=!0,e.some(f=>f.some(d_))?[Yj]:void 0),a=r(e,s,u);if(a===wn.falseFunc)return wn.falseFunc;let c=function(f,p){return f===wn.falseFunc?wn.falseFunc:m=>p.isTag(m)&&f(m)}(a,i);if(u&&a!==wn.trueFunc){let{shouldTestNextSiblings:f=!1}=a;return h=>{if(!n(h))return!1;u[0]=h;var m=i.getChildren(h),h=f?[...m,...Jj(h,i)]:m;return i.existsOne(c,h)}}return f=>n(f)&&i.existsOne(c,i.getChildren(f))}};function Wv(n,e){return(n=e.getParent(n))&&e.isTag(n)?n:null}function Ffe(n,e,l,t,r){let{adapter:i,equals:s}=l;switch(e.type){case en.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case en.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case en.Attribute:if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return l.xmlMode&&!l.lowerCaseAttributeNames||(e.name=e.name.toLowerCase()),kfe[e.action](n,e,l);case en.Pseudo:return function(u,a,c,f,p){let{name:m,data:h}=a;if(Array.isArray(h)){if(m in Xv)return Xv[m](u,h,c,f,p);throw new Error(`Unknown pseudo-class :${m}(${h})`)}let g=(a=c.pseudos)==null?void 0:a[m],_=typeof g=="string"?g:Lfe[m];if(typeof _=="string"){if(h!=null)throw new Error(`Pseudo ${m} doesn't have any arguments`);let S=K7(_);return Xv.is(u,S,c,f,p)}if(typeof g=="function")return F$(g,m,h,1),S=>g(S,h)&&u(S);if(m in h_)return h_[m](u,h,c,f);if(m in L$){let S=L$[m];return F$(S,m,h,2),T=>S(T,c,h)&&u(T)}throw new Error("Unknown pseudo-class :"+m)}(n,e,l,t,r);case en.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let u=e.name;return l.xmlMode&&!l.lowerCaseTags||(u=u.toLowerCase()),function(a){return i.getName(a)===u&&n(a)}}case en.Descendant:{if(l.cacheResults===!1||typeof WeakSet>"u")return function(a){let c=a;for(;c=Wv(c,i);)if(n(c))return!0;return!1};let u=new WeakSet;return function(a){let c=a;for(;c=Wv(c,i);)if(!u.has(c)){if(i.isTag(c)&&n(c))return!0;u.add(c)}return!1}}case"_flexibleDescendant":return function(u){let a=u;do if(n(a))return!0;while(a=Wv(a,i));return!1};case en.Parent:return function(u){return i.getChildren(u).some(a=>i.isTag(a)&&n(a))};case en.Child:return function(u){return(u=i.getParent(u))!=null&&i.isTag(u)&&n(u)};case en.Sibling:return function(u){var a=i.getSiblings(u);for(let f=0;f<a.length;f++){var c=a[f];if(s(u,c))break;if(i.isTag(c)&&n(c))return!0}return!1};case en.Adjacent:return i.prevElementSibling?function(u){return(u=i.prevElementSibling(u))!=null&&n(u)}:function(u){var a=i.getSiblings(u);let c;for(let p=0;p<a.length;p++){var f=a[p];if(s(u,f))break;i.isTag(f)&&(c=f)}return!!c&&n(c)};case en.Universal:if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not ye
`)}}):{name:t,value:r.replace($$,`\r
`)}}).toArray()}}),F1=function(n,e,l){if(this.length=0,this.options=l,this._root=e,n){for(var t=0;t<n.length;t++)this[t]=n[t];this.length=n.length}},X_=(F1.prototype.cheerio="[cheerio object]",F1.prototype.splice=Array.prototype.splice,F1.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(F1.prototype,Tfe,tpe,ope,cpe,ppe),function(n,e){return(X_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(l,t){l.__proto__=t}:function(l,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(l[r]=t[r])}))(n,e)}),dpe=function(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function l(){this.constructor=n}X_(n,e),n.prototype=e===null?Object.create(e):(l.prototype=e.prototype,new l)},M1=function(){return(M1=Object.assign||function(n){for(var e,l=1,t=arguments.length;l<t;l++)for(var r in e=arguments[l])Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}).apply(this,arguments)},hpe=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]),Ul="\uFFFD",j$=(function(n){n[n.EOF=-1]="EOF",n[n.NULL=0]="NULL",n[n.TABULATION=9]="TABULATION",n[n.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",n[n.LINE_FEED=10]="LINE_FEED",n[n.FORM_FEED=12]="FORM_FEED",n[n.SPACE=32]="SPACE",n[n.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",n[n.QUOTATION_MARK=34]="QUOTATION_MARK",n[n.NUMBER_SIGN=35]="NUMBER_SIGN",n[n.AMPERSAND=38]="AMPERSAND",n[n.APOSTROPHE=39]="APOSTROPHE",n[n.HYPHEN_MINUS=45]="HYPHEN_MINUS",n[n.SOLIDUS=47]="SOLIDUS",n[n.DIGIT_0=48]="DIGIT_0",n[n.DIGIT_9=57]="DIGIT_9",n[n.SEMICOLON=59]="SEMICOLON",n[n.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",n[n.EQUALS_SIGN=61]="EQUALS_SIGN",n[n.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",n[n.QUESTION_MARK=63]="QUESTION_MARK",n[n.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",n[n.LATIN_CAPITAL_F=70]="LATIN_CAPITAL_F",n[n.LATIN_CAPITAL_X=88]="LATIN_CAPITAL_X",n[n.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",n[n.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",n[n.GRAVE_ACCENT=96]="GRAVE_ACCENT",n[n.LATIN_SMALL_A=97]="LATIN_SMALL_A",n[n.LATIN_SMALL_F=102]="LATIN_SMALL_F",n[n.LATIN_SMALL_X=120]="LATIN_SMALL_X",n[n.LATIN_SMALL_Z=122]="LATIN_SMALL_Z",n[n.REPLACEMENT_CHARACTER=65533]="REPLACEMENT_CHARACTER"}(P=P||{}),"--"),U$="[CDATA[",B$="doctype",Do="script",mpe="public",gpe="system";function pU(n){return 55296<=n&&n<=57343}function dU(n){return n!==32&&n!==10&&n!==13&&n!==9&&n!==12&&1<=n&&n<=31||127<=n&&n<=159}function hU(n){return 64976<=n&&n<=65007||hpe.has(n)}(function(n){n.controlCharacterInInputStream="control-character-in-input-stream",n.noncharacterInInputStream="noncharacter-in-input-stream",n.surrogateInInputStream="surrogate-in-input-stream",n.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",n.endTagWithAttributes="end-tag-with-attributes",n.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",n.unexpectedSolidusInTag="unexpected-solidus-in-tag",n.unexpectedNullCharacter="unexpected-null-character",n.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",n.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",n.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",n.missingEndTagName="missing-end-tag-name",n.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",n.unknownNamedCharacterReference="unknown-named-character-reference",n.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",n.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",n.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",n.eofBeforeTagName="eof-before-tag-name",n.eofInTag="eof-in-tag",n.missingAttributeValue="missing-attribute-value",n.missingWhitespaceBetweenAttributes="missin
`,this.firstUpdate&&(j+=" "),this.message=j+(this.message||""),this.firstUpdate=!1,this},b}function c(T){return l.toString.call(T)==="[object Function]"}function f(T){return l.toString.call(T)==="[object Array]"}function p(T){return l.toString.call(T)==="[object String]"}function m(T){return l.toString.call(T)==="[object Object]"}function h(T){var x=function(v){return v?typeof v=="string"?v.split("."):[v]:[]}(T);return function(v){for(var b=v,w=0;w<x.length;w++){var N=x[w];if(!s(b,N))return;b=b[N]}return b}}function g(T){return Array.prototype.slice.call(T)}function _(T,x,v){return Array.prototype.indexOf.call(T||[],x,v)}function S(T){var x,v=[];for(x in T)s(T,x)&&v.push(x);return v}i.hasOwnProp=s,i._prettifyError=function(T,x,v){return(v=v.Update?v:new i.TemplateError(v)).Update(T),x||(T=v,(v=new Error(T.message)).name=T.name),v},Object.setPrototypeOf?Object.setPrototypeOf(a.prototype,Error.prototype):a.prototype=Object.create(Error.prototype,{constructor:{value:a}}),i.TemplateError=a,i.escape=function(T){return T.replace(r,u)},i.isFunction=c,i.isArray=f,i.isString=p,i.isObject=m,i.getAttrGetter=h,i.groupBy=function(T,x,v){for(var b={},w=c(x)?x:h(x),N=0;N<T.length;N++){var O=T[N],k=w(O,N);if(k===void 0&&v===!0)throw new TypeError('groupby: attribute "'+x+'" resolved to undefined');(b[k]||(b[k]=[])).push(O)}return b},i.toArray=g,i.without=function(T){var x=[];if(T)for(var v=T.length,b=g(arguments).slice(1),w=-1;++w<v;)_(b,T[w])===-1&&x.push(T[w]);return x},i.repeat=function(T,x){for(var v="",b=0;b<x;b++)v+=T;return v},i.each=function(T,x,v){if(T!=null){if(e.forEach&&T.forEach===e.forEach)T.forEach(x,v);else if(T.length===+T.length)for(var b=0,w=T.length;b<w;b++)x.call(v,T[b],b,T)}},i.map=function(T,x){var v=[];if(T!=null){if(e.map&&T.map===e.map)return T.map(x);for(var b=0;b<T.length;b++)v[v.length]=x(T[b],b);T.length===+T.length&&(v.length=T.length)}return v},i.asyncIter=function(T,x,v){var b=-1;(function w(){++b<T.length?x(T[b],b,w,v):v()})()},i.asyncFor=function(T,x,v){var b=S(T||{}),w=b.length,N=-1;(function O(){var k=b[++N];N<w?x(k,T[k],N,w,O):v()})()},i.indexOf=_,i.keys=S,i._entries=function(T){return S(T).map(function(x){return[x,T[x]]})},i._values=function(T){return S(T).map(function(x){return T[x]})},i._assign=i.extend=function(T,x){return T=T||{},S(x).forEach(function(v){T[v]=x[v]}),T},i.inOperator=function(T,x){if(f(x)||p(x))return x.indexOf(T)!==-1;if(m(x))return T in x;throw new Error('Cannot use "in" operator to search for "'+T+'" in unexpected types.')}});function jU(){throw new Error("setTimeout has not been defined")}function UU(){throw new Error("clearTimeout has not been defined")}var fs=jU,ps=UU;function BU(n){if(fs===setTimeout)return setTimeout(n,0);if((fs===jU||!fs)&&setTimeout)return(fs=setTimeout)(n,0);try{return fs(n,0)}catch{try{return fs.call(null,n,0)}catch{return fs.call(this,n,0)}}}typeof xi.setTimeout=="function"&&(fs=setTimeout),typeof xi.clearTimeout=="function"&&(ps=clearTimeout);var zu,wi=[],Yo=!1,N7=-1;function dde(){Yo&&zu&&(Yo=!1,zu.length?wi=zu.concat(wi):N7=-1,wi.length)&&HU()}function HU(){if(!Yo){var n=BU(dde);Yo=!0;for(var e=wi.length;e;){for(zu=wi,wi=[];++N7<e;)zu&&zu[N7].run();N7=-1,e=wi.length}zu=null,Yo=!1,function(l){if(ps===clearTimeout)return clearTimeout(l);if((ps===UU||!ps)&&clearTimeout)return(ps=clearTimeout)(l);try{ps(l)}catch{try{return ps.call(null,l)}catch{return ps.call(this,l)}}}(n)}}function qU(n,e){this.fun=n,this.array=e}function Ju(){}qU.prototype.run=function(){this.fun.apply(null,this.array)};var hde=Ju,mde=Ju,gde=Ju,yde=Ju,vde=Ju,_de=Ju,Ede=Ju,Uo=xi.performance||{},bde=Uo.now||Uo.mozNow||Uo.msNow||Uo.oNow||Uo.webkitNow||function(){return new Date().getTime()},Tde=new Date,vs={nextTick:function(n){var e=new Array(arguments.length-1);if(1<arguments.length)for(var l=1;l<arguments.length;l++)e[l-1]=arguments[l];wi.push(new qU(n,e)),wi.length!==1||Yo||BU(HU)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:hde,addListener:mde,once:gde,off:yde,removeListener:vde,removeAllListeners:_de,emit:Ede,binding:function(n){throw new Error("process.
\r\xA0`,Sj="()[]{}%*-+~/#,:|.<>=!",KU="string",YU="whitespace",JU="data",QU="block-start",ZU="block-end",eB="variable-start",nB="variable-end",lB="comment",tB="left-paren",rB="right-paren",iB="left-bracket",sB="right-bracket",uB="left-curly",aB="right-curly",oB="operator",cB="comma",fB="colon",pB="tilde",dB="pipe",hB="float",mB="boolean",P_="none",gB="symbol",yB="regex";function O2(n,e,l,t){return{type:n,value:e,lineno:l,colno:t}}var Ode=function(){function n(l,t){this.str=l,this.index=0,this.len=l.length,this.lineno=0,this.colno=0,this.in_code=!1,l=(t=t||{}).tags||{},this.tags={BLOCK_START:l.blockStart||"{%",BLOCK_END:l.blockEnd||"%}",VARIABLE_START:l.variableStart||"{{",VARIABLE_END:l.variableEnd||"}}",COMMENT_START:l.commentStart||"{#",COMMENT_END:l.commentEnd||"#}"},this.trimBlocks=!!t.trimBlocks,this.lstripBlocks=!!t.lstripBlocks}var e=n.prototype;return e.nextToken=function(){var l=this.lineno,t=this.colno;if(this.in_code){var r=this.current();if(this.isFinished())return null;if(r==='"'||r==="'")return O2(KU,this._parseString(r),l,t);if(h=this._extract(Tj))return O2(YU,h,l,t);if(h=(h=this._extractString(this.tags.BLOCK_END))||this._extractString("-"+this.tags.BLOCK_END))return this.in_code=!1,this.trimBlocks&&((r=this.current())===`
2024-05-07 17:30:00 +08:00
`?this.forward():r==="\r"&&(this.forward(),(r=this.current())===`
2024-05-23 19:28:35 +08:00
`?this.forward():this.back())),O2(ZU,h,l,t);if(h=(h=this._extractString(this.tags.VARIABLE_END))||this._extractString("-"+this.tags.VARIABLE_END))return this.in_code=!1,O2(nB,h,l,t);if(r==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var i="";!this.isFinished();){if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}i+=this.current(),this.forward()}for(var s=["g","i","m","y"],u="";!this.isFinished()&&s.indexOf(this.current())!==-1;)u+=this.current(),this.forward();return O2(yB,{body:i,flags:u},l,t)}if(Sj.indexOf(r)!==-1){this.forward();var a,c=["==","===","!=","!==","<=",">=","//","**"],f=r+this.current();switch(ke.indexOf(c,f)!==-1&&(this.forward(),ke.indexOf(c,(r=f)+this.current())!==-1)&&(r=f+this.current(),this.forward()),r){case"(":a=tB;break;case")":a=rB;break;case"[":a=iB;break;case"]":a=sB;break;case"{":a=uB;break;case"}":a=aB;break;case",":a=cB;break;case":":a=fB;break;case"~":a=pB;break;case"|":a=dB;break;default:a=oB}return O2(a,r,l,t)}if((h=this._extractUntil(Tj+Sj)).match(/^[-+]?[0-9]+$/))return this.current()==="."?(this.forward(),c=this._extract("0123456789"),O2(hB,h+"."+c,l,t)):O2("int",h,l,t);if(h.match(/^(true|false)$/))return O2(mB,h,l,t);if(h==="none"||h==="null")return O2(P_,h,l,t);if(h)return O2(gB,h,l,t);throw new Error("Unexpected value while parsing: "+h)}var p,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(h=(h=this._extractString(this.tags.BLOCK_START+"-"))||this._extractString(this.tags.BLOCK_START))return this.in_code=!0,O2(QU,h,l,t);if(h=(h=this._extractString(this.tags.VARIABLE_START+"-"))||this._extractString(this.tags.VARIABLE_START))return this.in_code=!0,O2(eB,h,l,t);var h="",g=!1;for(this._matches(this.tags.COMMENT_START)&&(g=!0,h=this._extractString(this.tags.COMMENT_START));(p=this._extractUntil(m))!==null;){if(h+=p,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!g){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&0<this.colno&&this.colno<=h.length){var _=h.slice(-this.colno);if(/^\s+$/.test(_)&&!(h=h.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!g)throw new Error("unexpected end of comment");h+=this._extractString(this.tags.COMMENT_END);break}h+=this.current(),this.forward()}if(p===null&&g)throw new Error("expected end of comment, got end of file");return O2(g?lB:JU,h,l,t)},e._parseString=function(l){this.forward();for(var t="";!this.isFinished()&&this.current()!==l;){var r=this.current();if(r==="\\")switch(this.forward(),this.current()){case"n":t+=`
2024-05-07 17:30:00 +08:00
`;break;case"t":t+=" ";break;case"r":t+="\r";break;default:t+=this.current()}else t+=r;this.forward()}return this.forward(),t},e._matches=function(l){return this.index+l.length>this.len?null:this.str.slice(this.index,this.index+l.length)===l},e._extractString=function(l){return this._matches(l)?(this.forwardN(l.length),l):null},e._extractUntil=function(l){return this._extractMatching(!0,l||"")},e._extract=function(l){return this._extractMatching(!1,l)},e._extractMatching=function(l,t){if(this.isFinished())return null;var r=t.indexOf(this.current());if(l&&r===-1||!l&&r!==-1){var i=this.current();this.forward();for(var s=t.indexOf(this.current());(l&&s===-1||!l&&s!==-1)&&!this.isFinished();)i+=this.current(),this.forward(),s=t.indexOf(this.current());return i}return""},e._extractRegex=function(l){return(l=this.currentStr().match(l))?(this.forwardN(l[0].length),l):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(l){for(var t=0;t<l;t++)this.forward()},e.forward=function(){this.index++,this.previous()===`
`?(this.lineno++,this.colno=0):this.colno++},e.backN=function(l){for(var t=0;t<l;t++)this.back()},e.back=function(){var l;this.index--,this.current()===`
`?(this.lineno--,l=this.src.lastIndexOf(`
2024-05-23 19:28:35 +08:00
`,this.index-1),this.colno=l===-1?this.index:this.index-l):this.colno--},e.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},e.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},e.previous=function(){return this.str.charAt(this.index-1)},n}(),Me={lex:function(n,e){return new Ode(n,e)},TOKEN_STRING:KU,TOKEN_WHITESPACE:YU,TOKEN_DATA:JU,TOKEN_BLOCK_START:QU,TOKEN_BLOCK_END:ZU,TOKEN_VARIABLE_START:eB,TOKEN_VARIABLE_END:nB,TOKEN_COMMENT:lB,TOKEN_LEFT_PAREN:tB,TOKEN_RIGHT_PAREN:rB,TOKEN_LEFT_BRACKET:iB,TOKEN_RIGHT_BRACKET:sB,TOKEN_LEFT_CURLY:uB,TOKEN_RIGHT_CURLY:aB,TOKEN_OPERATOR:oB,TOKEN_COMMA:cB,TOKEN_COLON:fB,TOKEN_TILDE:pB,TOKEN_PIPE:dB,TOKEN_INT:"int",TOKEN_FLOAT:hB,TOKEN_BOOLEAN:mB,TOKEN_NONE:P_,TOKEN_SYMBOL:gB,TOKEN_SPECIAL:"special",TOKEN_REGEX:yB};function xj(n,e){for(var l,t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,typeof(l=function(i){if(typeof i!="object"||i===null)return i;var s=i[Symbol.toPrimitive];if(s===void 0)return String(i);if(typeof(s=s.call(i,"string"))!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}(r.key))=="symbol"?l:String(l),r)}}function Y_(n,e,l){return e&&xj(n.prototype,e),l&&xj(n,l),Object.defineProperty(n,"prototype",{writable:!1}),n}function vB(n,e){n.prototype=Object.create(e.prototype),_B(n.prototype.constructor=n,e)}function _B(n,e){return(_B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,t){return l.__proto__=t,l})(n,e)}function EB(n,e,l){l=l||{},ke.keys(l).forEach(function(r){l[r]=function(i,s){return typeof i!="function"||typeof s!="function"?s:function(){var u=this.parent,a=(this.parent=i,s.apply(this,arguments));return this.parent=u,a}}(n.prototype[r],l[r])});var t=function(r){function i(){return r.apply(this,arguments)||this}return vB(i,r),Y_(i,[{key:"typename",get:function(){return e}}]),i}(n);return ke._assign(t.prototype,l),t}var Nde=function(){function n(){this.init.apply(this,arguments)}return n.prototype.init=function(){},n.extend=function(e,l){return typeof e=="object"&&(l=e,e="anonymous"),EB(this,e,l)},Y_(n,[{key:"typename",get:function(){return this.constructor.name}}]),n}(),Ide=function(n){function e(){var l;return(l=n.call(this)||this).init.apply(l,arguments),l}return vB(e,n),e.prototype.init=function(){},e.extend=function(l,t){return typeof l=="object"&&(t=l,l="anonymous"),EB(this,l,t)},Y_(e,[{key:"typename",get:function(){return this.constructor.name}}]),e}(El),l4={Obj:Nde,EmitterObj:Ide};function Aj(n,e){for(var l,t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,typeof(l=function(i){if(typeof i!="object"||i===null)return i;var s=i[Symbol.toPrimitive];if(s===void 0)return String(i);if(typeof(s=s.call(i,"string"))!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}(r.key))=="symbol"?l:String(l),r)}}function J_(n,e,l){return e&&Aj(n.prototype,e),l&&Aj(n,l),Object.defineProperty(n,"prototype",{writable:!1}),n}function J7(n,e){n.prototype=Object.create(e.prototype),bB(n.prototype.constructor=n,e)}function bB(n,e){return(bB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,t){return l.__proto__=t,l})(n,e)}function wj(n,e,l){n instanceof e&&l.push(n),n instanceof Rl&&n.findAll(e,l)}var Rl=function(n){function e(){return n.apply(this,arguments)||this}J7(e,n);var l=e.prototype;return l.init=function(t,r){for(var i=arguments,s=this,u=arguments.length,a=new Array(2<u?u-2:0),c=2;c<u;c++)a[c-2]=arguments[c];this.lineno=t,this.colno=r,this.fields.forEach(function(f,p){s[f]=p=(p=i[p+2])===void 0?null:p})},l.findAll=function(t,r){var i=this;return r=r||[],this instanceof Dr?this.children.forEach(function(s){return wj(s,t,r)}):this.fields.forEach(function(s){return wj(i[s],t,r)}),r},l.iterFields=function(t){var r=this;this.fields.forEach(function(i){t(r[i],i)})},e}(l4.Obj),Q_=function(n){function e(){return n.apply(this,arguments)||this}return J7(e,n),J_(e,[{key:"ty
2024-05-07 17:30:00 +08:00
`);t.forEach(function(r,i){r&&(l&&0<i||!l)&&process.stdout.write(" ".repeat(e)),i=i===t.length-1?"":`
2024-05-23 19:28:35 +08:00
`,process.stdout.write(r+i)})}var z={Node:Rl,Root:Cde,NodeList:Dr,Value:Q_,Literal:TB,Symbol:kde,Group:Pde,Array:Dde,Pair:Lde,Dict:SB,Output:Zde,Capture:ehe,TemplateData:nhe,If:xB,IfAsync:Mde,InlineIf:$de,For:Z_,AsyncEach:jde,AsyncAll:Ude,Macro:AB,Caller:Bde,Import:Hde,FromImport:qde,FunCall:wB,Filter:RB,FilterAsync:Vde,KeywordArgs:zde,Block:Gde,Super:Xde,Extends:Wde,Include:Kde,Set:Yde,Switch:Jde,Case:Qde,LookupVal:Fde,BinOp:l3,In:lhe,Is:the,Or:rhe,And:ihe,Not:she,Add:uhe,Concat:ahe,Sub:ohe,Mul:che,Div:fhe,FloorDiv:phe,Mod:dhe,Pow:hhe,Neg:mhe,Pos:ghe,Compare:yhe,CompareOperand:vhe,CallExtension:D_,CallExtensionAsync:_he,printNodes:function n(e,l){var t,r;l=l||0,Fo(e.typename+": ",l),e instanceof Dr?(Fo(`
`),e.children.forEach(function(i){n(i,l+2)})):e instanceof D_?(Fo(e.extName+"."+e.prop+`
`),e.args&&n(e.args,l+2),e.contentArgs&&e.contentArgs.forEach(function(i){n(i,l+2)})):(t=[],r=null,e.iterFields(function(i,s){i instanceof Rl?t.push([s,i]):(r=r||{})[s]=i}),r?Fo(JSON.stringify(r,null,2)+`
`,null,!0):Fo(`
`),t.forEach(function(u){var s=u[0],u=u[1];Fo("["+s+"] =>",l+2),n(u,l+4)}))}};function OB(n,e){return(OB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,t){return l.__proto__=t,l})(n,e)}z.Node,z.Root,z.NodeList,z.Value,z.Literal,z.Group,z.Pair,z.Dict,z.Output,z.Capture,z.TemplateData,z.If,z.IfAsync,z.InlineIf,z.For,z.AsyncEach,z.AsyncAll,z.Macro,z.Caller,z.Import,z.FromImport,z.FunCall,z.Filter,z.FilterAsync,z.KeywordArgs,z.Block,z.Super,z.Extends,z.Include,z.Switch,z.Case,z.LookupVal,z.BinOp,z.In,z.Is,z.Or,z.And,z.Not,z.Add,z.Concat,z.Sub,z.Mul,z.Div,z.FloorDiv,z.Mod,z.Pow,z.Neg,z.Pos,z.Compare,z.CompareOperand,z.CallExtension,z.CallExtensionAsync,z.printNodes;var Rj=function(n){var e;function l(){return n.apply(this,arguments)||this}e=n,(t=l).prototype=Object.create(e.prototype),OB(t.prototype.constructor=t,e);var t=l.prototype;return t.init=function(r){this.tokens=r,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},t.nextToken=function(r){var i;if(this.peeked){if(r||this.peeked.type!==Me.TOKEN_WHITESPACE)return i=this.peeked,this.peeked=null,i;this.peeked=null}if(i=this.tokens.nextToken(),!r)for(;i&&i.type===Me.TOKEN_WHITESPACE;)i=this.tokens.nextToken();return i},t.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},t.pushToken=function(r){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=r},t.error=function(r,i,s){var u;return i!==void 0&&s!==void 0||(i=(u=this.peekToken()||{}).lineno,s=u.colno),i!==void 0&&(i+=1),s!==void 0&&(s+=1),new ke.TemplateError(r,i,s)},t.fail=function(r,i,s){throw this.error(r,i,s)},t.skip=function(r){var i=this.nextToken();return!(!i||i.type!==r)||(this.pushToken(i),!1)},t.expect=function(r){var i=this.nextToken();return i.type!==r&&this.fail("expected "+r+", got "+i.type,i.lineno,i.colno),i},t.skipValue=function(r,i){var s=this.nextToken();return!(!s||s.type!==r||s.value!==i)||(this.pushToken(s),!1)},t.skipSymbol=function(r){return this.skipValue(Me.TOKEN_SYMBOL,r)},t.advanceAfterBlockEnd=function(r){var i;return r||((i=this.peekToken())||this.fail("unexpected end of file"),i.type!==Me.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),r=this.nextToken().value),(i=this.nextToken())&&i.type===Me.TOKEN_BLOCK_END?i.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+r+" statement"),i},t.advanceAfterVariableEnd=function(){var r=this.nextToken();r&&r.type===Me.TOKEN_VARIABLE_END?this.dropLeadingWhitespace=r.value.charAt(r.value.length-this.tokens.tags.VARIABLE_END.length-1)==="-":(this.pushToken(r),this.fail("expected variable end"))},t.parseFor=function(){var r,i,s=this.peekToken();if(this.skipSymbol("for")?(r=new z.For(s.lineno,s.colno),i="endfor"):this.skipSymbol("asyncEach")?(r=new z.AsyncEach(s.lineno,s.colno),i="endeach"):this.skipSymbol("asyncAll")?(r=new z.AsyncAll(s.lineno,s.colno),i="endall"):this.fail("parseFor: expected for{Async}",s.lineno,s.colno),r.name=this.parsePrimary(),r.name instanceof z.Symbol||this.fail("parseFor: variable name expected for loop"),this.peekToken().type===Me.TOKEN_COMMA){var u=r.name;for(r.name=new z.Array(u.lineno,u.colno),r.name.addChild(u);this.skip(Me.TOKEN_COMMA);){var a=this.parsePrimary();r.name.addChild(a)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',s.lineno,s.colno),r.arr=this.parseExpression(),this.advanceAfterBlockEnd(s.value),r.body=this.parseUntilBlocks(i,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),r.else_=this.parseUntilBlocks(i)),this.advanceAfterBlockEnd(),r},t.parseMacro=function(){var r=this.peekToken(),s=(this.skipSymbol("macro")||this.fail("expected macro"),this.parsePrimary(!0)),i=this.parseSignature(),s=new z.Macro(r.lineno,r.colno,s,i);return this.advanceAfterBlockEnd(r.value),s.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),s},t.parseCall=function(){var r=this.peekToken(),a=(this.skipSymbol("call")||this.fail("expected call"),this.
2024-05-07 17:30:00 +08:00
`)},t._emitLines=function(){for(var r=this,i=arguments.length,s=new Array(i),u=0;u<i;u++)s[u]=arguments[u];s.forEach(function(a){return r._emitLine(a)})},t._emitFuncBegin=function(r,i){this.buffer="output",this._scopeClosers="",this._emitLine("function "+i+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+r.lineno+";"),this._emitLine("var colno = "+r.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},t._emitFuncEnd=function(r){r||this._emitLine("cb(null, "+this.buffer+");"),this._closeScopeLevels(),this._emitLine("} catch (e) {"),this._emitLine(" cb(runtime.handleError(e, lineno, colno));"),this._emitLine("}"),this._emitLine("}"),this.buffer=null},t._addScopeLevel=function(){this._scopeClosers+="})"},t._closeScopeLevels=function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},t._withScopedSyntax=function(r){var i=this._scopeClosers;this._scopeClosers="",r.call(this),this._closeScopeLevels(),this._scopeClosers=i},t._makeCallback=function(r){var i=this._tmpid();return"function("+i+(r?","+r:"")+`) {
2024-05-23 19:28:35 +08:00
if(`+i+") { cb("+i+"); return; }"},t._tmpid=function(){return this.lastId++,"t_"+this.lastId},t._templateName=function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},t._compileChildren=function(r,i){var s=this;r.children.forEach(function(u){s.compile(u,i)})},t._compileAggregate=function(r,i,s,u){var a=this;s&&this._emit(s),r.children.forEach(function(c,f){0<f&&a._emit(","),a.compile(c,i)}),u&&this._emit(u)},t._compileExpression=function(r,i){this.assertType(r,z.Literal,z.Symbol,z.Group,z.Array,z.Dict,z.FunCall,z.Caller,z.Filter,z.LookupVal,z.Compare,z.InlineIf,z.In,z.Is,z.And,z.Or,z.Not,z.Add,z.Concat,z.Sub,z.Mul,z.Div,z.FloorDiv,z.Mod,z.Pow,z.Neg,z.Pos,z.Compare,z.NodeList),this.compile(r,i)},t.assertType=function(r){for(var i=arguments.length,s=new Array(1<i?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];s.some(function(a){return r instanceof a})||this.fail("assertType: invalid type: "+r.typename,r.lineno,r.colno)},t.compileCallExtension=function(r,i,s){var u=this,a=r.args,c=r.contentArgs,f=typeof r.autoescape!="boolean"||r.autoescape;s||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+r.extName+'")["'+r.prop+'"]('),this._emit("context"),(a||c)&&this._emit(","),a&&(a instanceof z.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),a.children.forEach(function(p,m){u._compileExpression(p,i),m===a.children.length-1&&!c.length||u._emit(",")})),c.length&&c.forEach(function(p,m){var h;0<m&&u._emit(","),p?(u._emitLine("function(cb) {"),u._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}"),h=u._pushBuffer(),u._withScopedSyntax(function(){u.compile(p,i),u._emitLine("cb(null, "+h+");")}),u._popBuffer(),u._emitLine("return "+h+";"),u._emitLine("}")):u._emit("null")}),s?(r=this._tmpid(),this._emitLine(", "+this._makeCallback(r)),this._emitLine(this.buffer+" += runtime.suppressValue("+r+", "+f+" && env.opts.autoescape);"),this._addScopeLevel()):(this._emit(")"),this._emit(", "+f+` && env.opts.autoescape);
`))},t.compileCallExtensionAsync=function(r,i){this.compileCallExtension(r,i,!0)},t.compileNodeList=function(r,i){this._compileChildren(r,i)},t.compileLiteral=function(r){var i;typeof r.value=="string"?(i=(i=(i=(i=(i=(i=r.value.replace(/\\/g,"\\\\")).replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+i+'"')):r.value===null?this._emit("null"):this._emit(r.value.toString())},t.compileSymbol=function(r,i){r=r.value,(i=i.lookup(r))?this._emit(i):this._emit('runtime.contextOrFrameLookup(context, frame, "'+r+'")')},t.compileGroup=function(r,i){this._compileAggregate(r,i,"(",")")},t.compileArray=function(r,i){this._compileAggregate(r,i,"[","]")},t.compileDict=function(r,i){this._compileAggregate(r,i,"{","}")},t.compilePair=function(u,i){var s=u.key,u=u.value;s instanceof z.Symbol?s=new z.Literal(s.lineno,s.colno,s.value):s instanceof z.Literal&&typeof s.value=="string"||this.fail("compilePair: Dict keys must be strings or names",s.lineno,s.colno),this.compile(s,i),this._emit(": "),this._compileExpression(u,i)},t.compileInlineIf=function(r,i){this._emit("("),this.compile(r.cond,i),this._emit("?"),this.compile(r.body,i),this._emit(":"),r.else_!==null?this.compile(r.else_,i):this._emit('""'),this._emit(")")},t.compileIn=function(r,i){this._emit("runtime.inOperator("),this.compile(r.left,i),this._emit(","),this.compile(r.right,i),this._emit(")")},t.compileIs=function(r,i){var s=(r.right.name||r.right).value;this._emit('env.getTest("'+s+'").call(context, '),this.compile(r.left,i),r.right.args&&(this._emit(","),this.compile(r.right.args,i)),this._emit(") === true")},t._binOpEmitter=function(r,i,s){this.compile(r.left,i),this._emit(s),this.compile(r.right,i)},t.compileOr=function(r,i){return this._binOpEmitter(r,i," || ")},t.compileAnd=function(r,i){return this._binOpEmitter(r,i," && ")},t.compileAdd=function(r,i){return this._binOpEmitter(r,i," + ")},t.compileConcat=function(r,i){return this._binOpEmitter(r,i,' + "" + ')},t.compileSub=function(r,i){return this._binOpEmitter(r,i," - ")},t.compileMul=function(r,i){return this._binOpEmitter(r,i," * ")},t.compileDiv=function(r,i){return this._binOpEmitter(r,i," / ")},t.compileMod=function(r,i){return this._binOpEmitter(r,i," % ")},t.compileNot=function(r,i){this._emit("!"),this.compile(r.target,i)},t.compileFloorDiv=function(r,i){this._emit("Math.floor("),this.compile(r.left,i),this._emit(" / "),this.compile(r.right,i),this._emit(")")},t.compilePow=function(r,i){this._emit("Math.pow("),this.compile(r.left,i),this._emit(", "),this.compile(r.right,i),this._emit(")")},t.compileNeg=function(r,i){this._emit("-"),this.compile(r.target,i)},t.compilePos=function(r,i){this._emit("+"),this.compile(r.target,i)},t.compileCompare=function(r,i){var s=this;this.compile(r.expr,i),r.ops.forEach(function(u){s._emit(" "+Rhe[u.type]+" "),s.compile(u.expr,i)})},t.compileLookupVal=function(r,i){this._emit("runtime.memberLookup(("),this._compileExpression(r.target,i),this._emit("),"),this._compileExpression(r.val,i),this._emit(")")},t._getNodeName=function(r){switch(r.typename){case"Symbol":return r.value;case"FunCall":return"the return value of ("+this._getNodeName(r.name)+")";case"LookupVal":return this._getNodeName(r.target)+'["'+this._getNodeName(r.val)+'"]';case"Literal":return r.value.toString();default:return"--expression--"}},t.compileFunCall=function(r,i){this._emit("(lineno = "+r.lineno+", colno = "+r.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(r.name,i),this._emit(', "'+this._getNodeName(r.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(r.args,i,"[","])"),this._emit(")")},t.compileFilter=function(r,i){var s=r.name;this.assertType(s,z.Symbol),this._emit('env.getFilter("'+s.value+'").call(context, '),this._compileAggregate(r.args,i),this._emit(")")},t.compileFilterAsync=function(r,i){var s=r.name,u=r.symbol.value;this.assertType(s,z.Symbol),i.set(u,u),this._emit('env.getFilter("'+s.value+'").call(context, '),this._compileAggregate(r.args,i),this._emitLine(", "+this._makeCallback(u)
2024-05-07 17:30:00 +08:00
else {`),this._withScopedSyntax(function(){u.compile(r.else_,i),s&&u._emit("cb()")})):s&&(this._emitLine(`}
2024-05-23 19:28:35 +08:00
else {`),this._emit("cb()")),this._emitLine("}")},t.compileIfAsync=function(r,i){this._emit("(function(cb) {"),this.compileIf(r,i,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},t._emitLoopBindings=function(r,i,s,u){var a=this;[{name:"index",val:s+" + 1"},{name:"index0",val:s},{name:"revindex",val:u+" - "+s},{name:"revindex0",val:u+" - "+s+" - 1"},{name:"first",val:s+" === 0"},{name:"last",val:s+" === "+u+" - 1"},{name:"length",val:u}].forEach(function(c){a._emitLine('frame.set("loop.'+c.name+'", '+c.val+");")})},t.compileFor=function(r,i){var s,u,a,c,f=this,p=this._tmpid(),m=this._tmpid(),h=this._tmpid();i=i.push(),this._emitLine("frame = frame.push();"),this._emit("var "+h+" = "),this._compileExpression(r.arr,i),this._emitLine(";"),this._emit("if("+h+") {"),this._emitLine(h+" = runtime.fromIterator("+h+");"),r.name instanceof z.Array?(this._emitLine("var "+p+";"),this._emitLine("if(runtime.isArray("+h+")) {"),this._emitLine("var "+m+" = "+h+".length;"),this._emitLine("for("+p+"=0; "+p+" < "+h+".length; "+p+"++) {"),r.name.children.forEach(function(g,_){var S=f._tmpid();f._emitLine("var "+S+" = "+h+"["+p+"]["+_+"];"),f._emitLine('frame.set("'+g+'", '+h+"["+p+"]["+_+"]);"),i.set(r.name.children[_].value,S)}),this._emitLoopBindings(r,h,p,m),this._withScopedSyntax(function(){f.compile(r.body,i)}),this._emitLine("}"),this._emitLine("} else {"),c=(s=r.name.children)[0],s=s[1],u=this._tmpid(),a=this._tmpid(),i.set(c.value,u),i.set(s.value,a),this._emitLine(p+" = -1;"),this._emitLine("var "+m+" = runtime.keys("+h+").length;"),this._emitLine("for(var "+u+" in "+h+") {"),this._emitLine(p+"++;"),this._emitLine("var "+a+" = "+h+"["+u+"];"),this._emitLine('frame.set("'+c.value+'", '+u+");"),this._emitLine('frame.set("'+s.value+'", '+a+");"),this._emitLoopBindings(r,h,p,m),this._withScopedSyntax(function(){f.compile(r.body,i)}),this._emitLine("}")):(c=this._tmpid(),i.set(r.name.value,c),this._emitLine("var "+m+" = "+h+".length;"),this._emitLine("for(var "+p+"=0; "+p+" < "+h+".length; "+p+"++) {"),this._emitLine("var "+c+" = "+h+"["+p+"];"),this._emitLine('frame.set("'+r.name.value+'", '+c+");"),this._emitLoopBindings(r,h,p,m),this._withScopedSyntax(function(){f.compile(r.body,i)})),this._emitLine("}"),this._emitLine("}"),r.else_&&(this._emitLine("if (!"+m+") {"),this.compile(r.else_,i),this._emitLine("}")),this._emitLine("frame = frame.pop();")},t._compileAsyncLoop=function(r,i,s){var u,a=this,c=this._tmpid(),f=this._tmpid(),p=this._tmpid(),m=s?"asyncAll":"asyncEach",m=(i=i.push(),this._emitLine("frame = frame.push();"),this._emit("var "+p+" = runtime.fromIterator("),this._compileExpression(r.arr,i),this._emitLine(");"),r.name instanceof z.Array?(u=r.name.children.length,this._emit("runtime."+m+"("+p+", "+u+", function("),r.name.children.forEach(function(h){a._emit(h.value+",")}),this._emit(c+","+f+",next) {"),r.name.children.forEach(function(h){h=h.value,i.set(h,h),a._emitLine('frame.set("'+h+'", '+h+");")})):(u=r.name.value,this._emitLine("runtime."+m+"("+p+", 1, function("+u+", "+c+", "+f+",next) {"),this._emitLine('frame.set("'+u+'", '+u+");"),i.set(u,u)),this._emitLoopBindings(r,p,c,f),this._withScopedSyntax(function(){var h;s&&(h=a._pushBuffer()),a.compile(r.body,i),a._emitLine("next("+c+(h?","+h:"")+");"),s&&a._popBuffer()}),this._tmpid());this._emitLine("}, "+this._makeCallback(m)),this._addScopeLevel(),s&&this._emitLine(this.buffer+" += "+m+";"),r.else_&&(this._emitLine("if (!"+p+".length) {"),this.compile(r.else_,i),this._emitLine("}")),this._emitLine("frame = frame.pop();")},t.compileAsyncEach=function(r,i){this._compileAsyncLoop(r,i)},t.compileAsyncAll=function(r,i){this._compileAsyncLoop(r,i,!0)},t._compileMacro=function(r,_){var s=this,u=[],a=null,c="macro_"+this._tmpid(),f=_!==void 0,p=(r.args.children.forEach(function(S,T){T===r.args.children.length-1&&S instanceof z.Dict?a=S:(s.assertType(S,z.Symbol),u.push(S))}),[].concat(u.map(function(S){return"l_"+S.value}),["kwargs"])),m=u.map(function(S){return'"'+S.value+'"'}),h=(a&&a.children||[]).map(function(S){return'"'+S.key.value+'"'}),g=f?_.push(!0):
`))})},t.compileRoot=function(r,i){var s=this,u=(i&&this.fail("compileRoot: root node can't have frame"),i=new n_,this._emitFuncBegin(r,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(r,i),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,[]);(i=r.findAll(z.Block)).forEach(function(a,c){var f=a.name.value;if(u.indexOf(f)!==-1)throw new Error('Block "'+f+'" defined more than once.');u.push(f),s._emitFuncBegin(a,"b_"+f),f=new n_,s._emitLine("var frame = frame.push(true);"),s.compile(a.body,f),s._emitFuncEnd()}),this._emitLine("return {"),i.forEach(function(a,c){a="b_"+a.name.value,s._emitLine(a+": "+a+",")}),this._emitLine(`root: root
};`)},t.compile=function(r,i){var s=this["compile"+r.typename];s?s.call(this,r,i):this.fail("compile: Cannot compile node: "+r.typename,r.lineno,r.colno)},t.getCode=function(){return this.codebuf.join("")},l}(l4.Obj),Ohe={compile:function(s,e,l,t,r){var i=new Nj(t,(r=r===void 0?{}:r).throwOnUndefined),s=(l||[]).map(function(u){return u.preprocess}).filter(function(u){return!!u}).reduce(function(u,a){return a(u)},s);return i.compile(She.transform(Ehe.parse(s,l,r),e,t)),i.getCode()},Compiler:Nj},Nhe=an(function(n){function e(h,g){return h==null||h===!1?g:h}function l(h){return h!=h}function t(h){var g=(h=e(h,"")).toLowerCase();return on.copySafeness(h,g.charAt(0).toUpperCase()+g.slice(1))}function r(h){if(ke.isString(h))return h.split("");if(ke.isObject(h))return ke._entries(h||{}).map(function(g){return{key:g[0],value:g[1]}});if(ke.isArray(h))return h;throw new ke.TemplateError("list filter: type not iterable")}function i(h){return function(g,_,S){var T=this,x=T.env.getTest(_=_===void 0?"truthy":_);return ke.toArray(g).filter(function(v){return x.call(T,v,S)===h})}}function s(h){return on.copySafeness(h,h.replace(/^\s*|\s*$/g,""))}(n=n.exports={}).abs=Math.abs,n.batch=function(h,g,_){for(var S=[],T=[],x=0;x<h.length;x++)x%g==0&&T.length&&(S.push(T),T=[]),T.push(h[x]);if(T.length){if(_)for(x=T.length;x<g;x++)T.push(_);S.push(T)}return S},n.capitalize=t,n.center=function(h,g){var _;return(h=e(h,"")).length>=(g=g||80)?h:(g-=h.length,_=ke.repeat(" ",g/2-g%2),g=ke.repeat(" ",g/2),on.copySafeness(h,_+h+g))},n.default=function(h,g,_){return _?h||g:h!==void 0?h:g},n.dictsort=function(h,g,_){if(!ke.isObject(h))throw new ke.TemplateError("dictsort filter: val must be an object");var S,T,x=[];for(T in h)x.push([T,h[T]]);if(_===void 0||_==="key")S=0;else{if(_!=="value")throw new ke.TemplateError("dictsort filter: You can only sort by either key or value");S=1}return x.sort(function(v,b){return v=v[S],b=b[S],g||(ke.isString(v)&&(v=v.toUpperCase()),ke.isString(b)&&(b=b.toUpperCase())),b<v?1:v===b?0:-1}),x},n.dump=function(h,g){return JSON.stringify(h,null,g)},n.escape=function(h){return h instanceof on.SafeString?h:on.markSafe(ke.escape((h=h??"").toString()))},n.safe=function(h){return h instanceof on.SafeString?h:on.markSafe((h=h??"").toString())},n.first=function(h){return h[0]},n.forceescape=function(h){return on.markSafe(ke.escape((h=h??"").toString()))},n.groupby=function(h,g){return ke.groupBy(h,g,this.env.opts.throwOnUndefined)},n.indent=function(h,x,_){if((h=e(h,""))==="")return"";x=x||4;var S=h.split(`
2024-04-15 09:41:50 +08:00
`),T=ke.repeat(" ",x),x=S.map(function(v,b){return b!==0||_?""+T+v:v}).join(`
2024-05-23 19:28:35 +08:00
`);return on.copySafeness(h,x)},n.join=function(h,g,_){return g=g||"",(h=_?ke.map(h,function(S){return S[_]}):h).join(g)},n.last=function(h){return h[h.length-1]},n.length=function(h){return(h=e(h,""))!==void 0?typeof Map=="function"&&h instanceof Map||typeof Set=="function"&&h instanceof Set?h.size:(!ke.isObject(h)||h instanceof on.SafeString?h:ke.keys(h)).length:0},n.list=r,n.lower=function(h){return(h=e(h,"")).toLowerCase()},n.nl2br=function(h){return h==null?"":on.copySafeness(h,h.replace(/\r\n|\n/g,`<br />
`))},n.random=function(h){return h[Math.floor(Math.random()*h.length)]},n.reject=i(!1),n.rejectattr=function(h,g){return h.filter(function(_){return!_[g]})},n.select=i(!0),n.selectattr=function(h,g){return h.filter(function(_){return!!_[g]})},n.replace=function(h,g,_,S){var T=h;if(g instanceof RegExp)return h.replace(g,_);S===void 0&&(S=-1);var x="";if(typeof g=="number")g=""+g;else if(typeof g!="string")return h;if(typeof(h=typeof h=="number"?""+h:h)!="string"&&!(h instanceof on.SafeString))return h;if(g==="")return x=_+h.split("").join(_)+_,on.copySafeness(h,x);var v=h.indexOf(g);if(S===0||v===-1)return h;for(var b=0,w=0;-1<v&&(S===-1||w<S);)x+=h.substring(b,v)+_,b=v+g.length,w++,v=h.indexOf(g,b);return b<h.length&&(x+=h.substring(b)),on.copySafeness(T,x)},n.reverse=function(h){var g;return(g=ke.isString(h)?r(h):ke.map(h,function(_){return _})).reverse(),ke.isString(h)?on.copySafeness(h,g.join("")):g},n.round=function(h,g,_){return g=g||0,g=Math.pow(10,g),(_==="ceil"?Math.ceil:_==="floor"?Math.floor:Math.round)(h*g)/g},n.slice=function(h,g,_){for(var S=Math.floor(h.length/g),T=h.length%g,x=[],v=0,b=0;b<g;b++){var w=v+b*S;b<T&&v++,w=h.slice(w,v+(b+1)*S),_&&T<=b&&w.push(_),x.push(w)}return x},n.sum=function(h,g,_){return(_=_===void 0?0:_)+(h=g?ke.map(h,function(S){return S[g]}):h).reduce(function(S,T){return S+T},0)},n.sort=on.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(x,g,_,S){var T=this,x=ke.map(x,function(b){return b}),v=ke.getAttrGetter(S);return x.sort(function(b,w){if(b=S?v(b):b,w=S?v(w):w,T.env.opts.throwOnUndefined&&S&&(b===void 0||w===void 0))throw new TypeError('sort: attribute "'+S+'" resolved to undefined');return!_&&ke.isString(b)&&ke.isString(w)&&(b=b.toLowerCase(),w=w.toLowerCase()),b<w?g?1:-1:w<b?g?-1:1:0}),x}),n.string=function(h){return on.copySafeness(h,h)},n.striptags=function(h,S){var _=s((h=e(h,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,"")),S=S?_.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
2024-04-02 15:03:09 +08:00
`).replace(/\n\n\n+/g,`
2024-05-23 19:28:35 +08:00
`):_.replace(/\s+/gi," ");return on.copySafeness(h,S)},n.title=function(h){var g=(h=e(h,"")).split(" ").map(t);return on.copySafeness(h,g.join(" "))},n.trim=s,n.truncate=function(h,g,_,S){var T=h;return(h=e(h,"")).length<=(g=g||255)?h:(h=_?h.substring(0,g):((_=h.lastIndexOf(" ",g))===-1&&(_=g),h.substring(0,_)),on.copySafeness(T,h+=S??"..."))},n.upper=function(h){return(h=e(h,"")).toUpperCase()},n.urlencode=function(h){var g=encodeURIComponent;return ke.isString(h)?g(h):(ke.isArray(h)?h:ke._entries(h)).map(function(T){var S=T[0],T=T[1];return g(S)+"="+g(T)}).join("&")};var u=/^(?:\(|<|&lt;)?(.*?)(?:\.|,|\)|\n|&gt;)?$/,a=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,c=/^https?:\/\/.*$/,f=/^www\./,p=/\.(?:org|net|com)(?:\:|\/|$)/,m=(n.urlize=function(h,g,_){l(g)&&(g=1/0);var S=_===!0?' rel="nofollow"':"";return h.split(/(\s+)/).filter(function(T){return T&&T.length}).map(function(T){var x=T.match(u),v=(x=x?x[1]:T).substr(0,g);return c.test(x)?'<a href="'+x+'"'+S+">"+v+"</a>":f.test(x)?'<a href="http://'+x+'"'+S+">"+v+"</a>":a.test(x)?'<a href="mailto:'+x+'">'+x+"</a>":p.test(x)?'<a href="http://'+x+'"'+S+">"+v+"</a>":T}).join("")},n.wordcount=function(h){return(h=(h=e(h,""))?h.match(/\w+/g):null)?h.length:null},n.float=function(h,g){return l(h=parseFloat(h))?g:h},on.makeMacro(["value","default","base"],[],function(h,g,_){return _===void 0&&(_=10),l(h=parseInt(h,_))?g:h}));n.int=m,n.d=n.default,n.e=n.escape}),z7={};function PB(n,e){for(var l=0,t=n.length-1;0<=t;t--){var r=n[t];r==="."?n.splice(t,1):r===".."?(n.splice(t,1),l++):l&&(n.splice(t,1),l--)}if(e)for(;l--;)n.unshift("..");return n}var Ihe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l_=function(n){return Ihe.exec(n).slice(1)};function t_(){for(var n="",e=!1,l=arguments.length-1;-1<=l&&!e;l--){var t=0<=l?arguments[l]:"/";if(typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");t&&(n=t+"/"+n,e=t.charAt(0)==="/")}return(e?"/":"")+PB(nE(n.split("/"),function(r){return!!r}),!e).join("/")||"."}function Ij(n){var e=DB(n),l=Che(n,-1)==="/";return(n=(n=PB(nE(n.split("/"),function(t){return!!t}),!e).join("/"))||e?n:".")&&l&&(n+="/"),(e?"/":"")+n}function DB(n){return n.charAt(0)==="/"}var Jo={extname:function(n){return l_(n)[3]},basename:function(n,e){return n=l_(n)[2],e&&n.substr(-1*e.length)===e?n.substr(0,n.length-e.length):n},dirname:function(l){var e=(l=l_(l))[0],l=l[1];return e||l?e+(l&&l.substr(0,l.length-1)):"."},sep:"/",delimiter:":",relative:function(n,e){function l(c){for(var f=0;f<c.length&&c[f]==="";f++);for(var p=c.length-1;0<=p&&c[p]==="";p--);return p<f?[]:c.slice(f,p-f+1)}n=t_(n).substr(1),e=t_(e).substr(1);for(var t=l(n.split("/")),r=l(e.split("/")),i=Math.min(t.length,r.length),s=i,u=0;u<i;u++)if(t[u]!==r[u]){s=u;break}for(var a=[],u=s;u<t.length;u++)a.push("..");return(a=a.concat(r.slice(s))).join("/")},join:function(){return Ij(nE(Array.prototype.slice.call(arguments,0),function(n,e){if(typeof n!="string")throw new TypeError("Arguments to path.join must be strings");return n}).join("/"))},isAbsolute:DB,normalize:Ij,resolve:t_};function nE(n,e){if(n.filter)return n.filter(e);for(var l=[],t=0;t<n.length;t++)e(n[t],t,n)&&l.push(n[t]);return l}var Che="ab".substr(-1)==="b"?function(n,e,l){return n.substr(e,l)}:function(n,e,l){return e<0&&(e=n.length+e),n.substr(e,l)};function LB(n,e){return(LB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,t){return l.__proto__=t,l})(n,e)}var lE=function(n){var e;function l(){return n.apply(this,arguments)||this}e=n,(t=l).prototype=Object.create(e.prototype),LB(t.prototype.constructor=t,e);var t=l.prototype;return t.resolve=function(r,i){return Jo.resolve(Jo.dirname(r),i)},t.isRelative=function(r){return r.indexOf("./")===0||r.indexOf("../")===0},l}(l4.EmitterObj);function FB(n,e){return(FB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,t){return l.__proto__=t,l})(n,e)}var khe=function(n){var e,l;function t(r){var i;return(i=n.call(this)||this).precompiled=r||{},i}return l=n,(e=t).prototype=Object.create(l.prototype),FB(e.prototype.co
2024-04-02 15:03:09 +08:00
/* [wrapped with `+D+`] */
2024-05-23 19:28:35 +08:00
`)):R}(A,function(R,D){return Et(m,function(B){var V="_."+B[0];D&B[1]&&!k3(R,V)&&R.push(V)}),R.sort()}(function(){var R=A.match(C2);return R?R[1].split($l):[]}(),y)))}function ex(o){var d=0,y=0;return function(){var A=GW(),R=16-(A-y);if(y=A,0<R){if(800<=++d)return arguments[0]}else d=0;return o.apply(l,arguments)}}function A6(o,d){var y=-1,A=o.length,R=A-1;for(d=d===l?A:d;++y<d;){var D=Wf(y,R),B=o[D];o[D]=o[y],o[y]=B}return o.length=d,o}var nx=function(){var o=N6(function(y){var A=[];return y.charCodeAt(0)===46&&A.push(""),y.replace(sn,function(R,D,B,V){A.push(B?V.replace(qt,"$1"):D||R)}),A},function(y){return d.size===500&&d.clear(),y}),d=o.cache;return o}();function dr(o){var d;return typeof o=="string"||Q2(o)?o:(d=o+"")=="0"&&1/o==-1/0?"-0":d}function uu(o){if(o!=null){try{return l6.call(o)}catch{}try{return o+""}catch{}}return""}function lx(o){var d;return o instanceof $n?o.clone():((d=new D3(o.__wrapped__,o.__chain__)).__actions__=k2(o.__actions__),d.__index__=o.__index__,d.__values__=o.__values__,d)}function tx(o,d,y){var A=o==null?0:o.length;return A?((y=y==null?0:vn(y))<0&&(y=Tt(A+y,0)),ur(o,nn(d,3),y)):-1}function rx(o,d,y){var A,R=o==null?0:o.length;return R?(A=R-1,y!==l&&(A=vn(y),A=y<0?Tt(R+A,0):t2(A,R-1)),ur(o,nn(d,3),A,!0)):-1}function ix(o){return o!=null&&o.length?zt(o,1):[]}function sx(o){return o&&o.length?o[0]:l}function p3(o){var d=o==null?0:o.length;return d?o[d-1]:l}function ux(o,d){return o&&o.length&&d&&d.length?Xf(o,d):o}Ff=Tn(function(o,d){return it(o)?H4(o,zt(d,1,it,!0)):[]}),cr=Tn(function(o,d){var y=p3(d);return it(y)&&(y=l),it(o)?H4(o,zt(d,1,it,!0),nn(y,2)):[]}),$4=Tn(function(o,d){var y=p3(d);return it(y)&&(y=l),it(o)?H4(o,zt(d,1,it,!0),l,y):[]}),Vn=Tn(function(o){var d=Zn(o,Zf);return d.length&&d[0]===o[0]?qf(d):[]}),Ta=Tn(function(o){var d=p3(o),y=Zn(o,Zf);return d===p3(y)?d=l:y.pop(),y.length&&y[0]===o[0]?qf(y,nn(d,2)):[]}),Mf=Tn(function(o){var d=p3(o),y=Zn(o,Zf);return(d=typeof d=="function"?d:l)&&y.pop(),y.length&&y[0]===o[0]?qf(y,l,d):[]}),r2=Tn(ux);var uK=Zr(function(o,d){var y=o==null?0:o.length,A=jf(o,d);return ES(o,Zn(d,function(R){return ei(R,y)?+R:R}).sort(IS)),A});function dp(o){return o==null?o:WW.call(o)}var aK=Tn(function(o){return Di(zt(o,1,it,!0))}),oK=Tn(function(o){var d=p3(o);return it(d)&&(d=l),Di(zt(o,1,it,!0),nn(d,2))}),cK=Tn(function(o){var d=typeof(d=p3(o))=="function"?d:l;return Di(zt(o,1,it,!0),l,d)});function hp(o){var d;return o&&o.length?(d=0,o=Dt(o,function(y){if(it(y))return d=Tt(y.length,d),!0}),Y5(d,function(y){return Zn(o,ar(y))})):[]}function ax(o,d){return o&&o.length?(o=hp(o),d==null?o:Zn(o,function(y){return Pt(d,l,y)})):[]}var fK=Tn(function(o,d){return it(o)?H4(o,d):[]}),pK=Tn(function(o){return Qf(Dt(o,it))}),dK=Tn(function(o){var d=p3(o);return it(d)&&(d=l),Qf(Dt(o,it),nn(d,2))}),hK=Tn(function(o){var d=typeof(d=p3(o))=="function"?d:l;return Qf(Dt(o,it),l,d)}),mK=Tn(hp),gK=Tn(function(o){var d=typeof(d=1<(d=o.length)?o[d-1]:l)=="function"?(o.pop(),d):l;return ax(o,d)});function ox(o){return(o=I(o)).__chain__=!0,o}function w6(o,d){return d(o)}var yK=Zr(function(o){function d(D){return jf(D,o)}var y=o.length,A=y?o[0]:0,R=this.__wrapped__;return!(1<y||this.__actions__.length)&&R instanceof $n&&ei(A)?((R=R.slice(A,+A+(y?1:0))).__actions__.push({func:w6,args:[d],thisArg:l}),new D3(R,this.__chain__).thru(function(D){return y&&!D.length&&D.push(l),D})):this.thru(d)}),vK=v6(function(o,d,y){yl.call(o,y)?++o[y]:Jr(o,y,1)}),_K=FS(tx),EK=FS(rx);function cx(o,d){return(gn(o)?Et:Pi)(o,nn(d,3))}function fx(o,d){return(gn(o)?function(y,A){for(var R=y==null?0:y.length;R--&&A(y[R],R,y)!==!1;);return y}:uS)(o,nn(d,3))}var bK=v6(function(o,d,y){yl.call(o,y)?o[y].push(d):Jr(o,y,[d])}),TK=Tn(function(o,d,y){var A=-1,R=typeof d=="function",D=P2(o)?fe(o.length):[];return Pi(o,function(B){D[++A]=R?Pt(d,B,y):q4(B,d,y)}),D}),SK=v6(function(o,d,y){Jr(o,y,d)});function R6(o,d){return(gn(o)?Zn:hS)(o,nn(d,3))}var xK=v6(function(o,d,y){o[y?0:1].push(d)},function(){return[[],[]]}),AK=Tn(function(o,d){var y;return o==null?[]:(1<(y=d.length)&&b2(o,d[0],d[1])?d=[]:2<y&&b2(d[0],d[1]
`;if(o.replace(oe,function(Ee,ye,Se,We,Oe,Ie){return Se=Se||We,ae+=o.slice(V,Ie).replace(mt,zT),ye&&(A=!0,ae+=`' +
2024-05-22 10:56:27 +08:00
__e(`+ye+`) +
2024-05-23 19:28:35 +08:00
'`),Oe&&(R=!0,ae+=`';
2024-05-22 10:56:27 +08:00
`+Oe+`;
2024-05-07 17:30:00 +08:00
__p += '`),Se&&(ae+=`' +
2024-04-23 12:29:20 +08:00
((__t = (`+Se+`)) == null ? '' : __t) +
2024-05-13 09:18:33 +08:00
'`),V=Ie+Ee.length,Ee}),ae+=`';
2024-05-23 19:28:35 +08:00
`,K=yl.call(d,"variable")&&d.variable){if(Kl.test(K))throw new Ye("Invalid `variable` option passed into `_.template`")}else ae=`with (obj) {
2024-05-07 17:30:00 +08:00
`+ae+`
2024-04-02 15:03:09 +08:00
}
2024-05-23 19:28:35 +08:00
`;if(ae=(R?ae.replace(Rn,""):ae).replace(Ge,"$1").replace(Hn,"$1;"),ae="function("+(K||"obj")+`) {
2024-04-23 12:29:20 +08:00
`+(K?"":`obj || (obj = {});
2024-05-23 19:28:35 +08:00
`)+"var __t, __p = ''"+(A?", __e = _.escape":"")+(R?`, __j = Array.prototype.join;
2024-04-02 15:03:09 +08:00
function print() { __p += __j.call(arguments, '') }
`:`;
2024-05-07 17:30:00 +08:00
`)+ae+`return __p
2024-05-23 19:28:35 +08:00
}`,(oe=kx(function(){return mn(D,xe+"return "+ae).apply(l,B)})).source=ae,_p(oe))throw oe;return oe},I.times=function(o,d){if((o=vn(o))<1||c<o)return[];var y=p,A=t2(o,p);for(d=nn(d),o-=p,A=Y5(A,d);++y<o;)d(y);return A},I.toFinite=li,I.toInteger=vn,I.toLength=Tx,I.toLower=function(o){return il(o).toLowerCase()},I.toNumber=h3,I.toSafeInteger=function(o){return o?ru(vn(o),-9007199254740991,c):o===0?o:0},I.toString=il,I.toUpper=function(o){return il(o).toUpperCase()},I.trim=function(o,d,y){return(o=il(o))&&(y||d===l)?Xr(o):o&&(d=J2(d))?Fi(y=P3(o),J5(y,d=P3(d)),Q5(y,d)+1).join(""):o},I.trimEnd=function(o,d,y){return(o=il(o))&&(y||d===l)?o.slice(0,GT(o)+1):o&&(d=J2(d))?Fi(y=P3(o),0,Q5(y,P3(d))+1).join(""):o},I.trimStart=function(o,d,y){return(o=il(o))&&(y||d===l)?o.replace(Wl,""):o&&(d=J2(d))?Fi(y=P3(o),J5(y,P3(d))).join(""):o},I.truncate=function(o,R){var y,B=30,A="...",R=(ql(R)&&(y="separator"in R?R.separator:y,B="length"in R?vn(R.length):B,A="omission"in R?J2(R.omission):A),(o=il(o)).length);if((R=Zs(o)?(D=P3(o)).length:R)<=B)return o;if((R=B-_a(A))<1)return A;var D,B=D?Fi(D,0,R).join(""):o.slice(0,R);if(y!==l)if(D&&(R+=B.length-R),Ep(y)){if(o.slice(R).search(y)){var V,K=B;for((y=y.global?y:eu(y.source,il(i3.exec(y))+"g")).lastIndex=0;V=y.exec(K);)var ae=V.index;B=B.slice(0,ae===l?R:ae)}}else o.indexOf(J2(y),R)!=R&&-1<(D=B.lastIndexOf(y))&&(B=B.slice(0,D));return B+A},I.unescape=function(o){return(o=il(o))&&bl.test(o)?o.replace(Ke,$W):o},I.uniqueId=function(o){var d=++UW;return il(o)+d},I.upperCase=YK,I.upperFirst=Sp,I.each=cx,I.eachRight=fx,I.first=sx,wp(I,(Ip={},fr(I,function(o,d){yl.call(I.prototype,d)||(Ip[d]=o)}),Ip),{chain:!1}),I.VERSION="4.17.21",Et(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){I[o].placeholder=I}),Et(["drop","take"],function(o,d){$n.prototype[o]=function(y){y=y===l?1:Tt(vn(y),0);var A=this.__filtered__&&!d?new $n(this):this.clone();return A.__filtered__?A.__takeCount__=t2(y,A.__takeCount__):A.__views__.push({size:t2(y,p),type:o+(A.__dir__<0?"Right":"")}),A},$n.prototype[o+"Right"]=function(y){return this.reverse()[o](y).reverse()}}),Et(["filter","map","takeWhile"],function(o,d){var y=d+1,A=y==1||y==3;$n.prototype[o]=function(R){var D=this.clone();return D.__iteratees__.push({iteratee:nn(R,3),type:y}),D.__filtered__=D.__filtered__||A,D}}),Et(["head","last"],function(o,d){var y="take"+(d?"Right":"");$n.prototype[o]=function(){return this[y](1).value()[0]}}),Et(["initial","tail"],function(o,d){var y="drop"+(d?"":"Right");$n.prototype[o]=function(){return this.__filtered__?new $n(this):this[y](1)}}),$n.prototype.compact=function(){return this.filter(L2)},$n.prototype.find=function(o){return this.filter(o).head()},$n.prototype.findLast=function(o){return this.reverse().find(o)},$n.prototype.invokeMap=Tn(function(o,d){return typeof o=="function"?new $n(this):this.map(function(y){return q4(y,o,d)})}),$n.prototype.reject=function(o){return this.filter(I6(nn(o)))},$n.prototype.slice=function(o,d){o=vn(o);var y=this;return y.__filtered__&&(0<o||d<0)?new $n(y):(o<0?y=y.takeRight(-o):o&&(y=y.drop(o)),d!==l?(d=vn(d))<0?y.dropRight(-d):y.take(d-o):y)},$n.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},$n.prototype.toArray=function(){return this.take(p)},fr($n.prototype,function(o,d){var y=/^(?:filter|find|map|reject)|While$/.test(d),A=/^(?:head|last)$/.test(d),R=I[A?"take"+(d=="last"?"Right":""):d],D=A||/^find/.test(d);R&&(I.prototype[d]=function(){function B(We){return We=R.apply(I,sr([We],ae)),A&&xe?We[0]:We}var V,K=this.__wrapped__,ae=A?[1]:arguments,Se=K instanceof $n,Ee=ae[0],oe=Se||gn(K),xe=(oe&&y&&typeof Ee=="function"&&Ee.length!=1&&(Se=oe=!1),this.__chain__),Ee=!!this.__actions__.length,ye=D&&!xe,Se=Se&&!Ee;return!D&&oe?(K=Se?K:new $n(this),(V=o.apply(K,ae)).__actions__.push({func:w6,args:[B],thisArg:l}),new D3(V,xe)):ye&&Se?o.apply(this,ae):(V=this.thru(B),ye?A?V.value()[0]:V.value():V)})}),Et(["pop","push","shift","sort","splice","unshift"],function(o){var d=n6[o],y=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",A=/^(?:pop|shift)$/.test
`)){let a=u.trim();if(a)if(a.startsWith("#")){if(a.startsWith("#EXT")){let c=ame(a,i);c&&s.push(c)}}else s.push(a)}return s.length!==0&&s[0].name==="EXTM3U"||Le("The EXTM3U tag MUST be the first line."),s}(n,e),t=ome(l,e);return t.source=n,t}var cme=["#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"],fme=["#EXT-X-MEDIA"],_E=class extends Array{constructor(e){super(),this.baseUri=e}push(...e){for(let l of e)if(l.startsWith("#"))if(cme.some(t=>l.startsWith(t)))super.push(l);else{if(this.includes(l)){if(fme.some(t=>l.startsWith(t)))continue;Le(`Redundant item (${l})`)}super.push(l)}else super.push(l);return this.length}};function SE(n,e){let l=1e3;e&&(l=Math.pow(10,e));let t=Math.round(n*l)/l;return e?t.toFixed(e):t}function pme(n){let e=[`DATA-ID="${n.id}"`];return n.language&&e.push(`LANGUAGE="${n.language}"`),n.value?e.push(`VALUE="${n.value}"`):n.uri&&e.push(`URI="${n.uri}"`),`#EXT-X-SESSION-DATA:${e.join(",")}`}function cH(n,e){let l=e?"#EXT-X-SESSION-KEY":"#EXT-X-KEY",t=[`METHOD=${n.method}`];return n.uri&&t.push(`URI="${n.uri}"`),n.iv&&(n.iv.length!==16&&Le("IV must be a 128-bit unsigned integer"),t.push(`IV=${uH(n.iv)}`)),n.format&&t.push(`KEYFORMAT="${n.format}"`),n.formatVersion&&t.push(`KEYFORMATVERSIONS="${n.formatVersion}"`),`${l}:${t.join(",")}`}function dme(n,e){let l=e.isIFrameOnly?"#EXT-X-I-FRAME-STREAM-INF":"#EXT-X-STREAM-INF",t=[`BANDWIDTH=${e.bandwidth}`];if(e.averageBandwidth&&t.push(`AVERAGE-BANDWIDTH=${e.averageBandwidth}`),e.isIFrameOnly&&t.push(`URI="${e.uri}"`),e.codecs&&t.push(`CODECS="${e.codecs}"`),e.resolution&&t.push(`RESOLUTION=${e.resolution.width}x${e.resolution.height}`),e.frameRate&&t.push(`FRAME-RATE=${SE(e.frameRate,3)}`),e.hdcpLevel&&t.push(`HDCP-LEVEL=${e.hdcpLevel}`),e.audio.length>0){t.push(`AUDIO="${e.audio[0].groupId}"`);for(let r of e.audio)n.push(Sc(r))}if(e.video.length>0){t.push(`VIDEO="${e.video[0].groupId}"`);for(let r of e.video)n.push(Sc(r))}if(e.subtitles.length>0){t.push(`SUBTITLES="${e.subtitles[0].groupId}"`);for(let r of e.subtitles)n.push(Sc(r))}if(Zhe().allowClosedCaptionsNone&&e.closedCaptions.length===0)t.push("CLOSED-CAPTIONS=NONE");else if(e.closedCaptions.length>0){t.push(`CLOSED-CAPTIONS="${e.closedCaptions[0].groupId}"`);for(let r of e.closedCaptions)n.push(Sc(r))}if(e.score&&t.push(`SCORE=${e.score}`),e.allowedCpc){let r=[];for(let{format:i,cpcList:s}of e.allowedCpc)r.push(`${i}:${s.join("/")}`);t.push(`ALLOWED-CPC="${r.join(",")}"`)}e.videoRange&&t.push(`VIDEO-RANGE=${e.videoRange}`),e.stableVariantId&&t.push(`STABLE-VARIANT-ID="${e.stableVariantId}"`),e.programId&&t.push(`PROGRAM-ID=${e.programId}`),n.push(`${l}:${t.join(",")}`),e.isIFrameOnly||n.push(`${e.uri}`)}function Sc(n){let e=[`TYPE=${n.type}`,`GROUP-ID="${n.groupId}"`,`NAME="${n.name}"`];return n.isDefault!==void 0&&e.push("DEFAULT="+(n.isDefault?"YES":"NO")),n.autoselect!==void 0&&e.push("AUTOSELECT="+(n.autoselect?"YES":"NO")),n.forced!==void 0&&e.push("FORCED="+(n.forced?"YES":"NO")),n.language&&e.push(`LANGUAGE="${n.language}"`),n.assocLanguage&&e.push(`ASSOC-LANGUAGE="${n.assocLanguage}"`),n.instreamId&&e.push(`INSTREAM-ID="${n.instreamId}"`),n.characteristics&&e.push(`CHARACTERISTICS="${n.characteristics}"`),n.channels&&e.push(`CHANNELS="${n.channels}"`),n.uri&&e.push(`URI="${n.uri}"`),`#EXT-X-MEDIA:${e.join(",")}`}function hme(n,e,l,t,r=1,i=null){let s=!1,u="";if(e.discontinuity&&n.push("#EXT-X-DISCONTINUITY"),e.key){let c=cH(e.key);c!==l&&(n.push(c),l=c)}if(e.map){let c=function(f){let p=[`URI="${f.uri}"`];return f.byterange&&p.push(`BYTERANGE="${mE(f.byterange)}"`),`#EXT-X-MAP:${p.join(",")}`}(e.map);c!==t&&(n.push(c),t=c)}if(e.programDateTime&&n.push(`#EXT-X-PROGRAM-DATE-TIME:${hE(e.programDateTime)}`),e.dateRange&&n.push(function(c){let f=[`ID="${c.id}"`];c.start&&f.push(`START-DATE="${hE(c.start)}"`),c.end&&f.push(`END-DATE="${hE(c.end)}"`),c.duration&&f.push(`DURATION=${c.duration}`),c.plannedDuration&&f.push(`PLANNED-DURATION=${c.plannedDuration}`),c.classId&&f.push(`CLASS="${c.classId}"`),c.endOnNext&&
`)}var pH="hls_cache",Mc=[],ea={},d5={},Zu={},Fc="";function mme(n,e){if(Mc.push(n),ea[n]=e,Mc.length>5){let l=Mc.shift();gme(l)}}function gme(n){delete ea[n],delete Mc[n],new JSFile(pH+"/"+n).delete()}function yme(n,e){if(e.variants)for(let l of e.variants)l.uri.startsWith("http")||(l.uri=xE(n,l.uri));if(e.segments)for(let l of e.segments)l.uri.startsWith("http")||(l.uri=xE(n,l.uri)),l.key&&l.key.uri&&!l.key.uri.startsWith("http")&&(l.key.uri=xE(n,l.key.uri));return e}async function dH(n,e){let l=md5X(n);if(ea[l])return ea[l];let t={},r=n;for(;t=await req(r,{headers:e,redirect:0}),t.headers.location;)r=t.headers.location;if(t.code==200){var i=t.content;let s=yme(r,oH(i));return mme(l,{code:t.code,plist:s,key:l,headers:t.headers}),ea[l]}return{}}async function hH(n,e,l){if(!ea[n])return{};let r=ea[n].plist.segments,i=!Zu[n];if(i){Zu[n]={};for(let f of r){let p=md5X(f.uri+f.mediaSequenceNumber.toString());Zu[n][p]={file:pH+"/"+n+"/"+p,uri:f.uri,key:p,index:f.mediaSequenceNumber,order:f.mediaSequenceNumber,state:-1,read:!1}}}for(let f in Zu[n]){let p=Zu[n][f];p.index>=e?p.order=p.index-e:p.order=r.length-e+p.index}i&&vme(n,5,l);let s=r[e],u=md5X(s.uri+s.mediaSequenceNumber.toString()),a=Zu[n][u];if(a.state==1||a.state==-1){let f=new JSFile(a.file);if(await f.exist())return a.state=1,{buffer:3,code:200,headers:{connection:"close","content-type":"video/mp2t"},content:f};a.state=-1}if(a.state==-1&&mH(n,a,l),a.state==0){var c=new JSProxyStream;c.head(200,{connection:"close","content-type":"video/mp2t"});let f=0;return a.read=!0,new Promise(async function(p,m){let h=new JSFile(a.file+".dl");await h.open("r"),async function g(){let _=await h.size();if(_>f){var S=await h.read(_-f,f);await c.write(S),f=_}if(a.state==1||a.state<0){c.done(),await h.close(),await h.delete(),a.read=!1,p();return}setTimeout(g,5)}()}),{buffer:3,content:c}}}async function mH(n,e,l){if(e.state>=0||!d5[n])return;if(e.state=0,await new JSFile(e.file).exist()){e.state=1;return}let t=new JSFile(e.file+".dl");await t.open("w");let r=await req(e.uri,{buffer:3,headers:l,stream:t,timeout:[5e3,1e4]});if(r.error||r.code>=300){await t.close(),e.read||await t.delete(),e.state=-1;return}await t.close(),e.read?await t.copy(e.file):await t.move(e.file),e.state=1}async function vme(n,e,l){Fc&&Fc!=n&&delete d5[Fc],Fc=n,d5[n]=!0;for(let t=0;t<e&&d5[n];t++)new Promise(function(r,i){(async function s(){if(!d5[n]){r();return}let u=de.pickBy(Zu[n],function(c){return c.state==-1}),a=de.minBy(Object.values(u),function(c){return c.order});if(!a){r();return}await mH(n,a,l),setTimeout(s,5)})()})}function xE(n,e){var l=n.split("/"),t=e.split("/");l.pop();for(var r=0;r<t.length;r++)t[r]!="."&&(t[r]==".."?l.pop():l.push(t[r]));return l.join("/")}function gH(n){let e=[];return Array.from(n.danmuku).forEach(l=>{let t=Number(l[0]),r=l[4];e.push(`<d p="${t},1,25,16777215,1659282294,0,8b53b65c,1108899274487246080"><![CDATA[${r}]]></d>`)}),String.raw`<?xml version="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>"}var $c=class{constructor(){this.siteUrl="https://search.youku.com",this.reconnectTimes=0,this.maxReconnectTimes=5,this.jadeLog=new A3(this.getAppName(),"DEBUG")}getAppName(){return"\u5F39\u5E55"}getHeader(){return{"User-Agent":Lr,Referer:this.siteUrl+"/"}}async reconnnect(e,l,t,r,i,s){return await this.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u8BF7\u68C0\u67E5url:"+e+",\u4E24\u79D2\u540E\u91CD\u8BD5"),Z3(2),this.reconnectTimes<this.maxReconnectTimes?(this.reconnectTimes=this.reconnectTimes+1,await this.fetch(e,l,t,r,i,s)):(await this.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u91CD\u8FDE\u5931\u8D25"),null)}async getResponse(e,l,t,r,i,s,u){return u.headers.location!==void 0?r?(await this.jadeLog.debug(`\u8FD4\u56DE\u91CD\u5B9A\u5411\u8FDE\u63A5:${u.headers.location}`),u.headers.location):this.fetch(u.headers.location,l,t,r,i,s):u.content.length>0?(this.reconnectTimes=0,i?{cookie:u.headers["set-cookie"],content:u.cont
`).forEach(function(s){r=s.indexOf(":"),l=s.substring(0,r).trim().toLowerCase(),t=s.substring(r+1).trim(),!(!l||e[l]&&c_e[l])&&(l==="set-cookie"?e[l]?e[l].push(t):e[l]=[t]:e[l]=e[l]?e[l]+", "+t:t)}),e};var Mz=Symbol("internals");function C5(n){return n&&String(n).trim().toLowerCase()}function yf(n){return n===!1||n==null?n:X.isArray(n)?n.map(yf):String(n)}function f_e(n){let e=Object.create(null),l=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,t;for(;t=l.exec(n);)e[t[1]]=t[2];return e}var p_e=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Tb(n,e,l,t,r){if(X.isFunction(t))return t.call(this,e,l);if(r&&(e=l),!!X.isString(e)){if(X.isString(t))return e.indexOf(t)!==-1;if(X.isRegExp(t))return t.test(e)}}function d_e(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,l,t)=>l.toUpperCase()+t)}function h_e(n,e){let l=X.toCamelCase(" "+e);["get","set","has"].forEach(t=>{Object.defineProperty(n,t+l,{value:function(r,i,s){return this[t].call(this,e,r,i,s)},configurable:!0})})}var A4=class{constructor(e){e&&this.set(e)}set(e,l,t){let r=this;function i(u,a,c){let f=C5(a);if(!f)throw new Error("header name must be a non-empty string");let p=X.findKey(r,f);(!p||r[p]===void 0||c===!0||c===void 0&&r[p]!==!1)&&(r[p||a]=yf(u))}let s=(u,a)=>X.forEach(u,(c,f)=>i(c,f,a));return X.isPlainObject(e)||e instanceof this.constructor?s(e,l):X.isString(e)&&(e=e.trim())&&!p_e(e)?s(Fz(e),l):e!=null&&i(l,e,t),this}get(e,l){if(e=C5(e),e){let t=X.findKey(this,e);if(t){let r=this[t];if(!l)return r;if(l===!0)return f_e(r);if(X.isFunction(l))return l.call(this,r,t);if(X.isRegExp(l))return l.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,l){if(e=C5(e),e){let t=X.findKey(this,e);return!!(t&&this[t]!==void 0&&(!l||Tb(this,this[t],t,l)))}return!1}delete(e,l){let t=this,r=!1;function i(s){if(s=C5(s),s){let u=X.findKey(t,s);u&&(!l||Tb(t,t[u],u,l))&&(delete t[u],r=!0)}}return X.isArray(e)?e.forEach(i):i(e),r}clear(e){let l=Object.keys(this),t=l.length,r=!1;for(;t--;){let i=l[t];(!e||Tb(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let l=this,t={};return X.forEach(this,(r,i)=>{let s=X.findKey(t,i);if(s){l[s]=yf(r),delete l[i];return}let u=e?d_e(i):String(i).trim();u!==i&&delete l[i],l[u]=yf(r),t[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let l=Object.create(null);return X.forEach(this,(t,r)=>{t!=null&&t!==!1&&(l[r]=e&&X.isArray(t)?t.join(", "):t)}),l}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,l])=>e+": "+l).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...l){let t=new this(e);return l.forEach(r=>t.set(r)),t}static accessor(e){let t=(this[Mz]=this[Mz]={accessors:{}}).accessors,r=this.prototype;function i(s){let u=C5(s);t[u]||(h_e(r,s),t[u]=!0)}return X.isArray(e)?e.forEach(i):i(e),this}};A4.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);X.reduceDescriptors(A4.prototype,({value:n},e)=>{let l=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(t){this[l]=t}}});X.freezeMethods(A4);var It=A4;function k5(n,e){let l=this||x4,t=e||l,r=It.from(t.headers),i=t.data;return X.forEach(n,function(u){i=u.call(l,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function P5(n){return!!(n&&n.__CANCEL__)}function $z(n,e,l){Fe.call(this,n??"canceled",Fe.ERR_CANCELED,e,l),this.name="CanceledError"}X.inherits($z,Fe,{__CANCEL__:!0});var nr=$z;function As(n,e,l){let t=l.config.validateStatus;!l.status||!t||t(l.status)?n(l):e(new Fe("Request failed with status code "+l.status,[Fe.ERR_BAD_REQUEST,Fe.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))}function Sb(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function xb(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function aa(n,e){return n&&!Sb(e)?xb(n,e):e}var uG=St(Uz(),1),aG=St(require("http"),1),oG=St(require("https"),1),cG=St(require("util"),1),fG=St(Xz(),1),Oi=St(require("zlib"),1);var ca="1.6.7";function j5(n){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}var C_e=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Mb(n,e,l){let t=l&&l.Blob||Nt.classes.Blob,r=j5(n);if(e===void 0&&t&&(e=!0),r==="data"){n=r.length?n.slice(r.length+1):n;let i=C_e.exec(n);if(!i)throw new Fe("Invalid URL",Fe.ERR_INVALID_URL);let s=i[1],u=i[2],a=i[3],c=Buffer.from(decodeURIComponent(a),u?"base64":"utf8");if(e){if(!t)throw new Fe("Blob is not supported",Fe.ERR_NOT_SUPPORT);return new t([c],{type:s})}return c}throw new Fe("Unsupported protocol "+r,Fe.ERR_NOT_SUPPORT)}var fa=St(require("stream"),1);var Kz=St(require("stream"),1);function k_e(n,e){let l=0,t=1e3/e,r=null;return function(s,u){let a=Date.now();if(s||a-l>t)return r&&(clearTimeout(r),r=null),l=a,n.apply(null,u);r||(r=setTimeout(()=>(r=null,l=Date.now(),n.apply(null,u)),t-(a-l)))}}var Wz=k_e;function P_e(n,e){n=n||10;let l=new Array(n),t=new Array(n),r=0,i=0,s;return e=e!==void 0?e:1e3,function(a){let c=Date.now(),f=t[i];s||(s=c),l[r]=a,t[r]=c;let p=i,m=0;for(;p!==r;)m+=l[p++],p=p%n;if(r=(r+1)%n,r===i&&(i=(i+1)%n),c-s<e)return;let h=f&&c-f;return h?Math.round(m*1e3/h):void 0}}var vf=P_e;var _f=Symbol("internals"),$b=class extends Kz.default.Transform{constructor(e){e=X.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(u,a)=>!X.isUndefined(a[u])),super({readableHighWaterMark:e.chunkSize});let l=this,t=this[_f]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},r=vf(t.ticksRate*e.samplesCount,t.timeWindow);this.on("newListener",u=>{u==="progress"&&(t.isCaptured||(t.isCaptured=!0))});let i=0;t.updateProgress=Wz(function(){let a=t.length,c=t.bytesSeen,f=c-i;if(!f||l.destroyed)return;let p=r(f);i=c,process.nextTick(()=>{l.emit("progress",{loaded:c,total:a,progress:a?c/a:void 0,bytes:f,rate:p||void 0,estimated:p&&a&&c<=a?(a-c)/p:void 0})})},t.ticksRate);let s=()=>{t.updateProgress(!0)};this.once("end",s),this.once("error",s)}_read(e){let l=this[_f];return l.onReadCallback&&l.onReadCallback(),super._read(e)}_transform(e,l,t){let r=this,i=this[_f],s=i.maxRate,u=this.readableHighWaterMark,a=i.timeWindow,c=1e3/a,f=s/c,p=i.minChunkSize!==!1?Math.max(i.minChunkSize,f*.01):0;function m(g,_){let S=Buffer.byteLength(g);i.bytesSeen+=S,i.bytes+=S,i.isCaptured&&i.updateProgress(),r.push(g)?process.nextTick(_):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTic
`,F_e=U5.encode(ws),M_e=2,Ub=class{constructor(e,l){let{escapeName:t}=this.constructor,r=X.isString(l),i=`Content-Disposition: form-data; name="${t(e)}"${!r&&l.name?`; filename="${t(l.name)}"`:""}${ws}`;r?l=U5.encode(String(l).replace(/\r?\n|\r\n?/g,ws)):i+=`Content-Type: ${l.type||"application/octet-stream"}${ws}`,this.headers=U5.encode(i+ws),this.contentLength=r?l.byteLength:l.size,this.size=this.headers.byteLength+this.contentLength+M_e,this.name=e,this.value=l}async*encode(){yield this.headers;let{value:e}=this;X.isTypedArray(e)?yield e:yield*Ef(e),yield F_e}static escapeName(e){return String(e).replace(/[\r\n"]/g,l=>({"\r":"%0D","\n":"%0A",'"':"%22"})[l])}},$_e=(n,e,l)=>{let{tag:t="form-data-boundary",size:r=25,boundary:i=t+"-"+X.generateString(r,L_e)}=l||{};if(!X.isFormData(n))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let s=U5.encode("--"+i+ws),u=U5.encode("--"+i+"--"+ws+ws),a=u.byteLength,c=Array.from(n.entries()).map(([p,m])=>{let h=new Ub(p,m);return a+=h.size,h});a+=s.byteLength*c.length,a=X.toFiniteNumber(a);let f={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(a)&&(f["Content-Length"]=a),e&&e(f),Qz.Readable.from(async function*(){for(let p of c)yield s,yield*p.encode();yield u}())},Zz=$_e;var eG=St(require("stream"),1),Bb=class extends eG.default.Transform{__transform(e,l,t){this.push(e),t()}_transform(e,l,t){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,l)}this.__transform(e,l,t)}},nG=Bb;var j_e=(n,e)=>X.isAsyncFn(n)?function(...l){let t=l.pop();n.apply(this,l).then(r=>{try{e?t(null,...e(r)):t(null,r)}catch(i){t(i)}},t)}:n,lG=j_e;var tG={flush:Oi.default.constants.Z_SYNC_FLUSH,finishFlush:Oi.default.constants.Z_SYNC_FLUSH},U_e={flush:Oi.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Oi.default.constants.BROTLI_OPERATION_FLUSH},rG=X.isFunction(Oi.default.createBrotliDecompress),{http:B_e,https:H_e}=fG.default,q_e=/https:?/,iG=Nt.protocols.map(n=>n+":");function V_e(n,e){n.beforeRedirects.proxy&&n.beforeRedirects.proxy(n),n.beforeRedirects.config&&n.beforeRedirects.config(n,e)}function dG(n,e,l){let t=e;if(!t&&t!==!1){let r=(0,uG.getProxyForUrl)(l);r&&(t=new URL(r))}if(t){if(t.username&&(t.auth=(t.username||"")+":"+(t.password||"")),t.auth){(t.auth.username||t.auth.password)&&(t.auth=(t.auth.username||"")+":"+(t.auth.password||""));let i=Buffer.from(t.auth,"utf8").toString("base64");n.headers["Proxy-Authorization"]="Basic "+i}n.headers.host=n.hostname+(n.port?":"+n.port:"");let r=t.hostname||t.host;n.hostname=r,n.host=r,n.port=t.port,n.path=l,t.protocol&&(n.protocol=t.protocol.includes(":")?t.protocol:`${t.protocol}:`)}n.beforeRedirects.proxy=function(i){dG(i,e,i.href)}}var z_e=typeof process<"u"&&X.kindOf(process)==="process",G_e=n=>new Promise((e,l)=>{let t,r,i=(a,c)=>{r||(r=!0,t&&t(a,c))},s=a=>{i(a),e(a)},u=a=>{i(a,!0),l(a)};n(s,u,a=>t=a).catch(u)}),X_e=({address:n,family:e})=>{if(!X.isString(n))throw TypeError("address must be a string");return{address:n,family:e||(n.indexOf(".")<0?6:4)}},sG=(n,e)=>X_e(X.isObject(n)?n:{address:n,family:e}),hG=z_e&&function(e){return G_e(async function(t,r,i){let{data:s,lookup:u,family:a}=e,{responseType:c,responseEncoding:f}=e,p=e.method.toUpperCase(),m,h=!1,g;if(u){let ue=lG(u,ve=>X.isArray(ve)?ve:[ve]);u=(ve,q,re)=>{ue(ve,q,(te,ne,Bl)=>{if(te)return re(te);let Rn=X.isArray(ne)?ne.map(Ge=>sG(Ge)):[sG(ne,Bl)];q.all?re(te,Rn):re(te,Rn[0].address,Rn[0].family)})}}let _=new pG.default,S=()=>{e.cancelToken&&e.cancelToken.unsubscribe(T),e.signal&&e.signal.removeEventListener("abort",T),_.removeAllListeners()};i((ue,ve)=>{m=!0,ve&&(h=!0,S())});function T(ue){_.emit("abort",!ue||ue.type?new nr(null,e,g):ue)}_.once("abort",r),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(T),e.signal&&(e.signal.aborted?T():e.signal.addEventListener("abort",T)));let x=aa(e.baseURL,e.url),v=new URL(x,"http://localhost"),b=v.protocol||iG[0];if(b==="data:"){let ue;if(p!=="GET")return As(t,r,{st
`+i.map(_G).join(`
`):" "+_G(i[0]):"as no adapter specified";throw new Fe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return t},adapters:Hb};function qb(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new nr(null,n)}function Tf(n){return qb(n),n.headers=It.from(n.headers),n.data=k5.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),bf.getAdapter(n.adapter||x4.adapter)(n).then(function(t){return qb(n),t.data=k5.call(n,n.transformResponse,t),t.headers=It.from(t.headers),t},function(t){return P5(t)||(qb(n),t&&t.response&&(t.response.data=k5.call(n,n.transformResponse,t.response),t.response.headers=It.from(t.response.headers))),Promise.reject(t)})}var EG=n=>n instanceof It?n.toJSON():n;function Ni(n,e){e=e||{};let l={};function t(c,f,p){return X.isPlainObject(c)&&X.isPlainObject(f)?X.merge.call({caseless:p},c,f):X.isPlainObject(f)?X.merge({},f):X.isArray(f)?f.slice():f}function r(c,f,p){if(X.isUndefined(f)){if(!X.isUndefined(c))return t(void 0,c,p)}else return t(c,f,p)}function i(c,f){if(!X.isUndefined(f))return t(void 0,f)}function s(c,f){if(X.isUndefined(f)){if(!X.isUndefined(c))return t(void 0,c)}else return t(void 0,f)}function u(c,f,p){if(p in e)return t(c,f);if(p in n)return t(void 0,c)}let a={url:i,method:i,data:i,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:u,headers:(c,f)=>r(EG(c),EG(f),!0)};return X.forEach(Object.keys(Object.assign({},n,e)),function(f){let p=a[f]||r,m=p(n[f],e[f],f);X.isUndefined(m)&&p!==u||(l[f]=m)}),l}var Vb={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Vb[n]=function(t){return typeof t===n||"a"+(e<1?"n ":" ")+n}});var bG={};Vb.transitional=function(e,l,t){function r(i,s){return"[Axios v"+ca+"] Transitional option '"+i+"'"+s+(t?". "+t:"")}return(i,s,u)=>{if(e===!1)throw new Fe(r(s," has been removed"+(l?" in "+l:"")),Fe.ERR_DEPRECATED);return l&&!bG[s]&&(bG[s]=!0,console.warn(r(s," has been deprecated since v"+l+" and will be removed in the near future"))),e?e(i,s,u):!0}};function Y_e(n,e,l){if(typeof n!="object")throw new Fe("options must be an object",Fe.ERR_BAD_OPTION_VALUE);let t=Object.keys(n),r=t.length;for(;r-- >0;){let i=t[r],s=e[i];if(s){let u=n[i],a=u===void 0||s(u,i,n);if(a!==!0)throw new Fe("option "+i+" must be "+a,Fe.ERR_BAD_OPTION_VALUE);continue}if(l!==!0)throw new Fe("Unknown option "+i,Fe.ERR_BAD_OPTION)}}var Sf={assertOptions:Y_e,validators:Vb};var Rs=Sf.validators,R4=class{constructor(e){this.defaults=e,this.interceptors={request:new vb,response:new vb}}async request(e,l){try{return await this._request(e,l)}catch(t){if(t instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;let i=r.stack?r.stack.replace(/^.+\n/,""):"";t.stack?i&&!String(t.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.stack+=`
`+i):t.stack=i}throw t}}_request(e,l){typeof e=="string"?(l=l||{},l.url=e):l=e||{},l=Ni(this.defaults,l);let{transitional:t,paramsSerializer:r,headers:i}=l;t!==void 0&&Sf.assertOptions(t,{silentJSONParsing:Rs.transitional(Rs.boolean),forcedJSONParsing:Rs.transitional(Rs.boolean),clarifyTimeoutError:Rs.transitional(Rs.boolean)},!1),r!=null&&(X.isFunction(r)?l.paramsSerializer={serialize:r}:Sf.assertOptions(r,{encode:Rs.function,serialize:Rs.function},!0)),l.method=(l.method||this.defaults.method||"get").toLowerCase();let s=i&&X.merge(i.common,i[l.method]);i&&X.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),l.headers=It.concat(s,i);let u=[],a=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(l)===!1||(a=a&&_.synchronous,u.unshift(_.fulfilled,_.rejected))});let c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let f,p=0,m;if(!a){let g=[Tf.bind(this),void 0];for(g.unshift.apply(g,u),g.push.apply(g,c),m=g.length,f=Promise.resolve(l);p<m;)f=f.then(g[p++],g[p++]);return f}m=u.length;let h=l;for(p=0;p<m;){let g=u[p++],_=u[p++];try{h=g(h)}catch(S){_.call(this,S);break}}try{f=Tf.call(this,h)}catch(g){return Promise.reject(g)}for(p=0,m=c.length;p<m;)f=f.then(c[p++],c[p++]);return f}getUri(e){e=Ni(this.defaults,e);let l=aa(e.baseURL,e.url);return ua(l,e.params,e.paramsSerializer)}};X.forEach(["delete","get","head","options"],function(e){R4.prototype[e]=function(l,t){return this.request(Ni(t||{},{method:e,url:l,data:(t||{}).data}))}});X.forEach(["post","put","patch"],function(e){function l(t){return function(i,s,u){return this.request(Ni(u||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}R4.prototype[e]=l(),R4.prototype[e+"Form"]=l(!0)});var B5=R4;var zb=class n{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let l;this.promise=new Promise(function(i){l=i});let t=this;this.promise.then(r=>{if(!t._listeners)return;let i=t._listeners.length;for(;i-- >0;)t._listeners[i](r);t._listeners=null}),this.promise.then=r=>{let i,s=new Promise(u=>{t.subscribe(u),i=u}).then(r);return s.cancel=function(){t.unsubscribe(i)},s},e(function(i,s,u){t.reason||(t.reason=new nr(i,s,u),l(t.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 l=this._listeners.indexOf(e);l!==-1&&this._listeners.splice(l,1)}static source(){let e;return{token:new n(function(r){e=r}),cancel:e}}},TG=zb;function Gb(n){return function(l){return n.apply(null,l)}}function Xb(n){return X.isObject(n)&&n.isAxiosError===!0}var Wb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Wb).forEach(([n,e])=>{Wb[e]=n});var SG=Wb;function xG(n){let e=new B5(n),l=O5(B5.prototype.request,e);return X.extend(l,B5.proto
`},timeout:.1}),await dataBase.push(t,Jb)}globalThis.localLog={set:async function(n,e,l){uEe(n,e,l)}};function sEe(){pa.default.existsSync("log")||pa.default.mkdirSync("log");let n="log/info.log";return pa.default.existsSync(n)?pa.default.readFileSync(n).toString():(pa.default.writeFileSync(n,""),"")}function uEe(n){pa.default.writeFileSync("log/info.log",sEe()+`
`+n)}globalThis.req=aEe;async function aEe(n,e){try{let l=e&&e.data||null,t=e&&e.postType||null,r=e&&e.buffer||0,i=e&&e.timeout||5e3,s=(e&&e.redirect||1)===1,u=e.proxy??!1,a=e?e.headers||{}:{};t==="form"?(a["Content-Type"]="application/x-www-form-urlencoded",l!=null&&(l=kG.default.stringify(l,{encode:!1}))):t==="form-data"&&(a["Content-Type"]="multipart/form-data",l=AG(l));let c=r===1||r===2?"arraybuffer":void 0,f;u?f=LG.default.httpsOverHttp({proxy:{host:"127.0.0.1",port:7890}}):f=PG.default.Agent({rejectUnauthorized:!1});let p=await O4(n,{responseType:c,method:e&&e.method||"get",headers:a,data:l,timeout:i,maxRedirects:s?null:0,httpsAgent:f});l=p.data;let m={};for(let h of p.headers){let g=h[1];m[h[0]]=Array.isArray(g)&&g.length===1?g[0]:g}if(!r)typeof l=="object"&&(l=JSON.stringify(l));else{if(r===1)return{code:p.status,headers:m,content:l};if(r===2)return{code:p.status,headers:m,content:l.toString("base64")};if(r===3){let h=e.stream;return h.onResp&&await h.onResp({code:p.status,headers:m}),h.onData?(l.on("data",async g=>{await h.onData(g)}),l.on("end",async()=>{h.onDone&&await h.onDone()})):h.onDone&&await h.onDone(),"stream..."}}return{code:p.status,headers:m,content:l}}catch(l){let t=l.response;try{return{code:t.status,headers:t.headers,content:JSON.stringify(t.data)}}catch{return{headers:{},content:""}}}}globalThis.md5X=oEe;function oEe(n){return DG.default.createHash("md5").update(Buffer.from(n,"utf8")).digest("hex")}globalThis.js2Proxy=function(n,e,l){let t=Object.keys(l).length===0?" ":encodeURIComponent(JSON.stringify(l));return n.server.address().dynamic+n.server.prefix+"/proxy/"+encodeURIComponent(e)+"/"+t+"/"};var cEe=["DEBUG","INFO","WARNING","ERROR"];var Ns=class{constructor(e,l="DEBUG"){this.app_name=e,this.level=l,this.level_index=cEe.indexOf(l)}format(e,l){let t=80;switch(e){case"INFO":t=t+1;break;case"WARNING":t=t-2;break;default:break}return l.length<t&&((t-l.length)%2===0?l="#".repeat(Math.floor((t-l.length)/2))+l+"#".repeat(Math.floor((t-l.length)/2)):l="#".repeat(Math.floor((t-l.length)/2))+l+"#".repeat(Math.floor((t-l.length)/2)+1)),l}getTime(){let e=new Date;return e.toLocaleDateString().replace(/\//g,"-")+" "+e.toTimeString().substr(0,8)+","+e.getMilliseconds().toString()}formatMessage(e,l,t){return t&&(l=this.format(e,l)),`${this.getTime()} - ${this.app_name} - ${e}: ${l}`}async log(e){console.debug(e),await req("http://127.0.0.1:8099/upload",{data:{log:e+`
`},timeout:.1})}async info(e,l){this.level_index<=1&&await this.log(this.formatMessage("INFO",e,l))}async warning(e,l){this.level_index<=2&&await this.log(this.formatMessage("WARNING",e,l))}async error(e,l){this.level_index<=3&&await this.log(this.formatMessage("ERROR",e,l))}async debug(e,l){this.level_index<=0&&await this.log(this.formatMessage("DEBUG",e,l))}};var Pl=class extends kl{constructor(){super(),this.jadeLog=new Ns(this.getAppName(),"DEBUG")}async init(e,l){await this.jadeLog.info("\u521D\u59CB\u5316",!0);try{await await req("http://127.0.0.1:8099/clear",{timeout:.1}),this.siteKey=this.getJSName(),this.siteType=this.getType(),this.cfgObj=e.server.config[this.siteKey],this.deviceKey=e.server.prefix+"/",this.db=e.server.db,this.catOpenStatus=!0,this.danmuStaus=!1;try{await this.loadFilterAndClasses()?await this.jadeLog.debug("\u8BFB\u53D6\u7F13\u5B58\u5217\u8868\u548C\u4E8C\u7EA7\u83DC\u5355\u6210\u529F"):(await this.jadeLog.warning("\u8BFB\u53D6\u7F13\u5B58\u5217\u8868\u548C\u4E8C\u7EA7\u83DC\u5355\u5931\u8D25"),await this.writeFilterAndClasses())}catch(t){await this.db.push(this.deviceKey+"classes",{}),await this.db.push(this.deviceKey+"filterObj",{}),await this.jadeLog.error("\u8BFB\u53D6\u7F13\u5B58\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:"+t,!1)}}catch(t){await this.jadeLog.error(`\u521D\u59CB\u5316\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${t}`)}await this.jadeLog.info("\u521D\u59CB\u5316\u5B8C\u6210",!0)}async loadFilterAndClasses(){return this.classes=await this.getClassesCache(),this.filterObj=await this.getFiletObjCache(),this.classes.length>0?!0:(await this.db.push(this.deviceKey+"classes",{}),await this.db.push(this.deviceKey+"filterObj",{}),!1)}async writeFilterAndClasses(){this.catOpenStatus&&this.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await this.setClasses(),await this.setFilterObj(),await this.db.push(this.deviceKey+"classes",this.classes),await this.db.push(this.deviceKey+"filterObj",this.filterObj)}async getClassesCache(){let e=await this.db.getObjectDefault(this.deviceKey+"classes",{});return de.isEmpty(e)?this.classes:e}async getFiletObjCache(){let e=await this.db.getObjectDefault(this.deviceKey+"filterObj",{});return de.isEmpty(e)?this.filterObj:e}async home(e,l){return this.vodList=[],await this.jadeLog.info("\u6B63\u5728\u89E3\u6790\u9996\u9875\u7C7B\u522B",!0),await this.setHome(),await this.jadeLog.debug(`\u9996\u9875\u7C7B\u522B\u5185\u5BB9\u4E3A:${this.result.home(this.classes,[],this.filterObj)}`),await this.jadeLog.info("\u9996\u9875\u7C7B\u522B\u89E3\u6790\u5B8C\u6210",!0),this.result.home(this.classes,[],this.filterObj)}async homeVod(){await this.jadeLog.info("\u6B63\u5728\u89E3\u6790\u9996\u9875\u5185\u5BB9",!0);try{return await this.setHomeVod(),await this.jadeLog.debug(`\u9996\u9875\u5185\u5BB9\u4E3A:${this.result.homeVod(this.homeVodList)}`),await this.jadeLog.info("\u9996\u9875\u5185\u5BB9\u89E3\u6790\u5B8C\u6210",!0),this.result.homeVod(this.homeVodList)}catch(e){await this.jadeLog.error(`\u9996\u9875\u5185\u5BB9\u89E3\u6790\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${e}`)}}async category(e,l){let t=e.body.id,r=e.body.page,i=!0,s=e.body.filters;if(this.page=parseInt(r),await this.jadeLog.info(`\u6B63\u5728\u89E3\u6790\u5206\u7C7B\u9875\u9762,tid = ${t},pg = ${r},extend = ${JSON.stringify(s)}`),t==="\u6700\u8FD1\u66F4\u65B0")return this.page=0,await this.homeVod();try{return this.vodList=[],await this.setCategory(t,r,i,s),await this.jadeLog.debug(`\u5206\u7C7B\u9875\u9762\u5185\u5BB9\u4E3A:${this.result.category(this.vodList,this.page,this.count,this.limit,this.total)}`),await this.jadeLog.info("\u5206\u7C7B\u9875\u9762\u89E3\u6790\u5B8C\u6210",!0),this.result.category(this.vodList,this.page,this.count,this.limit,this.total)}catch(u){await this.jadeLog.error(`\u5206\u7C7B\u9875\u89E3\u6790\u5931\u8D25,\u5931\u8D25\u539F\u56E0\u4E3A:${u}`)}}async detail(e,l){await this.jadeLog.debug(`\u83B7\u53D6\u8BE6\u60C5\u9875\u9762:${JSON.stringify(e.body)}`);let r=(Array.isArray(e.body.id)?e.body.id:[e.body.id])[0];this.vodDetail=new
`,"").replaceAll(" ","");s.value.push({n:m,v:p})}if(s.value.length>0){i.push(s);let f=await this.getHtml(s.value[0].v),p=await this.getSortFilter(f);p.value.length>0&&i.push(p)}else{let f=await this.getSortFilter(c);f.value.length>0&&i.push(f)}}else{let s=e("div.row").slice(1,9),u=e('[class="title-box"]').slice(1,9);for(let f=0;f<u.length;f++){let p={name:e(e(u[f]).find("h2")).text(),key:"type",value:[]};for(let m of e(s[f]).find("a")){let h=m.attribs.href;h.indexOf(this.siteUrl)>-1&&p.value.push({n:e(m).text(),v:h})}i.push(p)}let a=await this.getHtml(t),c=await this.getSortFilter(a);c.value.length>0&&i.push(c)}return i}async setFilterObj(){let e=await this.getHtml(this.siteUrl),l=this.classes.slice(1);for(let t=0;t<l.length;t++){let r=l[t].type_name,i=l[t].type_id,s=await this.getFilter(e,t,i,r);s.length>1&&t<4&&(i=s[0].value[0].v,this.classes[t+1]=this.getTypeDic(r,i)),this.filterObj[i]=s}}async parseVodShortListFromDoc(e){let l=[],t=e("div.video-img-box");for(let r of t){let i=new Bn,s=e(r).find("img").attr("data-src");if(s!==void 0){i.vod_pic=s;let u=e(r).find("a").attr("href");i.vod_id=u.split("/")[4],i.vod_name=u.split("/")[4];let a=e(e(r).find('[class="sub-title"]')).text().split(`
`);a.length>1?i.vod_remarks=a[1].replaceAll(" ","").replaceAll(" ",""):i.vod_remarks="\u7CBE\u9009",!de.isEmpty(i.vod_pic)&&i.vod_remarks!=="[\u9650\u6642\u512A\u60E0]\u53EA\u97001\u5143\u5373\u53EF\u7121\u9650\u4E0B\u8F09"&&l.push(i)}}return l}async parseVodDetailFromDoc(e){let l=new tl,t=e('[class="header-left"]');l.vod_name=e(e(t).find("h4")).text();let r=Ml(/<video poster="(.*?)" id=/,e.html());l.vod_pic=r,l.vod_year=e(e('[class="inactive-color"]')).text();let i=e(e('[class="header-right d-none d-md-block"] > h6')).text().replaceAll(`
`,"").replaceAll("\u25CF",""),s=[],u=Ml(/var hlsUrl = '(.*?)';/,e.html());s.push(i+"$"+u);let a=[];a.push(s.join("#"));let c=["Jable"];return l.vod_play_from=c.join("$$$"),l.vod_play_url=a.join("$$$"),l}async setHomeVod(){let e=await this.getHtml(this.siteUrl);this.homeVodList=await this.parseVodShortListFromDoc(e)}async setDetail(e){let l=await this.getHtml(this.siteUrl+"/videos/"+e+"/");this.vodDetail=await this.parseVodDetailFromDoc(l)}async setCategory(e,l,t,r){let i=r.type??e,s=r.sort??"video_viewed";this.limit=24;let u;this.total=0,this.count=0,e.indexOf("latest-updates")>1?u=`https://jable.tv/latest-updates/?mode=async&function=get_block&block_id=list_videos_latest_videos_list&sort_by=post_date&from=${l}&_=1709730132217`:u=i+`/${l}/?mode=async&function=get_block&block_id=list_videos_common_videos_list&sort_by=${s}&_=${new Date().getTime()}`;let a=await this.getHtml(u);this.vodList=await this.parseVodShortListFromDoc(a);let c=a(a('[class="page-item"]').slice(-1)[0]).text();c.indexOf("\u6700\u5F8C")>-1||(parseInt(c)===this.page||de.isEmpty(c))&&(await this.jadeLog.debug("\u5206\u7C7B\u9875\u9762\u5230\u5E95\u4E86"),this.total=this.page,this.count=this.page)}async setSearch(e,l){let t=this.siteUrl+`/search/${e}/`,r=await this.getHtml(t);this.vodList=await this.parseVodShortListFromDocByCategory(r)}},ul=new Qb;var Zb=class extends Pl{constructor(){super()}getName(){return ul.getName()}getAppName(){return ul.getAppName()}getJSName(){return ul.getJSName()}async init(e,l){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await ul.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await ul.initCookie(e.server.config.biliCookie),await ul.spiderInit(e),ul.cfgObj.code=0,ul.catOpenStatus=!0,ul.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,l)}async setClasses(){await ul.setClasses(),this.classes=ul.classes}async setFilterObj(){await ul.setFilterObj(),this.filterObj=ul.filterObj}async setHomeVod(){await ul.setHomeVod(),this.homeVodList=ul.homeVodList}async setCategory(e,l,t,r){await ul.setCategory(e,l,t,r),this.vodList=ul.vodList}async setDetail(e){await ul.setDetail(e),this.vodDetail=ul.vodDetail}async setPlay(e,l,t){await ul.setPlay(e,l,t),this.playUrl=ul.playUrl,this.result=ul.result}async setSearch(e,l,t){await ul.setSearch(e,l,t),this.vodList=ul.vodList,this.result=ul.result}async setProxy(e,l){return await ul.proxy(e,l)}},Is=new Zb;async function FG(n,e){return await Is.init(n,e)}async function MG(n,e){return await Is.home(n,e)}async function fEe(n,e){return await Is.homeVod(n,e)}async function $G(n,e){return await Is.category(n,e)}async function jG(n,e){return await Is.detail(n,e)}async function UG(n,e){return await Is.play(n,e)}async function BG(n,e){return await Is.search(n,e)}async function pEe(n,e){return await Is.proxy(n,e)}var HG={meta:{key:ul.getJSName(),name:ul.getName(),type:ul.getType()},api:async n=>{n.post("/init",FG),n.post("/home",MG),n.post("/category",$G),n.post("/detail",jG),n.post("/play",UG),n.post("/search",BG),n.get("/proxy/:what/:ids/:end",pEe)},spider:{init:FG,home:MG,homeVod:fEe,category:$G,detail:jG,play:UG,search:BG}};var eT=class extends Pl{constructor(){super()}getName(){return"\u2503\u63A8\u9001\u2503"}getAppName(){return"\u63A8\u9001"}getJSName(){return"push"}getType(){return 4}async init(e,l){return await this.jadeLog.debug("\u521D\u59CB\u5316",!0),await Gc(e.server.config),{}}async check(e,l){let t=e.body.clip;return await this.jadeLog.debug(`\u526A\u5207\u677F\u8F93\u5165\u5185\u5BB9\u4E3A:${t}`),t.startsWith("http")?(await this.jadeLog.debug("\u6EE1\u8DB3\u63A8\u9001\u6761\u4EF6",!0),"true"):(await this.jadeLog.debug("\u4E0D\u6EE1\u8DB3\u63A8\u9001\u6761\u4EF6",!0),"false")}async parseVodDetailfromJson(e){let l=new tl;l.vod_pic=Fr+"/resources/push.jpg";let t=bc.exec(e),r=Tc.exec(e);if(t!==null&&t.length>0){let i=await NE([e]);l.vod_play_from=de.keys(i).join("$$$"),l.vod_play_url=de.values(i).join("$$$")}else
`,""),l.vod_actor=Ml(/出演女优(.*?)\n/,r).replaceAll(":","").replaceAll(`
`,""),l.vod_remarks=Ml(/是否有码(.*?)\n/,r).replaceAll(":","").replaceAll(`
`,""),l.vod_play_from="BT",l.vod_play_url=l.vod_name+"$"+Ml(/磁力链接: (.*)复制代码/,r),l}async setClasses(){let e=await this.getHtml(),l=e('[id="category_1"]').find("tr").slice(0,-1);for(let t of l){let r=e(e(t).find('[class="fl_icn_g"]')).find("a");for(let i of r){let s=i.attribs.href,u=e(i).find("img")[0].attribs.alt;this.classes.push(this.getTypeDic(u,s))}}}async getFilter(e){let l=[],t={key:1,name:"\u7C7B\u578B",value:[]},r=e('[id="thread_types"]').find("a");for(let u of r){let a="";u.children.length>1?a=u.children[0].data+":"+e(u.children[1]).text():a=u.children[0].data,t.value.push({n:a,v:u.attribs.href})}l.push(t);let i={key:1,name:"\u4E3B\u9898",value:[]},s=e('[class="tf"]').find("a");for(let u of s){let a=e(u).text();a!=="\u66F4\u591A"&&a!=="\u663E\u793A\u7F6E\u9876"&&i.value.push({n:e(u).text(),v:u.attribs.href})}return l.push(i),l}async setFilterObj(){for(let e of this.classes){let l=e.type_name,t=e.type_id;if(l!=="\u6700\u8FD1\u66F4\u65B0"){let r=await this.getHtml(this.siteUrl+"/"+t);this.filterObj[t]=await this.getFilter(r)}}}async setHomeVod(){let e=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(e)}async setCategory(e,l,t,r){r[1]!==void 0&&r[1]==="javascript:;"||(e=r[1]??e);let i,s=e.split(".")[0].split("-");s.length>2?(s[2]=l,i=this.siteUrl+"/"+s.join("-")+".html"):i=this.siteUrl+"/"+e+"&page="+l;let u=await this.getHtml(i);this.vodList=await this.parseVodShortListFromDocByCategory(u)}async setDetail(e){let l=await this.getHtml(this.siteUrl+"/"+e);this.vodDetail=await this.parseVodDetailFromDoc(l)}async proxy(e,l){await this.jadeLog.debug(`\u6B63\u5728\u8BBE\u7F6E\u53CD\u5411\u4EE3\u7406 segments = ${e.join(",")},headers = ${JSON.stringify(l)}`);let t=e[0],r=Mr(e[1]);if(t==="detail"){await this.jadeLog.debug(`\u53CD\u5411\u4EE3\u7406ID\u4E3A:${r}`);let i=await this.getHtml(this.siteUrl+"/"+r),s=await this.parseVodDetailFromDoc(i);await this.jadeLog.debug(`\u56FE\u7247\u5730\u5740\u4E3A:${s.vod_pic}`);let u;return de.isEmpty(l)?u=await req(s.vod_pic,{buffer:2,headers:{Referer:r,"User-Agent":Lr}}):u=await req(s.vod_pic,{buffer:2,headers:l}),JSON.stringify({code:u.code,buffer:2,content:u.content,headers:u.headers})}return JSON.stringify({code:500,content:""})}},al=new nT;var lT=class extends Pl{constructor(){super()}getName(){return al.getName()}getAppName(){return al.getAppName()}getJSName(){return al.getJSName()}async init(e,l){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await al.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await al.initCookie(e.server.config.biliCookie),await al.spiderInit(e),al.cfgObj.code=0,al.catOpenStatus=!0,al.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,l)}async setClasses(){await al.setClasses(),this.classes=al.classes}async setFilterObj(){await al.setFilterObj(),this.filterObj=al.filterObj}async setHomeVod(){await al.setHomeVod(),this.homeVodList=al.homeVodList}async setCategory(e,l,t,r){await al.setCategory(e,l,t,r),this.vodList=al.vodList}async setDetail(e){await al.setDetail(e),this.vodDetail=al.vodDetail}async setPlay(e,l,t){await al.setPlay(e,l,t),this.playUrl=al.playUrl,this.result=al.result}async setSearch(e,l,t){await al.setSearch(e,l,t),this.vodList=al.vodList,this.result=al.result}async setProxy(e,l){return await al.proxy(e,l)}},Cs=new lT;async function WG(n,e){return await Cs.init(n,e)}async function KG(n,e){return await Cs.home(n,e)}async function dEe(n,e){return await Cs.homeVod(n,e)}async function YG(n,e){return await Cs.category(n,e)}async function JG(n,e){return await Cs.detail(n,e)}async function QG(n,e){return await Cs.play(n,e)}async function ZG(n,e){return await Cs.search(n,e)}async function hEe(n,e){return await Cs.proxy(n,e)}var eX={meta:{key:al.getJSName(),name:al.getName(),type:al.getType()},api:async n=>{n.post("/init",WG),n.post("/home",KG),n.post("/category",YG),n.post("/detail",JG),n.post("/play",QG),n.post("/search",ZG),n.get
2024-05-20 15:50:52 +08:00
`),a=e(s).find("a"),c=[{n:"\u5168\u90E8",v:r}],f=t.toString();for(let p of a){let m=e(p).text().replaceAll(`
2024-05-23 19:28:35 +08:00
`,""),h=p.attribs.href;h!==void 0&&c.push({n:m,v:h})}u=u.filter(p=>p!==""),this.filterObj[r].push({key:f,name:u[0],value:c})}let i=e('[id="side-menu"]').find("li");for(let s of i){let u=e(s).find("a")[0].attribs.href;if(u!==void 0&&u.indexOf(this.siteUrl)>-1){let a={type_name:e(s).text(),type_id:u};this.classes.push(a)}}}async setHomeVod(){let e=await this.getHtml(this.siteUrl);this.homeVodList=await this.parseVodShortListFromDoc(e)}async setCategory(e,l,t,r){r[1]!==void 0&&r[1]!=="1"&&(e=r[1]),await this.jadeLog.info(`tid = ${e}`);let i="";e.indexOf(this.siteUrl)>-1?i=e+l.toString()+".html":i=this.siteUrl,this.limit=36;let s=await this.getHtml(i);this.vodList=await this.parseVodShortListFromDoc(s)}async setDetail(e){let l=await this.getHtml(e),t=Ml(/video\/(\w+).html/,e);this.vodDetail=await this.parseVodDetailFromDoc(l,t)}async setPlay(e,l,t){this.playUrl=l,this.playHeader={}}async setSearch(e,l){let t=this.siteUrl+"search/"+encodeURIComponent(e),r=await this.getHtml(t);this.vodList=await this.parseVodShortListFromDoc(r)}async proxy(e,l){return super.proxy(e,l)}},ml=new gT;var yT=class extends Pl{constructor(){super()}getName(){return ml.getName()}getAppName(){return ml.getAppName()}getJSName(){return ml.getJSName()}async init(e,l){dataBase=e.server.db,this.getAppName().indexOf("\u963F\u91CC")>-1||this.getAppName().indexOf("\u5382\u957F")>-1||this.getAppName()==="push_agent"?await ml.initCloud(e.server.config):this.getAppName()==="\u54D4\u54E9\u54D4\u54E9"&&await ml.initCookie(e.server.config.biliCookie),await ml.spiderInit(e),ml.cfgObj.code=0,ml.catOpenStatus=!0,ml.classes.push({type_name:"\u6700\u8FD1\u66F4\u65B0",type_id:"\u6700\u8FD1\u66F4\u65B0"}),await super.init(e,l)}async setClasses(){await ml.setClasses(),this.classes=ml.classes}async setFilterObj(){await ml.setFilterObj(),this.filterObj=ml.filterObj}async setHomeVod(){await ml.setHomeVod(),this.homeVodList=ml.homeVodList}async setCategory(e,l,t,r){await ml.setCategory(e,l,t,r),this.vodList=ml.vodList}async setDetail(e){await ml.setDetail(e),this.vodDetail=ml.vodDetail}async setPlay(e,l,t){await ml.setPlay(e,l,t),this.playUrl=ml.playUrl,this.result=ml.result}async setSearch(e,l,t){await ml.setSearch(e,l,t),this.vodList=ml.vodList,this.result=ml.result}async setProxy(e,l){return await ml.proxy(e,l)}},Bs=new yT;async function zX(n,e){return await Bs.init(n,e)}async function GX(n,e){return await Bs.home(n,e)}async function kEe(n,e){return await Bs.homeVod(n,e)}async function XX(n,e){return await Bs.category(n,e)}async function WX(n,e){return await Bs.detail(n,e)}async function KX(n,e){return await Bs.play(n,e)}async function YX(n,e){return await Bs.search(n,e)}async function PEe(n,e){return await Bs.proxy(n,e)}var JX={meta:{key:ml.getJSName(),name:ml.getName(),type:ml.getType()},api:async n=>{n.post("/init",zX),n.post("/home",GX),n.post("/category",XX),n.post("/detail",WX),n.post("/play",KX),n.post("/search",YX),n.get("/proxy/:what/:ids/:end",PEe)},spider:{init:zX,home:GX,homeVod:kEe,category:XX,detail:WX,play:KX,search:YX}};var QX=[19970,19972,19973,19974,19983,19986,19991,19999,2e4,20001,20003,20006,20009,20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,null,20112,20118,20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,20151,20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,20188,20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,20218,20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,20242,20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,20270,20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,20293,20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,20328,20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,20352,20353,20354,20357,20358,20359,20
`)),e.push(r)}return e}async parseVodShortListFromDocBySearch(n){let e=n('[class="show-list"]').find("li"),l=[];for(let t of e){let r=new Bn;r.vod_id=n(t).find("a")[0].attribs.href;let i=n(t).find("img")[0];r.vod_pic=i.attribs.src,r.vod_name=i.attribs.alt,r.vod_remarks=n(n(t).find('[class="type fn-left"]')).text().replace("\u7C7B\u578B\uFF1A",""),r.vod_remarks!=="\u793E\u5904\u7247"&&r.vod_remarks!=="\u793E\u4FDD\u7247"&&r.vod_remarks!=="\u64B8\u4E1D\u7247"&&r.vod_remarks!=="\u64B8\u4E1D\u52A8\u6F2B"&&l.push(r)}return l}async parseVodDetailFromDoc(n){let e=new tl,l=n('[class="detail-pic fn-left"]').find("img")[0];e.vod_pic=l.attribs.src,e.vod_name=l.attribs.alt;let t=n('[class="info fn-clear"]');for(let c of n(t).find("dl")){let f=n(c).text();f.indexOf("\u4E3B\u6F14")>-1&&(e.vod_actor=f.replaceAll("\u4E3B\u6F14\uFF1A","").replaceAll(`
2024-05-07 17:30:00 +08:00
`,"")),f.indexOf("\u72B6\u6001")>-1&&(e.vod_remarks=f.replaceAll("\u72B6\u6001\uFF1A","").replaceAll(`
`,"")),f.indexOf("\u7C7B\u578B")>-1&&(e.type_name=f.replaceAll("\u7C7B\u578B\uFF1A","").replaceAll(`
`,"")),f.indexOf("\u5730\u533A")>-1&&(e.vod_area=f.replaceAll("\u5730\u533A\uFF1A","").replaceAll(`
`,"")),f.indexOf("\u5BFC\u6F14")>-1&&(e.vod_director=f.replaceAll("\u5BFC\u6F14\uFF1A","").replaceAll(`
`,"")),f.indexOf("\u5E74\u4EFD")>-1&&(e.vod_year=f.replaceAll("\u5E74\u4EFD\uFF1A","").replaceAll(`
`,"")),f.indexOf("\u5267\u60C5")>-1&&(e.vod_content=f.replaceAll("\u5267\u60C5\uFF1A","").replaceAll(`
2024-05-23 19:28:35 +08:00
`,""))}let r={},i=n.html(),s=n('[class="play-list"]'),u=1;for(let c of s){let f=`\u64AD\u653E\u8FDE\u63A5-${u}`,p=[];for(let m of n(c).find("a")){let h=m.attribs.title,g=m.attribs.href;p.push(h+"$"+g)}r[f]=p.join("#"),u=u+1}u=1;let a=n('[class="con4"]');for(let c of a){let f=`\u78C1\u529B\u94FE\u63A5-${u}`,p=[],m=f,h=n(n(c).find("div")).find("a")[0].attribs.href;h!=="javascript:void(0);"&&(p.push(m+"$"+h),r[f]=p.join("#"),u=u+1)}return e.vod_play_url=de.values(r).join("$$$"),e.vod_play_from=de.keys(r).join("$$$"),e}async setHomeVod(){let n=await this.getHtml();this.homeVodList=await this.parseVodShortListFromDoc(n)}async setDetail(n){let e=await this.getHtml(this.siteUrl+n);this.vodDetail=await this.parseVodDetailFromDoc(e)}getExtend(n){if(n.class!==void 0&&n.class!=="\u5168\u90E8")return n.class}async setCategory(n,e,l,t){let r=this.getExtend(t)??n,i;r===n?i=this.siteUrl+r:parseInt(e)===1?i=this.siteUrl+r:i=this.siteUrl+r+`index${e}.html`;let s=await this.getHtml(i);this.vodList=await this.parseVodShortListFromDoc(s)}async setPlay(flag,id,flags){if(flag.indexOf("\u78C1\u529B")>-1)this.playUrl=id;else{let idSplitList=id.split("-"),flag_id=parseInt(idSplitList[1]),episode=parseInt(idSplitList[2].split(".")[0]),$=await this.getHtml(this.siteUrl+id),playJsUrl=Ml(/<script type="text\/javascript" src="(.*?)">/,$.html()),playJsContent=await this.fetch(this.siteUrl+playJsUrl,null,this.getHeader()),playUrlListStr=Ml(/var VideoListJson=(.*?),urlinfo=/,playJsContent),playDic=eval(playUrlListStr);if(this.playUrl=playDic[flag_id][1][episode].split("$")[1],this.playUrl.indexOf("m3u8")===-1){let n=await this.fetch(this.playUrl,null,this.getHeader());this.playUrl=Ml(/url: '(.*?)'/,n)}}}GBKEncode(n){var e=33088;n+="";for(var l=[],t=63,r=0;r<n.length;r++){var i=n.charCodeAt(r);if(i<128)l.push(i);else{var s=QX.indexOf(i);~s?(s+=e,l.push(255&s>>8,255&s)):l.push(t)}}return l}encode(n){let e="";for(let l of n){let t=this.GBKEncode(l);for(let r=0;r<t.length;r++)t[r]="%"+("0"+t[r].toString(16)).substr(-2).toUpperCase();e=e+t.join("")}return e}async setSearch(n,e){let l={searchword:this.encode(n)},t=await this.post(this.siteUrl+"/search.asp",l,this.getHeader(),"form",1),r=pt(dE(t,"gb2312"));this.vodList=await this.parseVodShortListFromDocBySearch(r)}},da=new H5;async function DEe(n){await da.init(n)}async function LEe(n){return await da.home(n)}async function FEe(){return await da.homeVod()}async function MEe(n,e,l,t){return await da.category(n,e,l,t)}async function $Ee(n){return await da.detail(n)}async function jEe(n,e,l){return await da.play(n,e,l)}async function UEe(n,e){return await da.search(n,e)}function hDe(){return{init:DEe,home:LEe,homeVod:FEe,category:MEe,detail:$Ee,play:jEe,search:UEe}}var vT=class extends H5{constructor(){super(),this.siteUrl="https://b.aqdyje.com",this.removeKey="\u9A91\u5175\u8425"}getName(){return"\u{1F51E}\u2503\u7231\u60C5\u7535\u5F71\u7F5118+\u2503\u{1F51E}"}getAppName(){return"\u7231\u60C5\u7535\u5F71\u7F5118+"}getJSName(){return"lovemovie18"}getType(){return 3}async parseVodShortListFromDocBySearch(e){let l=e('[class="show-list"]').find("li"),t=[];for(let r of l){let i=new Bn;i.vod_id=e(r).find("a")[0].attribs.href;let s=e(r).find("img")[0];i.vod_pic=s.attribs.src,i.vod_name=s.attribs.alt,i.vod_remarks=e(e(r).find('[class="type fn-left"]')).text().replace("\u7C7B\u578B\uFF1A",""),(i.vod_remarks==="\u793E\u5904\u7247"||i.vod_remarks==="\u793E\u4FDD\u7247"||i.vod_remarks==="\u64B8\u4E1D\u7247"||i.vod_remarks==="\u64B8\u4E1D\u52A8\u6F2B")&&t.push(i)}return t}async getFilter(e){let l=await this.getHtml(this.siteUrl+e),t=[],r={key:"class",name:"\u7C7B\u578B",value:[]};for(let i of l('[class="subnav-tv fn-left"]').find("a")){let s=l(i).text(),u=i.attribs.href;r.value.push(this.getFliterDic(s,u))}return r.value.length>1&&t.push(r),t}async setClasses(){let e=await this.getHtml(),l=e('[class="nav-item drop-down "]');this.classes=[];for(let t of l){let r=e(t).find("a")[0],i=e(r).text(),s=r.attribs.href;i===this.removeKey&&(this.classes.push(this.getTypeDic(i,s)),this.filterObj[s]=await this.getFilter(s))}}async setC
2024-04-02 15:03:09 +08:00
/*! Bundled license information:
uri-js/dist/es5/uri.all.js:
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
forwarded/index.js:
(*!
* forwarded
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*)
proxy-addr/index.js:
(*!
* proxy-addr
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*)
toad-cache/dist/toad-cache.cjs:
(**
* toad-cache
*
* @copyright 2024 Igor Savin <kibertoad@gmail.com>
* @license MIT
* @version 3.7.0
*)
cookie/index.js:
(*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
mime-db/index.js:
(*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*)
mime-types/index.js:
(*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
rwlock/lib/lock.js:
(*! ReadWriteLock - v5.0.0 - 2015-01-16
* Author: Alberto La Rocca <a71104@gmail.com> (https://github.com/71104)
* Released under the MIT license
* Copyright (c) 2015 Alberto La Rocca *)
*/